├── .gitignore ├── COPYING.LESSER ├── ChangeLog ├── Makefile.am ├── Makefile.in ├── README ├── README.ru ├── aclocal.m4 ├── common.h ├── config.h ├── config.h.in ├── configure ├── configure.in ├── dbg_iter.h ├── depcomp ├── fmt_opts.cpp ├── fmt_opts.h ├── install-sh ├── missing ├── mkinstalldirs ├── rtf2html.cpp ├── rtf_keyword.cpp ├── rtf_keyword.h ├── rtf_table.cpp ├── rtf_table.h ├── rtf_tools.h └── stlport.m4 /.gitignore: -------------------------------------------------------------------------------- 1 | config.log 2 | config.status 3 | test 4 | .deps 5 | autom4te.cache 6 | *.o 7 | Makefile 8 | *.exe 9 | *.gz 10 | *.bz2 11 | stamp-h1 12 | *~ 13 | rtf2html 14 | *.rtf 15 | *.html 16 | *# 17 | *.RTF 18 | *.docx 19 | -------------------------------------------------------------------------------- /COPYING.LESSER: -------------------------------------------------------------------------------- 1 | GNU LESSER GENERAL PUBLIC LICENSE 2 | Version 2.1, February 1999 3 | 4 | Copyright (C) 1991, 1999 Free Software Foundation, Inc. 5 | 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 6 | Everyone is permitted to copy and distribute verbatim copies 7 | of this license document, but changing it is not allowed. 8 | 9 | [This is the first released version of the Lesser GPL. It also counts 10 | as the successor of the GNU Library Public License, version 2, hence 11 | the version number 2.1.] 12 | 13 | Preamble 14 | 15 | The licenses for most software are designed to take away your 16 | freedom to share and change it. By contrast, the GNU General Public 17 | Licenses are intended to guarantee your freedom to share and change 18 | free software--to make sure the software is free for all its users. 19 | 20 | This license, the Lesser General Public License, applies to some 21 | specially designated software packages--typically libraries--of the 22 | Free Software Foundation and other authors who decide to use it. You 23 | can use it too, but we suggest you first think carefully about whether 24 | this license or the ordinary General Public License is the better 25 | strategy to use in any particular case, based on the explanations below. 26 | 27 | When we speak of free software, we are referring to freedom of use, 28 | not price. Our General Public Licenses are designed to make sure that 29 | you have the freedom to distribute copies of free software (and charge 30 | for this service if you wish); that you receive source code or can get 31 | it if you want it; that you can change the software and use pieces of 32 | it in new free programs; and that you are informed that you can do 33 | these things. 34 | 35 | To protect your rights, we need to make restrictions that forbid 36 | distributors to deny you these rights or to ask you to surrender these 37 | rights. These restrictions translate to certain responsibilities for 38 | you if you distribute copies of the library or if you modify it. 39 | 40 | For example, if you distribute copies of the library, whether gratis 41 | or for a fee, you must give the recipients all the rights that we gave 42 | you. You must make sure that they, too, receive or can get the source 43 | code. If you link other code with the library, you must provide 44 | complete object files to the recipients, so that they can relink them 45 | with the library after making changes to the library and recompiling 46 | it. And you must show them these terms so they know their rights. 47 | 48 | We protect your rights with a two-step method: (1) we copyright the 49 | library, and (2) we offer you this license, which gives you legal 50 | permission to copy, distribute and/or modify the library. 51 | 52 | To protect each distributor, we want to make it very clear that 53 | there is no warranty for the free library. Also, if the library is 54 | modified by someone else and passed on, the recipients should know 55 | that what they have is not the original version, so that the original 56 | author's reputation will not be affected by problems that might be 57 | introduced by others. 58 | 59 | Finally, software patents pose a constant threat to the existence of 60 | any free program. We wish to make sure that a company cannot 61 | effectively restrict the users of a free program by obtaining a 62 | restrictive license from a patent holder. Therefore, we insist that 63 | any patent license obtained for a version of the library must be 64 | consistent with the full freedom of use specified in this license. 65 | 66 | Most GNU software, including some libraries, is covered by the 67 | ordinary GNU General Public License. This license, the GNU Lesser 68 | General Public License, applies to certain designated libraries, and 69 | is quite different from the ordinary General Public License. We use 70 | this license for certain libraries in order to permit linking those 71 | libraries into non-free programs. 72 | 73 | When a program is linked with a library, whether statically or using 74 | a shared library, the combination of the two is legally speaking a 75 | combined work, a derivative of the original library. The ordinary 76 | General Public License therefore permits such linking only if the 77 | entire combination fits its criteria of freedom. The Lesser General 78 | Public License permits more lax criteria for linking other code with 79 | the library. 80 | 81 | We call this license the "Lesser" General Public License because it 82 | does Less to protect the user's freedom than the ordinary General 83 | Public License. It also provides other free software developers Less 84 | of an advantage over competing non-free programs. These disadvantages 85 | are the reason we use the ordinary General Public License for many 86 | libraries. However, the Lesser license provides advantages in certain 87 | special circumstances. 88 | 89 | For example, on rare occasions, there may be a special need to 90 | encourage the widest possible use of a certain library, so that it becomes 91 | a de-facto standard. To achieve this, non-free programs must be 92 | allowed to use the library. A more frequent case is that a free 93 | library does the same job as widely used non-free libraries. In this 94 | case, there is little to gain by limiting the free library to free 95 | software only, so we use the Lesser General Public License. 96 | 97 | In other cases, permission to use a particular library in non-free 98 | programs enables a greater number of people to use a large body of 99 | free software. For example, permission to use the GNU C Library in 100 | non-free programs enables many more people to use the whole GNU 101 | operating system, as well as its variant, the GNU/Linux operating 102 | system. 103 | 104 | Although the Lesser General Public License is Less protective of the 105 | users' freedom, it does ensure that the user of a program that is 106 | linked with the Library has the freedom and the wherewithal to run 107 | that program using a modified version of the Library. 108 | 109 | The precise terms and conditions for copying, distribution and 110 | modification follow. Pay close attention to the difference between a 111 | "work based on the library" and a "work that uses the library". The 112 | former contains code derived from the library, whereas the latter must 113 | be combined with the library in order to run. 114 | 115 | GNU LESSER GENERAL PUBLIC LICENSE 116 | TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 117 | 118 | 0. This License Agreement applies to any software library or other 119 | program which contains a notice placed by the copyright holder or 120 | other authorized party saying it may be distributed under the terms of 121 | this Lesser General Public License (also called "this License"). 122 | Each licensee is addressed as "you". 123 | 124 | A "library" means a collection of software functions and/or data 125 | prepared so as to be conveniently linked with application programs 126 | (which use some of those functions and data) to form executables. 127 | 128 | The "Library", below, refers to any such software library or work 129 | which has been distributed under these terms. A "work based on the 130 | Library" means either the Library or any derivative work under 131 | copyright law: that is to say, a work containing the Library or a 132 | portion of it, either verbatim or with modifications and/or translated 133 | straightforwardly into another language. (Hereinafter, translation is 134 | included without limitation in the term "modification".) 135 | 136 | "Source code" for a work means the preferred form of the work for 137 | making modifications to it. For a library, complete source code means 138 | all the source code for all modules it contains, plus any associated 139 | interface definition files, plus the scripts used to control compilation 140 | and installation of the library. 141 | 142 | Activities other than copying, distribution and modification are not 143 | covered by this License; they are outside its scope. The act of 144 | running a program using the Library is not restricted, and output from 145 | such a program is covered only if its contents constitute a work based 146 | on the Library (independent of the use of the Library in a tool for 147 | writing it). Whether that is true depends on what the Library does 148 | and what the program that uses the Library does. 149 | 150 | 1. You may copy and distribute verbatim copies of the Library's 151 | complete source code as you receive it, in any medium, provided that 152 | you conspicuously and appropriately publish on each copy an 153 | appropriate copyright notice and disclaimer of warranty; keep intact 154 | all the notices that refer to this License and to the absence of any 155 | warranty; and distribute a copy of this License along with the 156 | Library. 157 | 158 | You may charge a fee for the physical act of transferring a copy, 159 | and you may at your option offer warranty protection in exchange for a 160 | fee. 161 | 162 | 2. You may modify your copy or copies of the Library or any portion 163 | of it, thus forming a work based on the Library, and copy and 164 | distribute such modifications or work under the terms of Section 1 165 | above, provided that you also meet all of these conditions: 166 | 167 | a) The modified work must itself be a software library. 168 | 169 | b) You must cause the files modified to carry prominent notices 170 | stating that you changed the files and the date of any change. 171 | 172 | c) You must cause the whole of the work to be licensed at no 173 | charge to all third parties under the terms of this License. 174 | 175 | d) If a facility in the modified Library refers to a function or a 176 | table of data to be supplied by an application program that uses 177 | the facility, other than as an argument passed when the facility 178 | is invoked, then you must make a good faith effort to ensure that, 179 | in the event an application does not supply such function or 180 | table, the facility still operates, and performs whatever part of 181 | its purpose remains meaningful. 182 | 183 | (For example, a function in a library to compute square roots has 184 | a purpose that is entirely well-defined independent of the 185 | application. Therefore, Subsection 2d requires that any 186 | application-supplied function or table used by this function must 187 | be optional: if the application does not supply it, the square 188 | root function must still compute square roots.) 189 | 190 | These requirements apply to the modified work as a whole. If 191 | identifiable sections of that work are not derived from the Library, 192 | and can be reasonably considered independent and separate works in 193 | themselves, then this License, and its terms, do not apply to those 194 | sections when you distribute them as separate works. But when you 195 | distribute the same sections as part of a whole which is a work based 196 | on the Library, the distribution of the whole must be on the terms of 197 | this License, whose permissions for other licensees extend to the 198 | entire whole, and thus to each and every part regardless of who wrote 199 | it. 200 | 201 | Thus, it is not the intent of this section to claim rights or contest 202 | your rights to work written entirely by you; rather, the intent is to 203 | exercise the right to control the distribution of derivative or 204 | collective works based on the Library. 205 | 206 | In addition, mere aggregation of another work not based on the Library 207 | with the Library (or with a work based on the Library) on a volume of 208 | a storage or distribution medium does not bring the other work under 209 | the scope of this License. 210 | 211 | 3. You may opt to apply the terms of the ordinary GNU General Public 212 | License instead of this License to a given copy of the Library. To do 213 | this, you must alter all the notices that refer to this License, so 214 | that they refer to the ordinary GNU General Public License, version 2, 215 | instead of to this License. (If a newer version than version 2 of the 216 | ordinary GNU General Public License has appeared, then you can specify 217 | that version instead if you wish.) Do not make any other change in 218 | these notices. 219 | 220 | Once this change is made in a given copy, it is irreversible for 221 | that copy, so the ordinary GNU General Public License applies to all 222 | subsequent copies and derivative works made from that copy. 223 | 224 | This option is useful when you wish to copy part of the code of 225 | the Library into a program that is not a library. 226 | 227 | 4. You may copy and distribute the Library (or a portion or 228 | derivative of it, under Section 2) in object code or executable form 229 | under the terms of Sections 1 and 2 above provided that you accompany 230 | it with the complete corresponding machine-readable source code, which 231 | must be distributed under the terms of Sections 1 and 2 above on a 232 | medium customarily used for software interchange. 233 | 234 | If distribution of object code is made by offering access to copy 235 | from a designated place, then offering equivalent access to copy the 236 | source code from the same place satisfies the requirement to 237 | distribute the source code, even though third parties are not 238 | compelled to copy the source along with the object code. 239 | 240 | 5. A program that contains no derivative of any portion of the 241 | Library, but is designed to work with the Library by being compiled or 242 | linked with it, is called a "work that uses the Library". Such a 243 | work, in isolation, is not a derivative work of the Library, and 244 | therefore falls outside the scope of this License. 245 | 246 | However, linking a "work that uses the Library" with the Library 247 | creates an executable that is a derivative of the Library (because it 248 | contains portions of the Library), rather than a "work that uses the 249 | library". The executable is therefore covered by this License. 250 | Section 6 states terms for distribution of such executables. 251 | 252 | When a "work that uses the Library" uses material from a header file 253 | that is part of the Library, the object code for the work may be a 254 | derivative work of the Library even though the source code is not. 255 | Whether this is true is especially significant if the work can be 256 | linked without the Library, or if the work is itself a library. The 257 | threshold for this to be true is not precisely defined by law. 258 | 259 | If such an object file uses only numerical parameters, data 260 | structure layouts and accessors, and small macros and small inline 261 | functions (ten lines or less in length), then the use of the object 262 | file is unrestricted, regardless of whether it is legally a derivative 263 | work. (Executables containing this object code plus portions of the 264 | Library will still fall under Section 6.) 265 | 266 | Otherwise, if the work is a derivative of the Library, you may 267 | distribute the object code for the work under the terms of Section 6. 268 | Any executables containing that work also fall under Section 6, 269 | whether or not they are linked directly with the Library itself. 270 | 271 | 6. As an exception to the Sections above, you may also combine or 272 | link a "work that uses the Library" with the Library to produce a 273 | work containing portions of the Library, and distribute that work 274 | under terms of your choice, provided that the terms permit 275 | modification of the work for the customer's own use and reverse 276 | engineering for debugging such modifications. 277 | 278 | You must give prominent notice with each copy of the work that the 279 | Library is used in it and that the Library and its use are covered by 280 | this License. You must supply a copy of this License. If the work 281 | during execution displays copyright notices, you must include the 282 | copyright notice for the Library among them, as well as a reference 283 | directing the user to the copy of this License. Also, you must do one 284 | of these things: 285 | 286 | a) Accompany the work with the complete corresponding 287 | machine-readable source code for the Library including whatever 288 | changes were used in the work (which must be distributed under 289 | Sections 1 and 2 above); and, if the work is an executable linked 290 | with the Library, with the complete machine-readable "work that 291 | uses the Library", as object code and/or source code, so that the 292 | user can modify the Library and then relink to produce a modified 293 | executable containing the modified Library. (It is understood 294 | that the user who changes the contents of definitions files in the 295 | Library will not necessarily be able to recompile the application 296 | to use the modified definitions.) 297 | 298 | b) Use a suitable shared library mechanism for linking with the 299 | Library. A suitable mechanism is one that (1) uses at run time a 300 | copy of the library already present on the user's computer system, 301 | rather than copying library functions into the executable, and (2) 302 | will operate properly with a modified version of the library, if 303 | the user installs one, as long as the modified version is 304 | interface-compatible with the version that the work was made with. 305 | 306 | c) Accompany the work with a written offer, valid for at 307 | least three years, to give the same user the materials 308 | specified in Subsection 6a, above, for a charge no more 309 | than the cost of performing this distribution. 310 | 311 | d) If distribution of the work is made by offering access to copy 312 | from a designated place, offer equivalent access to copy the above 313 | specified materials from the same place. 314 | 315 | e) Verify that the user has already received a copy of these 316 | materials or that you have already sent this user a copy. 317 | 318 | For an executable, the required form of the "work that uses the 319 | Library" must include any data and utility programs needed for 320 | reproducing the executable from it. However, as a special exception, 321 | the materials to be distributed need not include anything that is 322 | normally distributed (in either source or binary form) with the major 323 | components (compiler, kernel, and so on) of the operating system on 324 | which the executable runs, unless that component itself accompanies 325 | the executable. 326 | 327 | It may happen that this requirement contradicts the license 328 | restrictions of other proprietary libraries that do not normally 329 | accompany the operating system. Such a contradiction means you cannot 330 | use both them and the Library together in an executable that you 331 | distribute. 332 | 333 | 7. You may place library facilities that are a work based on the 334 | Library side-by-side in a single library together with other library 335 | facilities not covered by this License, and distribute such a combined 336 | library, provided that the separate distribution of the work based on 337 | the Library and of the other library facilities is otherwise 338 | permitted, and provided that you do these two things: 339 | 340 | a) Accompany the combined library with a copy of the same work 341 | based on the Library, uncombined with any other library 342 | facilities. This must be distributed under the terms of the 343 | Sections above. 344 | 345 | b) Give prominent notice with the combined library of the fact 346 | that part of it is a work based on the Library, and explaining 347 | where to find the accompanying uncombined form of the same work. 348 | 349 | 8. You may not copy, modify, sublicense, link with, or distribute 350 | the Library except as expressly provided under this License. Any 351 | attempt otherwise to copy, modify, sublicense, link with, or 352 | distribute the Library is void, and will automatically terminate your 353 | rights under this License. However, parties who have received copies, 354 | or rights, from you under this License will not have their licenses 355 | terminated so long as such parties remain in full compliance. 356 | 357 | 9. You are not required to accept this License, since you have not 358 | signed it. However, nothing else grants you permission to modify or 359 | distribute the Library or its derivative works. These actions are 360 | prohibited by law if you do not accept this License. Therefore, by 361 | modifying or distributing the Library (or any work based on the 362 | Library), you indicate your acceptance of this License to do so, and 363 | all its terms and conditions for copying, distributing or modifying 364 | the Library or works based on it. 365 | 366 | 10. Each time you redistribute the Library (or any work based on the 367 | Library), the recipient automatically receives a license from the 368 | original licensor to copy, distribute, link with or modify the Library 369 | subject to these terms and conditions. You may not impose any further 370 | restrictions on the recipients' exercise of the rights granted herein. 371 | You are not responsible for enforcing compliance by third parties with 372 | this License. 373 | 374 | 11. If, as a consequence of a court judgment or allegation of patent 375 | infringement or for any other reason (not limited to patent issues), 376 | conditions are imposed on you (whether by court order, agreement or 377 | otherwise) that contradict the conditions of this License, they do not 378 | excuse you from the conditions of this License. If you cannot 379 | distribute so as to satisfy simultaneously your obligations under this 380 | License and any other pertinent obligations, then as a consequence you 381 | may not distribute the Library at all. For example, if a patent 382 | license would not permit royalty-free redistribution of the Library by 383 | all those who receive copies directly or indirectly through you, then 384 | the only way you could satisfy both it and this License would be to 385 | refrain entirely from distribution of the Library. 386 | 387 | If any portion of this section is held invalid or unenforceable under any 388 | particular circumstance, the balance of the section is intended to apply, 389 | and the section as a whole is intended to apply in other circumstances. 390 | 391 | It is not the purpose of this section to induce you to infringe any 392 | patents or other property right claims or to contest validity of any 393 | such claims; this section has the sole purpose of protecting the 394 | integrity of the free software distribution system which is 395 | implemented by public license practices. Many people have made 396 | generous contributions to the wide range of software distributed 397 | through that system in reliance on consistent application of that 398 | system; it is up to the author/donor to decide if he or she is willing 399 | to distribute software through any other system and a licensee cannot 400 | impose that choice. 401 | 402 | This section is intended to make thoroughly clear what is believed to 403 | be a consequence of the rest of this License. 404 | 405 | 12. If the distribution and/or use of the Library is restricted in 406 | certain countries either by patents or by copyrighted interfaces, the 407 | original copyright holder who places the Library under this License may add 408 | an explicit geographical distribution limitation excluding those countries, 409 | so that distribution is permitted only in or among countries not thus 410 | excluded. In such case, this License incorporates the limitation as if 411 | written in the body of this License. 412 | 413 | 13. The Free Software Foundation may publish revised and/or new 414 | versions of the Lesser General Public License from time to time. 415 | Such new versions will be similar in spirit to the present version, 416 | but may differ in detail to address new problems or concerns. 417 | 418 | Each version is given a distinguishing version number. If the Library 419 | specifies a version number of this License which applies to it and 420 | "any later version", you have the option of following the terms and 421 | conditions either of that version or of any later version published by 422 | the Free Software Foundation. If the Library does not specify a 423 | license version number, you may choose any version ever published by 424 | the Free Software Foundation. 425 | 426 | 14. If you wish to incorporate parts of the Library into other free 427 | programs whose distribution conditions are incompatible with these, 428 | write to the author to ask for permission. For software which is 429 | copyrighted by the Free Software Foundation, write to the Free 430 | Software Foundation; we sometimes make exceptions for this. Our 431 | decision will be guided by the two goals of preserving the free status 432 | of all derivatives of our free software and of promoting the sharing 433 | and reuse of software generally. 434 | 435 | NO WARRANTY 436 | 437 | 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO 438 | WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. 439 | EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR 440 | OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY 441 | KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE 442 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 443 | PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE 444 | LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME 445 | THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 446 | 447 | 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN 448 | WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY 449 | AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU 450 | FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR 451 | CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE 452 | LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING 453 | RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A 454 | FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF 455 | SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH 456 | DAMAGES. 457 | 458 | END OF TERMS AND CONDITIONS 459 | 460 | How to Apply These Terms to Your New Libraries 461 | 462 | If you develop a new library, and you want it to be of the greatest 463 | possible use to the public, we recommend making it free software that 464 | everyone can redistribute and change. You can do so by permitting 465 | redistribution under these terms (or, alternatively, under the terms of the 466 | ordinary General Public License). 467 | 468 | To apply these terms, attach the following notices to the library. It is 469 | safest to attach them to the start of each source file to most effectively 470 | convey the exclusion of warranty; and each file should have at least the 471 | "copyright" line and a pointer to where the full notice is found. 472 | 473 | 474 | Copyright (C) 475 | 476 | This library is free software; you can redistribute it and/or 477 | modify it under the terms of the GNU Lesser General Public 478 | License as published by the Free Software Foundation; either 479 | version 2.1 of the License, or (at your option) any later version. 480 | 481 | This library is distributed in the hope that it will be useful, 482 | but WITHOUT ANY WARRANTY; without even the implied warranty of 483 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 484 | Lesser General Public License for more details. 485 | 486 | You should have received a copy of the GNU Lesser General Public 487 | License along with this library; if not, write to the Free Software 488 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 489 | 490 | Also add information on how to contact you by electronic and paper mail. 491 | 492 | You should also get your employer (if you work as a programmer) or your 493 | school, if any, to sign a "copyright disclaimer" for the library, if 494 | necessary. Here is a sample; alter the names: 495 | 496 | Yoyodyne, Inc., hereby disclaims all copyright interest in the 497 | library `Frob' (a library for tweaking knobs) written by James Random Hacker. 498 | 499 | , 1 April 1990 500 | Ty Coon, President of Vice 501 | 502 | That's all there is to it! 503 | 504 | 505 | -------------------------------------------------------------------------------- /ChangeLog: -------------------------------------------------------------------------------- 1 | Version 0.2.0 - 2007/07/29 2 | - Fixed configure.in 3 | - Rewokerd character formatting handling - it became less effective 4 | in terms of output size, but more conforming to XHTML standard 5 | (no cross-tags) 6 | - Added font size support 7 | - Added foreground color, backgound color and highlighting (in fact, 8 | bg color too) support 9 | - Added fontface support 10 | - Fixed interparagraph spacing to resemble the rtf default one 11 | - Borland C++ is no longer supported 12 | Version 0.1.1 - 2005/12/15 13 | - Fixed fields handling 14 | - Added handling for some special characters (dashes, ellipsis, etc.) 15 | Version 0.1.0 - 2005/09/29 16 | - Version numbering scheme changed. 17 | - The code was almost completely rewritten and split into 18 | a number of files. 19 | - Now using autoconf and automake, compiling and installation under 20 | POSIX systems is stantard. 21 | - Gave up using rope, it is really slower than string here. 22 | - A few more bugs fixed. 23 | Version 0.03 - 2003/12/11 24 | - Moved from char* to strings/ropes (ropes are 25 | used only if they are available, seems they are faster). 26 | - Instead of reading the whole file into memory and parsing the string, 27 | we now read the file byte by byte. It is slower but consumes much less 28 | memory 29 | - Lots of bugs fixed 30 | Version 0.02 - 2003/11/20 31 | - Code slightly optimized and made more C++-ish. 32 | - Moved from vectors of objects to vectors of pointers. 33 | - A few bugs fixed. 34 | Version 0.01 - 2003/11/09 35 | - First release. Quite buggy. 36 | -------------------------------------------------------------------------------- /Makefile.am: -------------------------------------------------------------------------------- 1 | AUTOMAKE_OPTIONS = foreign 2 | bin_PROGRAMS = rtf2html 3 | rtf2html_SOURCES = fmt_opts.cpp rtf2html.cpp rtf_keyword.cpp rtf_table.cpp config.h fmt_opts.h rtf_table.h common.h dbg_iter.h rtf_keyword.h rtf_tools.h 4 | noinst_HEADERS = config.h fmt_opts.h rtf_table.h common.h dbg_iter.h rtf_keyword.h rtf_tools.h README.ru 5 | 6 | ACLOCAL_AMFLAGS = -I. 7 | -------------------------------------------------------------------------------- /Makefile.in: -------------------------------------------------------------------------------- 1 | # Makefile.in generated by automake 1.7.1 from Makefile.am. 2 | # @configure_input@ 3 | 4 | # Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002 5 | # Free Software Foundation, Inc. 6 | # This Makefile.in is free software; the Free Software Foundation 7 | # gives unlimited permission to copy and/or distribute it, 8 | # with or without modifications, as long as this notice is preserved. 9 | 10 | # This program is distributed in the hope that it will be useful, 11 | # but WITHOUT ANY WARRANTY, to the extent permitted by law; without 12 | # even the implied warranty of MERCHANTABILITY or FITNESS FOR A 13 | # PARTICULAR PURPOSE. 14 | 15 | @SET_MAKE@ 16 | 17 | srcdir = @srcdir@ 18 | top_srcdir = @top_srcdir@ 19 | VPATH = @srcdir@ 20 | pkgdatadir = $(datadir)/@PACKAGE@ 21 | pkglibdir = $(libdir)/@PACKAGE@ 22 | pkgincludedir = $(includedir)/@PACKAGE@ 23 | top_builddir = . 24 | 25 | am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd 26 | INSTALL = @INSTALL@ 27 | install_sh_DATA = $(install_sh) -c -m 644 28 | install_sh_PROGRAM = $(install_sh) -c 29 | install_sh_SCRIPT = $(install_sh) -c 30 | INSTALL_HEADER = $(INSTALL_DATA) 31 | transform = $(program_transform_name) 32 | NORMAL_INSTALL = : 33 | PRE_INSTALL = : 34 | POST_INSTALL = : 35 | NORMAL_UNINSTALL = : 36 | PRE_UNINSTALL = : 37 | POST_UNINSTALL = : 38 | ACLOCAL = @ACLOCAL@ 39 | AMDEP_FALSE = @AMDEP_FALSE@ 40 | AMDEP_TRUE = @AMDEP_TRUE@ 41 | AMTAR = @AMTAR@ 42 | AUTOCONF = @AUTOCONF@ 43 | AUTOHEADER = @AUTOHEADER@ 44 | AUTOMAKE = @AUTOMAKE@ 45 | AWK = @AWK@ 46 | CC = @CC@ 47 | CCDEPMODE = @CCDEPMODE@ 48 | CFLAGS = @CFLAGS@ 49 | CPP = @CPP@ 50 | CPPFLAGS = @CPPFLAGS@ 51 | CXX = @CXX@ 52 | CXXCPP = @CXXCPP@ 53 | CXXDEPMODE = @CXXDEPMODE@ 54 | CXXFLAGS = @CXXFLAGS@ 55 | CYGPATH_W = @CYGPATH_W@ 56 | DEFS = @DEFS@ 57 | DEPDIR = @DEPDIR@ 58 | ECHO_C = @ECHO_C@ 59 | ECHO_N = @ECHO_N@ 60 | ECHO_T = @ECHO_T@ 61 | EGREP = @EGREP@ 62 | EXEEXT = @EXEEXT@ 63 | INSTALL_DATA = @INSTALL_DATA@ 64 | INSTALL_PROGRAM = @INSTALL_PROGRAM@ 65 | INSTALL_SCRIPT = @INSTALL_SCRIPT@ 66 | INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ 67 | LDFLAGS = @LDFLAGS@ 68 | LIBOBJS = @LIBOBJS@ 69 | LIBS = @LIBS@ 70 | LTLIBOBJS = @LTLIBOBJS@ 71 | MAKEINFO = @MAKEINFO@ 72 | OBJEXT = @OBJEXT@ 73 | PACKAGE = @PACKAGE@ 74 | PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ 75 | PACKAGE_NAME = @PACKAGE_NAME@ 76 | PACKAGE_STRING = @PACKAGE_STRING@ 77 | PACKAGE_TARNAME = @PACKAGE_TARNAME@ 78 | PACKAGE_VERSION = @PACKAGE_VERSION@ 79 | PATH_SEPARATOR = @PATH_SEPARATOR@ 80 | SET_MAKE = @SET_MAKE@ 81 | SHELL = @SHELL@ 82 | STRIP = @STRIP@ 83 | VERSION = @VERSION@ 84 | ac_ct_CC = @ac_ct_CC@ 85 | ac_ct_CXX = @ac_ct_CXX@ 86 | ac_ct_STRIP = @ac_ct_STRIP@ 87 | am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ 88 | am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ 89 | am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ 90 | am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@ 91 | am__include = @am__include@ 92 | am__quote = @am__quote@ 93 | bindir = @bindir@ 94 | build_alias = @build_alias@ 95 | datadir = @datadir@ 96 | exec_prefix = @exec_prefix@ 97 | host_alias = @host_alias@ 98 | includedir = @includedir@ 99 | infodir = @infodir@ 100 | install_sh = @install_sh@ 101 | libdir = @libdir@ 102 | libexecdir = @libexecdir@ 103 | localstatedir = @localstatedir@ 104 | mandir = @mandir@ 105 | oldincludedir = @oldincludedir@ 106 | prefix = @prefix@ 107 | program_transform_name = @program_transform_name@ 108 | sbindir = @sbindir@ 109 | sharedstatedir = @sharedstatedir@ 110 | sysconfdir = @sysconfdir@ 111 | target_alias = @target_alias@ 112 | AUTOMAKE_OPTIONS = foreign 113 | bin_PROGRAMS = rtf2html 114 | rtf2html_SOURCES = fmt_opts.cpp rtf2html.cpp rtf_keyword.cpp rtf_table.cpp config.h fmt_opts.h rtf_table.h common.h dbg_iter.h rtf_keyword.h rtf_tools.h 115 | noinst_HEADERS = config.h fmt_opts.h rtf_table.h common.h dbg_iter.h rtf_keyword.h rtf_tools.h README.ru 116 | subdir = . 117 | ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 118 | mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs 119 | CONFIG_HEADER = config.h 120 | CONFIG_CLEAN_FILES = 121 | bin_PROGRAMS = rtf2html$(EXEEXT) 122 | PROGRAMS = $(bin_PROGRAMS) 123 | 124 | am_rtf2html_OBJECTS = fmt_opts.$(OBJEXT) rtf2html.$(OBJEXT) \ 125 | rtf_keyword.$(OBJEXT) rtf_table.$(OBJEXT) 126 | rtf2html_OBJECTS = $(am_rtf2html_OBJECTS) 127 | rtf2html_LDADD = $(LDADD) 128 | rtf2html_DEPENDENCIES = 129 | rtf2html_LDFLAGS = 130 | 131 | DEFAULT_INCLUDES = -I. -I$(srcdir) -I. 132 | depcomp = $(SHELL) $(top_srcdir)/depcomp 133 | am__depfiles_maybe = depfiles 134 | @AMDEP_TRUE@DEP_FILES = ./$(DEPDIR)/fmt_opts.Po ./$(DEPDIR)/rtf2html.Po \ 135 | @AMDEP_TRUE@ ./$(DEPDIR)/rtf_keyword.Po ./$(DEPDIR)/rtf_table.Po 136 | CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ 137 | $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) 138 | CXXLD = $(CXX) 139 | CXXLINK = $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) \ 140 | -o $@ 141 | COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ 142 | $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) 143 | CCLD = $(CC) 144 | LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ 145 | DIST_SOURCES = $(rtf2html_SOURCES) 146 | HEADERS = $(noinst_HEADERS) 147 | 148 | DIST_COMMON = README $(noinst_HEADERS) COPYING.LESSER ChangeLog \ 149 | Makefile.am Makefile.in aclocal.m4 config.h.in configure \ 150 | configure.in depcomp install-sh missing mkinstalldirs 151 | SOURCES = $(rtf2html_SOURCES) 152 | 153 | all: config.h 154 | $(MAKE) $(AM_MAKEFLAGS) all-am 155 | 156 | .SUFFIXES: 157 | .SUFFIXES: .cpp .o .obj 158 | 159 | am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ 160 | configure.lineno 161 | $(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) 162 | cd $(top_srcdir) && \ 163 | $(AUTOMAKE) --foreign Makefile 164 | Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status 165 | cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe) 166 | 167 | $(top_builddir)/config.status: $(srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) 168 | $(SHELL) ./config.status --recheck 169 | $(srcdir)/configure: $(srcdir)/configure.in $(ACLOCAL_M4) $(CONFIGURE_DEPENDENCIES) 170 | cd $(srcdir) && $(AUTOCONF) 171 | 172 | $(ACLOCAL_M4): configure.in 173 | cd $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) 174 | 175 | config.h: stamp-h1 176 | @if test ! -f $@; then \ 177 | rm -f stamp-h1; \ 178 | $(MAKE) stamp-h1; \ 179 | else :; fi 180 | 181 | stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status 182 | @rm -f stamp-h1 183 | cd $(top_builddir) && $(SHELL) ./config.status config.h 184 | 185 | $(srcdir)/config.h.in: $(top_srcdir)/configure.in $(ACLOCAL_M4) 186 | cd $(top_srcdir) && $(AUTOHEADER) 187 | touch $(srcdir)/config.h.in 188 | 189 | distclean-hdr: 190 | -rm -f config.h stamp-h1 191 | binPROGRAMS_INSTALL = $(INSTALL_PROGRAM) 192 | install-binPROGRAMS: $(bin_PROGRAMS) 193 | @$(NORMAL_INSTALL) 194 | $(mkinstalldirs) $(DESTDIR)$(bindir) 195 | @list='$(bin_PROGRAMS)'; for p in $$list; do \ 196 | p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ 197 | if test -f $$p \ 198 | ; then \ 199 | f=`echo "$$p1" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`; \ 200 | echo " $(INSTALL_PROGRAM_ENV) $(binPROGRAMS_INSTALL) $$p $(DESTDIR)$(bindir)/$$f"; \ 201 | $(INSTALL_PROGRAM_ENV) $(binPROGRAMS_INSTALL) $$p $(DESTDIR)$(bindir)/$$f || exit 1; \ 202 | else :; fi; \ 203 | done 204 | 205 | uninstall-binPROGRAMS: 206 | @$(NORMAL_UNINSTALL) 207 | @list='$(bin_PROGRAMS)'; for p in $$list; do \ 208 | f=`echo "$$p" | sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \ 209 | echo " rm -f $(DESTDIR)$(bindir)/$$f"; \ 210 | rm -f $(DESTDIR)$(bindir)/$$f; \ 211 | done 212 | 213 | clean-binPROGRAMS: 214 | -test -z "$(bin_PROGRAMS)" || rm -f $(bin_PROGRAMS) 215 | rtf2html$(EXEEXT): $(rtf2html_OBJECTS) $(rtf2html_DEPENDENCIES) 216 | @rm -f rtf2html$(EXEEXT) 217 | $(CXXLINK) $(rtf2html_LDFLAGS) $(rtf2html_OBJECTS) $(rtf2html_LDADD) $(LIBS) 218 | 219 | mostlyclean-compile: 220 | -rm -f *.$(OBJEXT) core *.core 221 | 222 | distclean-compile: 223 | -rm -f *.tab.c 224 | 225 | @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fmt_opts.Po@am__quote@ 226 | @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rtf2html.Po@am__quote@ 227 | @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rtf_keyword.Po@am__quote@ 228 | @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rtf_table.Po@am__quote@ 229 | 230 | distclean-depend: 231 | -rm -rf ./$(DEPDIR) 232 | 233 | .cpp.o: 234 | @am__fastdepCXX_TRUE@ if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" \ 235 | @am__fastdepCXX_TRUE@ -c -o $@ `test -f '$<' || echo '$(srcdir)/'`$<; \ 236 | @am__fastdepCXX_TRUE@ then mv "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; \ 237 | @am__fastdepCXX_TRUE@ else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; \ 238 | @am__fastdepCXX_TRUE@ fi 239 | @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ 240 | @AMDEP_TRUE@@am__fastdepCXX_FALSE@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@ 241 | @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ 242 | @am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ `test -f '$<' || echo '$(srcdir)/'`$< 243 | 244 | .cpp.obj: 245 | @am__fastdepCXX_TRUE@ if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" \ 246 | @am__fastdepCXX_TRUE@ -c -o $@ `if test -f '$<'; then $(CYGPATH_W) '$<'; else $(CYGPATH_W) '$(srcdir)/$<'`; \ 247 | @am__fastdepCXX_TRUE@ then mv "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; \ 248 | @am__fastdepCXX_TRUE@ else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; \ 249 | @am__fastdepCXX_TRUE@ fi 250 | @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ 251 | @AMDEP_TRUE@@am__fastdepCXX_FALSE@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@ 252 | @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ 253 | @am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ `if test -f '$<'; then $(CYGPATH_W) '$<'; else $(CYGPATH_W) '$(srcdir)/$<'` 254 | uninstall-info-am: 255 | 256 | ETAGS = etags 257 | ETAGSFLAGS = 258 | 259 | CTAGS = ctags 260 | CTAGSFLAGS = 261 | 262 | tags: TAGS 263 | 264 | ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) 265 | list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ 266 | unique=`for i in $$list; do \ 267 | if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ 268 | done | \ 269 | $(AWK) ' { files[$$0] = 1; } \ 270 | END { for (i in files) print i; }'`; \ 271 | mkid -fID $$unique 272 | 273 | TAGS: $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \ 274 | $(TAGS_FILES) $(LISP) 275 | tags=; \ 276 | here=`pwd`; \ 277 | list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \ 278 | unique=`for i in $$list; do \ 279 | if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ 280 | done | \ 281 | $(AWK) ' { files[$$0] = 1; } \ 282 | END { for (i in files) print i; }'`; \ 283 | test -z "$(ETAGS_ARGS)$$tags$$unique" \ 284 | || $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ 285 | $$tags $$unique 286 | 287 | ctags: CTAGS 288 | CTAGS: $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \ 289 | $(TAGS_FILES) $(LISP) 290 | tags=; \ 291 | here=`pwd`; \ 292 | list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \ 293 | unique=`for i in $$list; do \ 294 | if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ 295 | done | \ 296 | $(AWK) ' { files[$$0] = 1; } \ 297 | END { for (i in files) print i; }'`; \ 298 | test -z "$(CTAGS_ARGS)$$tags$$unique" \ 299 | || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ 300 | $$tags $$unique 301 | 302 | GTAGS: 303 | here=`$(am__cd) $(top_builddir) && pwd` \ 304 | && cd $(top_srcdir) \ 305 | && gtags -i $(GTAGS_ARGS) $$here 306 | 307 | distclean-tags: 308 | -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags 309 | DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) 310 | 311 | top_distdir = . 312 | distdir = $(PACKAGE)-$(VERSION) 313 | 314 | am__remove_distdir = \ 315 | { test ! -d $(distdir) \ 316 | || { find $(distdir) -type d ! -perm -200 -exec chmod u+w {} ';' \ 317 | && rm -fr $(distdir); }; } 318 | 319 | GZIP_ENV = --best 320 | distuninstallcheck_listfiles = find . -type f -print 321 | distcleancheck_listfiles = find . -type f -print 322 | 323 | distdir: $(DISTFILES) 324 | $(am__remove_distdir) 325 | mkdir $(distdir) 326 | @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ 327 | topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ 328 | list='$(DISTFILES)'; for file in $$list; do \ 329 | case $$file in \ 330 | $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ 331 | $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ 332 | esac; \ 333 | if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ 334 | dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ 335 | if test "$$dir" != "$$file" && test "$$dir" != "."; then \ 336 | dir="/$$dir"; \ 337 | $(mkinstalldirs) "$(distdir)$$dir"; \ 338 | else \ 339 | dir=''; \ 340 | fi; \ 341 | if test -d $$d/$$file; then \ 342 | if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ 343 | cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ 344 | fi; \ 345 | cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ 346 | else \ 347 | test -f $(distdir)/$$file \ 348 | || cp -p $$d/$$file $(distdir)/$$file \ 349 | || exit 1; \ 350 | fi; \ 351 | done 352 | -find $(distdir) -type d ! -perm -777 -exec chmod a+rwx {} \; -o \ 353 | ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \ 354 | ! -type d ! -perm -400 -exec chmod a+r {} \; -o \ 355 | ! -type d ! -perm -444 -exec $(SHELL) $(install_sh) -c -m a+r {} {} \; \ 356 | || chmod -R a+r $(distdir) 357 | dist-gzip: distdir 358 | $(AMTAR) chof - $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz 359 | $(am__remove_distdir) 360 | 361 | dist-bzip2: distdir 362 | $(AMTAR) chof - $(distdir) | bzip2 -9 -c >$(distdir).tar.bz2 363 | $(am__remove_distdir) 364 | 365 | dist dist-all: distdir 366 | $(AMTAR) chof - $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz 367 | $(AMTAR) chof - $(distdir) | bzip2 -9 -c >$(distdir).tar.bz2 368 | $(am__remove_distdir) 369 | 370 | # This target untars the dist file and tries a VPATH configuration. Then 371 | # it guarantees that the distribution is self-contained by making another 372 | # tarfile. 373 | distcheck: dist 374 | $(am__remove_distdir) 375 | GZIP=$(GZIP_ENV) gunzip -c $(distdir).tar.gz | $(AMTAR) xf - 376 | chmod -R a-w $(distdir); chmod a+w $(distdir) 377 | mkdir $(distdir)/=build 378 | mkdir $(distdir)/=inst 379 | chmod a-w $(distdir) 380 | dc_install_base=`$(am__cd) $(distdir)/=inst && pwd` \ 381 | && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \ 382 | && cd $(distdir)/=build \ 383 | && ../configure --srcdir=.. --prefix="$$dc_install_base" \ 384 | $(DISTCHECK_CONFIGURE_FLAGS) \ 385 | && $(MAKE) $(AM_MAKEFLAGS) \ 386 | && $(MAKE) $(AM_MAKEFLAGS) dvi \ 387 | && $(MAKE) $(AM_MAKEFLAGS) check \ 388 | && $(MAKE) $(AM_MAKEFLAGS) install \ 389 | && $(MAKE) $(AM_MAKEFLAGS) installcheck \ 390 | && $(MAKE) $(AM_MAKEFLAGS) uninstall \ 391 | && $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \ 392 | distuninstallcheck \ 393 | && chmod -R a-w "$$dc_install_base" \ 394 | && ({ \ 395 | (cd ../.. && $(mkinstalldirs) "$$dc_destdir") \ 396 | && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \ 397 | && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \ 398 | && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \ 399 | distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \ 400 | } || { rm -rf "$$dc_destdir"; exit 1; }) \ 401 | && rm -rf "$$dc_destdir" \ 402 | && $(MAKE) $(AM_MAKEFLAGS) dist-gzip \ 403 | && rm -f $(distdir).tar.gz \ 404 | && $(MAKE) $(AM_MAKEFLAGS) distcleancheck 405 | $(am__remove_distdir) 406 | @echo "$(distdir).tar.gz is ready for distribution" | \ 407 | sed 'h;s/./=/g;p;x;p;x' 408 | distuninstallcheck: 409 | cd $(distuninstallcheck_dir) \ 410 | && test `$(distuninstallcheck_listfiles) | wc -l` -le 1 \ 411 | || { echo "ERROR: files left after uninstall:" ; \ 412 | if test -n "$(DESTDIR)"; then \ 413 | echo " (check DESTDIR support)"; \ 414 | fi ; \ 415 | $(distuninstallcheck_listfiles) ; \ 416 | exit 1; } >&2 417 | distcleancheck: distclean 418 | if test '$(srcdir)' = . ; then \ 419 | echo "ERROR: distcleancheck can only run from a VPATH build" ; \ 420 | exit 1 ; \ 421 | fi 422 | test `$(distcleancheck_listfiles) | wc -l` -eq 0 \ 423 | || { echo "ERROR: files left in build directory after distclean:" ; \ 424 | $(distcleancheck_listfiles) ; \ 425 | exit 1; } >&2 426 | check-am: all-am 427 | check: check-am 428 | all-am: Makefile $(PROGRAMS) $(HEADERS) config.h 429 | 430 | installdirs: 431 | $(mkinstalldirs) $(DESTDIR)$(bindir) 432 | 433 | install: install-am 434 | install-exec: install-exec-am 435 | install-data: install-data-am 436 | uninstall: uninstall-am 437 | 438 | install-am: all-am 439 | @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am 440 | 441 | installcheck: installcheck-am 442 | install-strip: 443 | $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ 444 | INSTALL_STRIP_FLAG=-s \ 445 | `test -z '$(STRIP)' || \ 446 | echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install 447 | mostlyclean-generic: 448 | 449 | clean-generic: 450 | 451 | distclean-generic: 452 | -rm -f Makefile $(CONFIG_CLEAN_FILES) 453 | 454 | maintainer-clean-generic: 455 | @echo "This command is intended for maintainers to use" 456 | @echo "it deletes files that may require special tools to rebuild." 457 | clean: clean-am 458 | 459 | clean-am: clean-binPROGRAMS clean-generic mostlyclean-am 460 | 461 | distclean: distclean-am 462 | -rm -f $(am__CONFIG_DISTCLEAN_FILES) 463 | distclean-am: clean-am distclean-compile distclean-depend \ 464 | distclean-generic distclean-hdr distclean-tags 465 | 466 | dvi: dvi-am 467 | 468 | dvi-am: 469 | 470 | info: info-am 471 | 472 | info-am: 473 | 474 | install-data-am: 475 | 476 | install-exec-am: install-binPROGRAMS 477 | 478 | install-info: install-info-am 479 | 480 | install-man: 481 | 482 | installcheck-am: 483 | 484 | maintainer-clean: maintainer-clean-am 485 | -rm -f $(am__CONFIG_DISTCLEAN_FILES) 486 | -rm -rf autom4te.cache 487 | maintainer-clean-am: distclean-am maintainer-clean-generic 488 | 489 | mostlyclean: mostlyclean-am 490 | 491 | mostlyclean-am: mostlyclean-compile mostlyclean-generic 492 | 493 | pdf: pdf-am 494 | 495 | pdf-am: 496 | 497 | ps: ps-am 498 | 499 | ps-am: 500 | 501 | uninstall-am: uninstall-binPROGRAMS uninstall-info-am 502 | 503 | .PHONY: CTAGS GTAGS all all-am check check-am clean clean-binPROGRAMS \ 504 | clean-generic ctags dist dist-all dist-bzip2 dist-gzip \ 505 | distcheck distclean distclean-compile distclean-depend \ 506 | distclean-generic distclean-hdr distclean-tags distcleancheck \ 507 | distdir distuninstallcheck dvi dvi-am info info-am install \ 508 | install-am install-binPROGRAMS install-data install-data-am \ 509 | install-exec install-exec-am install-info install-info-am \ 510 | install-man install-strip installcheck installcheck-am \ 511 | installdirs maintainer-clean maintainer-clean-generic \ 512 | mostlyclean mostlyclean-compile mostlyclean-generic pdf pdf-am \ 513 | ps ps-am tags uninstall uninstall-am uninstall-binPROGRAMS \ 514 | uninstall-info-am 515 | 516 | # Tell versions [3.59,3.63) of GNU make to not export all variables. 517 | # Otherwise a system limit (for SysV at least) may be exceeded. 518 | .NOEXPORT: 519 | -------------------------------------------------------------------------------- /README: -------------------------------------------------------------------------------- 1 | 1. Overview 2 | 3 | This is RTF to HTML converter version 0.1.0. 4 | Copyright (C) 2003 Valentin Lavrinenko, vlavrinenko@users.sourceforge.net 5 | 6 | Its primary purpose is using by developers to add rtf to html 7 | converting functionality to their projects, although, end users 8 | can also find it useful. 9 | 10 | The main effort was made on processing the tables correctly, and it 11 | seems successful - all other programs I've seen do tables processing 12 | much worse. Moreover, at the moment, I haven't seen any file that 13 | displays correctly in MS Word, but crashes this program. 14 | 15 | For further information, go to 16 | http://www.sourceforge.net/projects/rtf2html 17 | 18 | 19 | 2. Copying 20 | 21 | Distributed under LGPL license - see COPYING.LESSER, it must be 22 | in the archive. 23 | 24 | 25 | 3. Compiling 26 | 27 | - Under UNIX: 28 | Just ./configure && make && make install. The program seems 29 | to work much (about 2 times) faster when compiled with STLPort 30 | STL implementation than with the GNU one. So, you may use 31 | --with-stlport configure option if you have it installed. 32 | 33 | - Under MS Windows: 34 | Use MSYS/MinGW, use it the same way as in UNIX. 35 | No makefiles for other Win compilers are included yet, so, 36 | write it yourself, if you want - it isn't that hard. 37 | BCC is no longer supported! 38 | 39 | 4. Installation 40 | 41 | No binary distribution for Unix/Linux is provided - just 42 | compile the program from source (see above). You can, however, 43 | download a binary package for MS Windows from the project page, 44 | http://www.sf.net/projects/rtf2html. 45 | 46 | 5. Usage 47 | 48 | 5.1 Command-line options 49 | 50 | rtf2html -v|--version 51 | 52 | prints the current version. 53 | 54 | rtf2html -h|--help 55 | 56 | prints the help. 57 | 58 | rtf2html [ []]. 59 | 60 | Converts the file. If either of files is not specified, 61 | the corresponding std descriptor (stdin or stdout) is used. 62 | 63 | 5.2 Supported features 64 | 65 | This version supports the following: 66 | - Character formatting: bold, italic, underline, sub- and superscripts. 67 | NOTE: underlining is displayed only as solid. 68 | - Paragraph formatting: horizontal alignment, indentation, margins. 69 | - Table formatting: arbitrary cell spans, cell sizings, borders, 70 | vertical alignment in cells. 71 | NOTE: borders are displayed correctly only under IE 5+ and only 72 | as solid. 73 | - Page formatting: page width, left margin. 74 | - Hexadecimal character codes (Cyrillic letters would come out in 75 | win1251) 76 | - Font faces and sizes. 77 | - Foreground and background colors, highlighting. 78 | 79 | 5.3 Unsupported features 80 | 81 | This version DOES NOT support the following: 82 | - Character sets. 83 | - Hyperlinks. 84 | - Images. 85 | - Different stuff like macros, embedded OLE objects, etc. 86 | 87 | 88 | 6. Compiling notes. 89 | 90 | The source was compiled with 91 | - gcc 3.3 under ALT Linux Master 2.4 on i386 92 | - gcc 3.4.2 (MinGW) under Win2k 93 | 94 | -------------------------------------------------------------------------------- /README.ru: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lvu/rtf2html/d343dddd63e2921e976f9210e58239fa2ca13848/README.ru -------------------------------------------------------------------------------- /aclocal.m4: -------------------------------------------------------------------------------- 1 | # generated automatically by aclocal 1.7.1 -*- Autoconf -*- 2 | 3 | # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002 4 | # Free Software Foundation, Inc. 5 | # This file is free software; the Free Software Foundation 6 | # gives unlimited permission to copy and/or distribute it, 7 | # with or without modifications, as long as this notice is preserved. 8 | 9 | # This program is distributed in the hope that it will be useful, 10 | # but WITHOUT ANY WARRANTY, to the extent permitted by law; without 11 | # even the implied warranty of MERCHANTABILITY or FITNESS FOR A 12 | # PARTICULAR PURPOSE. 13 | 14 | # Do all the work for Automake. -*- Autoconf -*- 15 | 16 | # This macro actually does too much some checks are only needed if 17 | # your package does certain things. But this isn't really a big deal. 18 | 19 | # Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002 20 | # Free Software Foundation, Inc. 21 | 22 | # This program is free software; you can redistribute it and/or modify 23 | # it under the terms of the GNU General Public License as published by 24 | # the Free Software Foundation; either version 2, or (at your option) 25 | # any later version. 26 | 27 | # This program is distributed in the hope that it will be useful, 28 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 29 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 30 | # GNU General Public License for more details. 31 | 32 | # You should have received a copy of the GNU General Public License 33 | # along with this program; if not, write to the Free Software 34 | # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 35 | # 02111-1307, USA. 36 | 37 | # serial 8 38 | 39 | # There are a few dirty hacks below to avoid letting `AC_PROG_CC' be 40 | # written in clear, in which case automake, when reading aclocal.m4, 41 | # will think it sees a *use*, and therefore will trigger all it's 42 | # C support machinery. Also note that it means that autoscan, seeing 43 | # CC etc. in the Makefile, will ask for an AC_PROG_CC use... 44 | 45 | 46 | AC_PREREQ([2.54]) 47 | 48 | # Autoconf 2.50 wants to disallow AM_ names. We explicitly allow 49 | # the ones we care about. 50 | m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl 51 | 52 | # AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE]) 53 | # AM_INIT_AUTOMAKE([OPTIONS]) 54 | # ----------------------------------------------- 55 | # The call with PACKAGE and VERSION arguments is the old style 56 | # call (pre autoconf-2.50), which is being phased out. PACKAGE 57 | # and VERSION should now be passed to AC_INIT and removed from 58 | # the call to AM_INIT_AUTOMAKE. 59 | # We support both call styles for the transition. After 60 | # the next Automake release, Autoconf can make the AC_INIT 61 | # arguments mandatory, and then we can depend on a new Autoconf 62 | # release and drop the old call support. 63 | AC_DEFUN([AM_INIT_AUTOMAKE], 64 | [AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl 65 | AC_REQUIRE([AC_PROG_INSTALL])dnl 66 | # test to see if srcdir already configured 67 | if test "`cd $srcdir && pwd`" != "`pwd`" && 68 | test -f $srcdir/config.status; then 69 | AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) 70 | fi 71 | 72 | # test whether we have cygpath 73 | if test -z "$CYGPATH_W"; then 74 | if (cygpath --version) >/dev/null 2>/dev/null; then 75 | CYGPATH_W='cygpath -w' 76 | else 77 | CYGPATH_W=echo 78 | fi 79 | fi 80 | AC_SUBST([CYGPATH_W]) 81 | 82 | # Define the identity of the package. 83 | dnl Distinguish between old-style and new-style calls. 84 | m4_ifval([$2], 85 | [m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl 86 | AC_SUBST([PACKAGE], [$1])dnl 87 | AC_SUBST([VERSION], [$2])], 88 | [_AM_SET_OPTIONS([$1])dnl 89 | AC_SUBST([PACKAGE], [AC_PACKAGE_TARNAME])dnl 90 | AC_SUBST([VERSION], [AC_PACKAGE_VERSION])])dnl 91 | 92 | _AM_IF_OPTION([no-define],, 93 | [AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package]) 94 | AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl 95 | 96 | # Some tools Automake needs. 97 | AC_REQUIRE([AM_SANITY_CHECK])dnl 98 | AC_REQUIRE([AC_ARG_PROGRAM])dnl 99 | AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version}) 100 | AM_MISSING_PROG(AUTOCONF, autoconf) 101 | AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version}) 102 | AM_MISSING_PROG(AUTOHEADER, autoheader) 103 | AM_MISSING_PROG(MAKEINFO, makeinfo) 104 | AM_MISSING_PROG(AMTAR, tar) 105 | AM_PROG_INSTALL_SH 106 | AM_PROG_INSTALL_STRIP 107 | # We need awk for the "check" target. The system "awk" is bad on 108 | # some platforms. 109 | AC_REQUIRE([AC_PROG_AWK])dnl 110 | AC_REQUIRE([AC_PROG_MAKE_SET])dnl 111 | 112 | _AM_IF_OPTION([no-dependencies],, 113 | [AC_PROVIDE_IFELSE([AC_PROG_CC], 114 | [_AM_DEPENDENCIES(CC)], 115 | [define([AC_PROG_CC], 116 | defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl 117 | AC_PROVIDE_IFELSE([AC_PROG_CXX], 118 | [_AM_DEPENDENCIES(CXX)], 119 | [define([AC_PROG_CXX], 120 | defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl 121 | ]) 122 | ]) 123 | 124 | 125 | # When config.status generates a header, we must update the stamp-h file. 126 | # This file resides in the same directory as the config header 127 | # that is generated. The stamp files are numbered to have different names. 128 | 129 | # Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the 130 | # loop where config.status creates the headers, so we can generate 131 | # our stamp files there. 132 | AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK], 133 | [_am_stamp_count=`expr ${_am_stamp_count-0} + 1` 134 | echo "timestamp for $1" >`AS_DIRNAME([$1])`/stamp-h[]$_am_stamp_count]) 135 | 136 | # Copyright 2002 Free Software Foundation, Inc. 137 | 138 | # This program is free software; you can redistribute it and/or modify 139 | # it under the terms of the GNU General Public License as published by 140 | # the Free Software Foundation; either version 2, or (at your option) 141 | # any later version. 142 | 143 | # This program is distributed in the hope that it will be useful, 144 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 145 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 146 | # GNU General Public License for more details. 147 | 148 | # You should have received a copy of the GNU General Public License 149 | # along with this program; if not, write to the Free Software 150 | # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 151 | 152 | # AM_AUTOMAKE_VERSION(VERSION) 153 | # ---------------------------- 154 | # Automake X.Y traces this macro to ensure aclocal.m4 has been 155 | # generated from the m4 files accompanying Automake X.Y. 156 | AC_DEFUN([AM_AUTOMAKE_VERSION],[am__api_version="1.7"]) 157 | 158 | # AM_SET_CURRENT_AUTOMAKE_VERSION 159 | # ------------------------------- 160 | # Call AM_AUTOMAKE_VERSION so it can be traced. 161 | # This function is AC_REQUIREd by AC_INIT_AUTOMAKE. 162 | AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], 163 | [AM_AUTOMAKE_VERSION([1.7.1])]) 164 | 165 | # Helper functions for option handling. -*- Autoconf -*- 166 | 167 | # Copyright 2001, 2002 Free Software Foundation, Inc. 168 | 169 | # This program is free software; you can redistribute it and/or modify 170 | # it under the terms of the GNU General Public License as published by 171 | # the Free Software Foundation; either version 2, or (at your option) 172 | # any later version. 173 | 174 | # This program is distributed in the hope that it will be useful, 175 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 176 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 177 | # GNU General Public License for more details. 178 | 179 | # You should have received a copy of the GNU General Public License 180 | # along with this program; if not, write to the Free Software 181 | # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 182 | # 02111-1307, USA. 183 | 184 | # serial 2 185 | 186 | # _AM_MANGLE_OPTION(NAME) 187 | # ----------------------- 188 | AC_DEFUN([_AM_MANGLE_OPTION], 189 | [[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])]) 190 | 191 | # _AM_SET_OPTION(NAME) 192 | # ------------------------------ 193 | # Set option NAME. Presently that only means defining a flag for this option. 194 | AC_DEFUN([_AM_SET_OPTION], 195 | [m4_define(_AM_MANGLE_OPTION([$1]), 1)]) 196 | 197 | # _AM_SET_OPTIONS(OPTIONS) 198 | # ---------------------------------- 199 | # OPTIONS is a space-separated list of Automake options. 200 | AC_DEFUN([_AM_SET_OPTIONS], 201 | [AC_FOREACH([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])]) 202 | 203 | # _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET]) 204 | # ------------------------------------------- 205 | # Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. 206 | AC_DEFUN([_AM_IF_OPTION], 207 | [m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])]) 208 | 209 | # 210 | # Check to make sure that the build environment is sane. 211 | # 212 | 213 | # Copyright 1996, 1997, 2000, 2001 Free Software Foundation, Inc. 214 | 215 | # This program is free software; you can redistribute it and/or modify 216 | # it under the terms of the GNU General Public License as published by 217 | # the Free Software Foundation; either version 2, or (at your option) 218 | # any later version. 219 | 220 | # This program is distributed in the hope that it will be useful, 221 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 222 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 223 | # GNU General Public License for more details. 224 | 225 | # You should have received a copy of the GNU General Public License 226 | # along with this program; if not, write to the Free Software 227 | # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 228 | # 02111-1307, USA. 229 | 230 | # serial 3 231 | 232 | # AM_SANITY_CHECK 233 | # --------------- 234 | AC_DEFUN([AM_SANITY_CHECK], 235 | [AC_MSG_CHECKING([whether build environment is sane]) 236 | # Just in case 237 | sleep 1 238 | echo timestamp > conftest.file 239 | # Do `set' in a subshell so we don't clobber the current shell's 240 | # arguments. Must try -L first in case configure is actually a 241 | # symlink; some systems play weird games with the mod time of symlinks 242 | # (eg FreeBSD returns the mod time of the symlink's containing 243 | # directory). 244 | if ( 245 | set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null` 246 | if test "$[*]" = "X"; then 247 | # -L didn't work. 248 | set X `ls -t $srcdir/configure conftest.file` 249 | fi 250 | rm -f conftest.file 251 | if test "$[*]" != "X $srcdir/configure conftest.file" \ 252 | && test "$[*]" != "X conftest.file $srcdir/configure"; then 253 | 254 | # If neither matched, then we have a broken ls. This can happen 255 | # if, for instance, CONFIG_SHELL is bash and it inherits a 256 | # broken ls alias from the environment. This has actually 257 | # happened. Such a system could not be considered "sane". 258 | AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken 259 | alias in your environment]) 260 | fi 261 | 262 | test "$[2]" = conftest.file 263 | ) 264 | then 265 | # Ok. 266 | : 267 | else 268 | AC_MSG_ERROR([newly created file is older than distributed files! 269 | Check your system clock]) 270 | fi 271 | AC_MSG_RESULT(yes)]) 272 | 273 | # -*- Autoconf -*- 274 | 275 | 276 | # Copyright 1997, 1999, 2000, 2001 Free Software Foundation, Inc. 277 | 278 | # This program is free software; you can redistribute it and/or modify 279 | # it under the terms of the GNU General Public License as published by 280 | # the Free Software Foundation; either version 2, or (at your option) 281 | # any later version. 282 | 283 | # This program is distributed in the hope that it will be useful, 284 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 285 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 286 | # GNU General Public License for more details. 287 | 288 | # You should have received a copy of the GNU General Public License 289 | # along with this program; if not, write to the Free Software 290 | # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 291 | # 02111-1307, USA. 292 | 293 | # serial 3 294 | 295 | # AM_MISSING_PROG(NAME, PROGRAM) 296 | # ------------------------------ 297 | AC_DEFUN([AM_MISSING_PROG], 298 | [AC_REQUIRE([AM_MISSING_HAS_RUN]) 299 | $1=${$1-"${am_missing_run}$2"} 300 | AC_SUBST($1)]) 301 | 302 | 303 | # AM_MISSING_HAS_RUN 304 | # ------------------ 305 | # Define MISSING if not defined so far and test if it supports --run. 306 | # If it does, set am_missing_run to use it, otherwise, to nothing. 307 | AC_DEFUN([AM_MISSING_HAS_RUN], 308 | [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl 309 | test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing" 310 | # Use eval to expand $SHELL 311 | if eval "$MISSING --run true"; then 312 | am_missing_run="$MISSING --run " 313 | else 314 | am_missing_run= 315 | AC_MSG_WARN([`missing' script is too old or missing]) 316 | fi 317 | ]) 318 | 319 | # AM_AUX_DIR_EXPAND 320 | 321 | # Copyright 2001 Free Software Foundation, Inc. 322 | 323 | # This program is free software; you can redistribute it and/or modify 324 | # it under the terms of the GNU General Public License as published by 325 | # the Free Software Foundation; either version 2, or (at your option) 326 | # any later version. 327 | 328 | # This program is distributed in the hope that it will be useful, 329 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 330 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 331 | # GNU General Public License for more details. 332 | 333 | # You should have received a copy of the GNU General Public License 334 | # along with this program; if not, write to the Free Software 335 | # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 336 | # 02111-1307, USA. 337 | 338 | # For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets 339 | # $ac_aux_dir to `$srcdir/foo'. In other projects, it is set to 340 | # `$srcdir', `$srcdir/..', or `$srcdir/../..'. 341 | # 342 | # Of course, Automake must honor this variable whenever it calls a 343 | # tool from the auxiliary directory. The problem is that $srcdir (and 344 | # therefore $ac_aux_dir as well) can be either absolute or relative, 345 | # depending on how configure is run. This is pretty annoying, since 346 | # it makes $ac_aux_dir quite unusable in subdirectories: in the top 347 | # source directory, any form will work fine, but in subdirectories a 348 | # relative path needs to be adjusted first. 349 | # 350 | # $ac_aux_dir/missing 351 | # fails when called from a subdirectory if $ac_aux_dir is relative 352 | # $top_srcdir/$ac_aux_dir/missing 353 | # fails if $ac_aux_dir is absolute, 354 | # fails when called from a subdirectory in a VPATH build with 355 | # a relative $ac_aux_dir 356 | # 357 | # The reason of the latter failure is that $top_srcdir and $ac_aux_dir 358 | # are both prefixed by $srcdir. In an in-source build this is usually 359 | # harmless because $srcdir is `.', but things will broke when you 360 | # start a VPATH build or use an absolute $srcdir. 361 | # 362 | # So we could use something similar to $top_srcdir/$ac_aux_dir/missing, 363 | # iff we strip the leading $srcdir from $ac_aux_dir. That would be: 364 | # am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"` 365 | # and then we would define $MISSING as 366 | # MISSING="\${SHELL} $am_aux_dir/missing" 367 | # This will work as long as MISSING is not called from configure, because 368 | # unfortunately $(top_srcdir) has no meaning in configure. 369 | # However there are other variables, like CC, which are often used in 370 | # configure, and could therefore not use this "fixed" $ac_aux_dir. 371 | # 372 | # Another solution, used here, is to always expand $ac_aux_dir to an 373 | # absolute PATH. The drawback is that using absolute paths prevent a 374 | # configured tree to be moved without reconfiguration. 375 | 376 | # Rely on autoconf to set up CDPATH properly. 377 | AC_PREREQ([2.50]) 378 | 379 | AC_DEFUN([AM_AUX_DIR_EXPAND], [ 380 | # expand $ac_aux_dir to an absolute path 381 | am_aux_dir=`cd $ac_aux_dir && pwd` 382 | ]) 383 | 384 | # AM_PROG_INSTALL_SH 385 | # ------------------ 386 | # Define $install_sh. 387 | 388 | # Copyright 2001 Free Software Foundation, Inc. 389 | 390 | # This program is free software; you can redistribute it and/or modify 391 | # it under the terms of the GNU General Public License as published by 392 | # the Free Software Foundation; either version 2, or (at your option) 393 | # any later version. 394 | 395 | # This program is distributed in the hope that it will be useful, 396 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 397 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 398 | # GNU General Public License for more details. 399 | 400 | # You should have received a copy of the GNU General Public License 401 | # along with this program; if not, write to the Free Software 402 | # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 403 | # 02111-1307, USA. 404 | 405 | AC_DEFUN([AM_PROG_INSTALL_SH], 406 | [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl 407 | install_sh=${install_sh-"$am_aux_dir/install-sh"} 408 | AC_SUBST(install_sh)]) 409 | 410 | # AM_PROG_INSTALL_STRIP 411 | 412 | # Copyright 2001 Free Software Foundation, Inc. 413 | 414 | # This program is free software; you can redistribute it and/or modify 415 | # it under the terms of the GNU General Public License as published by 416 | # the Free Software Foundation; either version 2, or (at your option) 417 | # any later version. 418 | 419 | # This program is distributed in the hope that it will be useful, 420 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 421 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 422 | # GNU General Public License for more details. 423 | 424 | # You should have received a copy of the GNU General Public License 425 | # along with this program; if not, write to the Free Software 426 | # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 427 | # 02111-1307, USA. 428 | 429 | # One issue with vendor `install' (even GNU) is that you can't 430 | # specify the program used to strip binaries. This is especially 431 | # annoying in cross-compiling environments, where the build's strip 432 | # is unlikely to handle the host's binaries. 433 | # Fortunately install-sh will honor a STRIPPROG variable, so we 434 | # always use install-sh in `make install-strip', and initialize 435 | # STRIPPROG with the value of the STRIP variable (set by the user). 436 | AC_DEFUN([AM_PROG_INSTALL_STRIP], 437 | [AC_REQUIRE([AM_PROG_INSTALL_SH])dnl 438 | # Installed binaries are usually stripped using `strip' when the user 439 | # run `make install-strip'. However `strip' might not be the right 440 | # tool to use in cross-compilation environments, therefore Automake 441 | # will honor the `STRIP' environment variable to overrule this program. 442 | dnl Don't test for $cross_compiling = yes, because it might be `maybe'. 443 | if test "$cross_compiling" != no; then 444 | AC_CHECK_TOOL([STRIP], [strip], :) 445 | fi 446 | INSTALL_STRIP_PROGRAM="\${SHELL} \$(install_sh) -c -s" 447 | AC_SUBST([INSTALL_STRIP_PROGRAM])]) 448 | 449 | # serial 4 -*- Autoconf -*- 450 | 451 | # Copyright 1999, 2000, 2001 Free Software Foundation, Inc. 452 | 453 | # This program is free software; you can redistribute it and/or modify 454 | # it under the terms of the GNU General Public License as published by 455 | # the Free Software Foundation; either version 2, or (at your option) 456 | # any later version. 457 | 458 | # This program is distributed in the hope that it will be useful, 459 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 460 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 461 | # GNU General Public License for more details. 462 | 463 | # You should have received a copy of the GNU General Public License 464 | # along with this program; if not, write to the Free Software 465 | # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 466 | # 02111-1307, USA. 467 | 468 | 469 | # There are a few dirty hacks below to avoid letting `AC_PROG_CC' be 470 | # written in clear, in which case automake, when reading aclocal.m4, 471 | # will think it sees a *use*, and therefore will trigger all it's 472 | # C support machinery. Also note that it means that autoscan, seeing 473 | # CC etc. in the Makefile, will ask for an AC_PROG_CC use... 474 | 475 | 476 | 477 | # _AM_DEPENDENCIES(NAME) 478 | # ---------------------- 479 | # See how the compiler implements dependency checking. 480 | # NAME is "CC", "CXX", "GCJ", or "OBJC". 481 | # We try a few techniques and use that to set a single cache variable. 482 | # 483 | # We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was 484 | # modified to invoke _AM_DEPENDENCIES(CC); we would have a circular 485 | # dependency, and given that the user is not expected to run this macro, 486 | # just rely on AC_PROG_CC. 487 | AC_DEFUN([_AM_DEPENDENCIES], 488 | [AC_REQUIRE([AM_SET_DEPDIR])dnl 489 | AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl 490 | AC_REQUIRE([AM_MAKE_INCLUDE])dnl 491 | AC_REQUIRE([AM_DEP_TRACK])dnl 492 | 493 | ifelse([$1], CC, [depcc="$CC" am_compiler_list=], 494 | [$1], CXX, [depcc="$CXX" am_compiler_list=], 495 | [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'], 496 | [$1], GCJ, [depcc="$GCJ" am_compiler_list='gcc3 gcc'], 497 | [depcc="$$1" am_compiler_list=]) 498 | 499 | AC_CACHE_CHECK([dependency style of $depcc], 500 | [am_cv_$1_dependencies_compiler_type], 501 | [if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then 502 | # We make a subdir and do the tests there. Otherwise we can end up 503 | # making bogus files that we don't know about and never remove. For 504 | # instance it was reported that on HP-UX the gcc test will end up 505 | # making a dummy file named `D' -- because `-MD' means `put the output 506 | # in D'. 507 | mkdir conftest.dir 508 | # Copy depcomp to subdir because otherwise we won't find it if we're 509 | # using a relative directory. 510 | cp "$am_depcomp" conftest.dir 511 | cd conftest.dir 512 | 513 | am_cv_$1_dependencies_compiler_type=none 514 | if test "$am_compiler_list" = ""; then 515 | am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp` 516 | fi 517 | for depmode in $am_compiler_list; do 518 | # We need to recreate these files for each test, as the compiler may 519 | # overwrite some of them when testing with obscure command lines. 520 | # This happens at least with the AIX C compiler. 521 | echo '#include "conftest.h"' > conftest.c 522 | echo 'int i;' > conftest.h 523 | echo "${am__include} ${am__quote}conftest.Po${am__quote}" > confmf 524 | 525 | case $depmode in 526 | nosideeffect) 527 | # after this tag, mechanisms are not by side-effect, so they'll 528 | # only be used when explicitly requested 529 | if test "x$enable_dependency_tracking" = xyes; then 530 | continue 531 | else 532 | break 533 | fi 534 | ;; 535 | none) break ;; 536 | esac 537 | # We check with `-c' and `-o' for the sake of the "dashmstdout" 538 | # mode. It turns out that the SunPro C++ compiler does not properly 539 | # handle `-M -o', and we need to detect this. 540 | if depmode=$depmode \ 541 | source=conftest.c object=conftest.o \ 542 | depfile=conftest.Po tmpdepfile=conftest.TPo \ 543 | $SHELL ./depcomp $depcc -c -o conftest.o conftest.c >/dev/null 2>&1 && 544 | grep conftest.h conftest.Po > /dev/null 2>&1 && 545 | ${MAKE-make} -s -f confmf > /dev/null 2>&1; then 546 | am_cv_$1_dependencies_compiler_type=$depmode 547 | break 548 | fi 549 | done 550 | 551 | cd .. 552 | rm -rf conftest.dir 553 | else 554 | am_cv_$1_dependencies_compiler_type=none 555 | fi 556 | ]) 557 | AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type]) 558 | AM_CONDITIONAL([am__fastdep$1], [ 559 | test "x$enable_dependency_tracking" != xno \ 560 | && test "$am_cv_$1_dependencies_compiler_type" = gcc3]) 561 | ]) 562 | 563 | 564 | # AM_SET_DEPDIR 565 | # ------------- 566 | # Choose a directory name for dependency files. 567 | # This macro is AC_REQUIREd in _AM_DEPENDENCIES 568 | AC_DEFUN([AM_SET_DEPDIR], 569 | [rm -f .deps 2>/dev/null 570 | mkdir .deps 2>/dev/null 571 | if test -d .deps; then 572 | DEPDIR=.deps 573 | else 574 | # MS-DOS does not allow filenames that begin with a dot. 575 | DEPDIR=_deps 576 | fi 577 | rmdir .deps 2>/dev/null 578 | AC_SUBST([DEPDIR]) 579 | ]) 580 | 581 | 582 | # AM_DEP_TRACK 583 | # ------------ 584 | AC_DEFUN([AM_DEP_TRACK], 585 | [AC_ARG_ENABLE(dependency-tracking, 586 | [ --disable-dependency-tracking Speeds up one-time builds 587 | --enable-dependency-tracking Do not reject slow dependency extractors]) 588 | if test "x$enable_dependency_tracking" != xno; then 589 | am_depcomp="$ac_aux_dir/depcomp" 590 | AMDEPBACKSLASH='\' 591 | fi 592 | AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno]) 593 | AC_SUBST([AMDEPBACKSLASH]) 594 | ]) 595 | 596 | # Generate code to set up dependency tracking. -*- Autoconf -*- 597 | 598 | # Copyright 1999, 2000, 2001, 2002 Free Software Foundation, Inc. 599 | 600 | # This program is free software; you can redistribute it and/or modify 601 | # it under the terms of the GNU General Public License as published by 602 | # the Free Software Foundation; either version 2, or (at your option) 603 | # any later version. 604 | 605 | # This program is distributed in the hope that it will be useful, 606 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 607 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 608 | # GNU General Public License for more details. 609 | 610 | # You should have received a copy of the GNU General Public License 611 | # along with this program; if not, write to the Free Software 612 | # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 613 | # 02111-1307, USA. 614 | 615 | #serial 2 616 | 617 | # _AM_OUTPUT_DEPENDENCY_COMMANDS 618 | # ------------------------------ 619 | AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], 620 | [for mf in $CONFIG_FILES; do 621 | # Strip MF so we end up with the name of the file. 622 | mf=`echo "$mf" | sed -e 's/:.*$//'` 623 | # Check whether this is an Automake generated Makefile or not. 624 | # We used to match only the files named `Makefile.in', but 625 | # some people rename them; so instead we look at the file content. 626 | # Grep'ing the first line is not enough: some people post-process 627 | # each Makefile.in and add a new line on top of each file to say so. 628 | # So let's grep whole file. 629 | if grep '^#.*generated by automake' $mf > /dev/null 2>&1; then 630 | dirpart=`AS_DIRNAME("$mf")` 631 | else 632 | continue 633 | fi 634 | grep '^DEP_FILES *= *[[^ @%:@]]' < "$mf" > /dev/null || continue 635 | # Extract the definition of DEP_FILES from the Makefile without 636 | # running `make'. 637 | DEPDIR=`sed -n -e '/^DEPDIR = / s///p' < "$mf"` 638 | test -z "$DEPDIR" && continue 639 | # When using ansi2knr, U may be empty or an underscore; expand it 640 | U=`sed -n -e '/^U = / s///p' < "$mf"` 641 | test -d "$dirpart/$DEPDIR" || mkdir "$dirpart/$DEPDIR" 642 | # We invoke sed twice because it is the simplest approach to 643 | # changing $(DEPDIR) to its actual value in the expansion. 644 | for file in `sed -n -e ' 645 | /^DEP_FILES = .*\\\\$/ { 646 | s/^DEP_FILES = // 647 | :loop 648 | s/\\\\$// 649 | p 650 | n 651 | /\\\\$/ b loop 652 | p 653 | } 654 | /^DEP_FILES = / s/^DEP_FILES = //p' < "$mf" | \ 655 | sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do 656 | # Make sure the directory exists. 657 | test -f "$dirpart/$file" && continue 658 | fdir=`AS_DIRNAME(["$file"])` 659 | AS_MKDIR_P([$dirpart/$fdir]) 660 | # echo "creating $dirpart/$file" 661 | echo '# dummy' > "$dirpart/$file" 662 | done 663 | done 664 | ])# _AM_OUTPUT_DEPENDENCY_COMMANDS 665 | 666 | 667 | # AM_OUTPUT_DEPENDENCY_COMMANDS 668 | # ----------------------------- 669 | # This macro should only be invoked once -- use via AC_REQUIRE. 670 | # 671 | # This code is only required when automatic dependency tracking 672 | # is enabled. FIXME. This creates each `.P' file that we will 673 | # need in order to bootstrap the dependency handling code. 674 | AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS], 675 | [AC_CONFIG_COMMANDS([depfiles], 676 | [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS], 677 | [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"]) 678 | ]) 679 | 680 | # Check to see how 'make' treats includes. -*- Autoconf -*- 681 | 682 | # Copyright (C) 2001, 2002 Free Software Foundation, Inc. 683 | 684 | # This program is free software; you can redistribute it and/or modify 685 | # it under the terms of the GNU General Public License as published by 686 | # the Free Software Foundation; either version 2, or (at your option) 687 | # any later version. 688 | 689 | # This program is distributed in the hope that it will be useful, 690 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 691 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 692 | # GNU General Public License for more details. 693 | 694 | # You should have received a copy of the GNU General Public License 695 | # along with this program; if not, write to the Free Software 696 | # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 697 | # 02111-1307, USA. 698 | 699 | # serial 2 700 | 701 | # AM_MAKE_INCLUDE() 702 | # ----------------- 703 | # Check to see how make treats includes. 704 | AC_DEFUN([AM_MAKE_INCLUDE], 705 | [am_make=${MAKE-make} 706 | cat > confinc << 'END' 707 | doit: 708 | @echo done 709 | END 710 | # If we don't find an include directive, just comment out the code. 711 | AC_MSG_CHECKING([for style of include used by $am_make]) 712 | am__include="#" 713 | am__quote= 714 | _am_result=none 715 | # First try GNU make style include. 716 | echo "include confinc" > confmf 717 | # We grep out `Entering directory' and `Leaving directory' 718 | # messages which can occur if `w' ends up in MAKEFLAGS. 719 | # In particular we don't look at `^make:' because GNU make might 720 | # be invoked under some other name (usually "gmake"), in which 721 | # case it prints its new name instead of `make'. 722 | if test "`$am_make -s -f confmf 2> /dev/null | grep -v 'ing directory'`" = "done"; then 723 | am__include=include 724 | am__quote= 725 | _am_result=GNU 726 | fi 727 | # Now try BSD make style include. 728 | if test "$am__include" = "#"; then 729 | echo '.include "confinc"' > confmf 730 | if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then 731 | am__include=.include 732 | am__quote="\"" 733 | _am_result=BSD 734 | fi 735 | fi 736 | AC_SUBST(am__include) 737 | AC_SUBST(am__quote) 738 | AC_MSG_RESULT($_am_result) 739 | rm -f confinc confmf 740 | ]) 741 | 742 | # AM_CONDITIONAL -*- Autoconf -*- 743 | 744 | # Copyright 1997, 2000, 2001 Free Software Foundation, Inc. 745 | 746 | # This program is free software; you can redistribute it and/or modify 747 | # it under the terms of the GNU General Public License as published by 748 | # the Free Software Foundation; either version 2, or (at your option) 749 | # any later version. 750 | 751 | # This program is distributed in the hope that it will be useful, 752 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 753 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 754 | # GNU General Public License for more details. 755 | 756 | # You should have received a copy of the GNU General Public License 757 | # along with this program; if not, write to the Free Software 758 | # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 759 | # 02111-1307, USA. 760 | 761 | # serial 5 762 | 763 | AC_PREREQ(2.52) 764 | 765 | # AM_CONDITIONAL(NAME, SHELL-CONDITION) 766 | # ------------------------------------- 767 | # Define a conditional. 768 | AC_DEFUN([AM_CONDITIONAL], 769 | [ifelse([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])], 770 | [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl 771 | AC_SUBST([$1_TRUE]) 772 | AC_SUBST([$1_FALSE]) 773 | if $2; then 774 | $1_TRUE= 775 | $1_FALSE='#' 776 | else 777 | $1_TRUE='#' 778 | $1_FALSE= 779 | fi 780 | AC_CONFIG_COMMANDS_PRE( 781 | [if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then 782 | AC_MSG_ERROR([conditional "$1" was never defined. 783 | Usually this means the macro was only invoked conditionally.]) 784 | fi])]) 785 | 786 | # AC_LIB_STLPORT - implement the --with-stlport / --with-stlport-headers= 787 | # and --with-stlport-libs= flags 788 | # Usage: AC_LIB_STLPORT[(DEFAULT)] 789 | # Where DEFAULT is either `yes' or `no'. If omitted, it defaults to 790 | # `yes'. 791 | # 792 | # If all tests succeed, CPPFLAGS will be *prepended* with 793 | # -nostdinc++ -I 794 | # and LIBS will be appended with 795 | # -l 796 | # 797 | # directory defaults to /usr/include/stlport, but can be overridden with the 798 | # --with-stlport-headers directive; 799 | # library defaults to stlport, and can be overridden with the 800 | # --with-stlport-libs directive 801 | # 802 | # $Id: aclocal.m4,v 1.7 2007-08-07 13:49:58 vlavrinenko Exp $ 803 | # 804 | # This file is (c) 2001 Jasper Spaans, 805 | # Please send your comments, suggestions and bugfixes to the above 806 | # e-mail address. 807 | # 808 | # This program is free software; you can redistribute it and/or modify it 809 | # under the terms of the GNU Lesser General Public License as published by 810 | # the Free Software Foundation; either version 2 of the License, or (at 811 | # your option) any later version. 812 | # 813 | # This program is distributed in the hope that it will be useful, but 814 | # WITHOUT ANY WARRANTY; without even the implied warranty of 815 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser 816 | # General Public License for more details. 817 | # 818 | # You should have received a copy of the GNU Lesser General Public License 819 | # along with this program; if not, write to the Free Software Foundation, 820 | # Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 821 | 822 | AC_DEFUN([AC_LIB_STLPORT], 823 | [define([AC_LIB_STLPORT_DEFAULT], ifelse($1, no, no, yes))dnl 824 | AC_MSG_CHECKING(whether to use stlport libraries) 825 | AC_ARG_WITH(stlport, AC_HELP_STRING(--with-stlport,use sgi stlport headers and libraries), 826 | [ if test "x$withval" == xno ; then 827 | ac_stlport_use="no" 828 | fi], 829 | ac_stlport_use=AC_LIB_STLPORT_DEFAULT) 830 | AC_ARG_WITH(stlport-headers, AC_HELP_STRING(--with-stlport-headers,where to find stlport headers), 831 | [ if test "x$withval" == xno ; then 832 | ac_stlport_use="no" 833 | else 834 | ac_stlport_headers="$with_stlport_headers" 835 | fi], 836 | [ 837 | ac_stlport_headers="/usr/include/stlport" 838 | ]) 839 | AC_ARG_WITH(stlport-libs, AC_HELP_STRING(--with-stlport-libs, where to find stlport libraries), 840 | [ if test "x$withval" == xno ; then 841 | ac_stlport_use="no" 842 | else 843 | ac_stlport_libs="$with_stlport_libs" 844 | fi], 845 | [ 846 | ac_stlport_libs="stlport" 847 | ]) 848 | 849 | if test "$ac_stlport_use" == no ; then 850 | AC_MSG_RESULT(no) 851 | else 852 | AC_MSG_RESULT(yes) 853 | AC_MSG_CHECKING(where to find stlport headers) 854 | ac_stlport_save_CPPFLAGS="$CPPFLAGS" 855 | ac_stlport_save_LIBS="$LIBS" 856 | CPPFLAGS="-I$ac_stlport_headers $CPPFLAGS" 857 | LIBS="-l$ac_stlport_libs $LIBS" 858 | if test "$MSYSTEM" == "MINGW32"; then 859 | CPPFLAGS="$CPPFLAGS -mthreads" 860 | fi 861 | AC_LANG_PUSH(C++) 862 | AC_TRY_COMPILE([#include ],, 863 | 864 | AC_MSG_RESULT($ac_stlport_headers) 865 | AC_MSG_CHECKING(where to find stlport libraries) 866 | AC_TRY_RUN([#include 867 | #include 868 | int 869 | main() 870 | { 871 | std::cout << "" << std::ends; 872 | return(0); 873 | } 874 | ], 875 | AC_SUBST(CPPFLAGS) 876 | AC_SUBST(LIBS) 877 | AC_MSG_RESULT($ac_stlport_libs), 878 | AC_MSG_ERROR(failed)), 879 | AC_MSG_ERROR(failed)) 880 | fi 881 | ]) 882 | 883 | -------------------------------------------------------------------------------- /common.h: -------------------------------------------------------------------------------- 1 | #ifndef __COMMON_H__ 2 | #define __COMMON_H__ 3 | 4 | #include "config.h" 5 | #include 6 | #include 7 | #include 8 | 9 | #ifndef HAVE_RINT 10 | 11 | #include 12 | inline int rint(double f) 13 | { 14 | return(f-std::floor(f)<0.5?std::floor(f):std::ceil(f)); 15 | } 16 | 17 | #endif 18 | 19 | inline std::string from_int(int value) 20 | { 21 | std::ostringstream buf; 22 | buf< header file. */ 8 | #define HAVE_INTTYPES_H 1 9 | 10 | /* Define to 1 if you have the `stdc++' library (-lstdc++). */ 11 | #define HAVE_LIBSTDC__ 1 12 | 13 | /* Define to 1 if you have the header file. */ 14 | #define HAVE_MEMORY_H 1 15 | 16 | /* Define to 1 if you have rint function */ 17 | #define HAVE_RINT 1 18 | 19 | /* Define to 1 if stdbool.h conforms to C99. */ 20 | #define HAVE_STDBOOL_H 1 21 | 22 | /* Define to 1 if you have the header file. */ 23 | #define HAVE_STDINT_H 1 24 | 25 | /* Define to 1 if you have the header file. */ 26 | #define HAVE_STDLIB_H 1 27 | 28 | /* Define to 1 if you have the header file. */ 29 | #define HAVE_STRINGS_H 1 30 | 31 | /* Define to 1 if you have the header file. */ 32 | #define HAVE_STRING_H 1 33 | 34 | /* Define to 1 if you have the `strtol' function. */ 35 | #define HAVE_STRTOL 1 36 | 37 | /* Define to 1 if you have the header file. */ 38 | #define HAVE_SYS_STAT_H 1 39 | 40 | /* Define to 1 if you have the header file. */ 41 | #define HAVE_SYS_TYPES_H 1 42 | 43 | /* Define to 1 if you have the header file. */ 44 | #define HAVE_UNISTD_H 1 45 | 46 | /* Define to 1 if the system has the type `_Bool'. */ 47 | #define HAVE__BOOL 1 48 | 49 | /* Define to 1 for release version */ 50 | #define NDEBUG 1 51 | 52 | /* Name of package */ 53 | #define PACKAGE "rtf2html" 54 | 55 | /* Define to the address where bug reports for this package should be sent. */ 56 | #define PACKAGE_BUGREPORT "vlavrinenko@users.sourceforge.net" 57 | 58 | /* Define to the full name of this package. */ 59 | #define PACKAGE_NAME "rtf2html" 60 | 61 | /* Define to the full name and version of this package. */ 62 | #define PACKAGE_STRING "rtf2html 0.2.0" 63 | 64 | /* Define to the one symbol short name of this package. */ 65 | #define PACKAGE_TARNAME "rtf2html" 66 | 67 | /* Define to the version of this package. */ 68 | #define PACKAGE_VERSION "0.2.0" 69 | 70 | /* Define to 1 if you have the ANSI C header files. */ 71 | #define STDC_HEADERS 1 72 | 73 | /* Version number of package */ 74 | #define VERSION "0.2.0" 75 | 76 | /* Define to 1 for debug version */ 77 | /* #undef _DEBUG */ 78 | 79 | /* Define to 1 for release version */ 80 | #define _NDEBUG 1 81 | 82 | /* Define to 1 to use STLPort debug facilities */ 83 | /* #undef _STLP_DEBUG */ 84 | 85 | /* Define to 1 if you link STLPort statically */ 86 | /* #undef _STLP_USE_STATIC_LIB */ 87 | 88 | /* Define to 1 for debug version */ 89 | /* #undef __DEBUG__ */ 90 | 91 | /* Define to empty if `const' does not conform to ANSI C. */ 92 | /* #undef const */ 93 | 94 | /* Define to `__inline__' or `__inline' if that's what the C compiler 95 | calls it, or to nothing if 'inline' is not supported under any name. */ 96 | #ifndef __cplusplus 97 | /* #undef inline */ 98 | #endif 99 | -------------------------------------------------------------------------------- /config.h.in: -------------------------------------------------------------------------------- 1 | /* config.h.in. Generated from configure.in by autoheader. */ 2 | 3 | /* Define to 1 if you have the `floor' function. */ 4 | #undef HAVE_FLOOR 5 | 6 | /* Define to 1 if you have the header file. */ 7 | #undef HAVE_INTTYPES_H 8 | 9 | /* Define to 1 if you have the `stdc++' library (-lstdc++). */ 10 | #undef HAVE_LIBSTDC__ 11 | 12 | /* Define to 1 if you have the header file. */ 13 | #undef HAVE_MEMORY_H 14 | 15 | /* Define to 1 if you have rint function */ 16 | #undef HAVE_RINT 17 | 18 | /* Define to 1 if stdbool.h conforms to C99. */ 19 | #undef HAVE_STDBOOL_H 20 | 21 | /* Define to 1 if you have the header file. */ 22 | #undef HAVE_STDINT_H 23 | 24 | /* Define to 1 if you have the header file. */ 25 | #undef HAVE_STDLIB_H 26 | 27 | /* Define to 1 if you have the header file. */ 28 | #undef HAVE_STRINGS_H 29 | 30 | /* Define to 1 if you have the header file. */ 31 | #undef HAVE_STRING_H 32 | 33 | /* Define to 1 if you have the `strtol' function. */ 34 | #undef HAVE_STRTOL 35 | 36 | /* Define to 1 if you have the header file. */ 37 | #undef HAVE_SYS_STAT_H 38 | 39 | /* Define to 1 if you have the header file. */ 40 | #undef HAVE_SYS_TYPES_H 41 | 42 | /* Define to 1 if you have the header file. */ 43 | #undef HAVE_UNISTD_H 44 | 45 | /* Define to 1 if the system has the type `_Bool'. */ 46 | #undef HAVE__BOOL 47 | 48 | /* Define to 1 for release version */ 49 | #undef NDEBUG 50 | 51 | /* Name of package */ 52 | #undef PACKAGE 53 | 54 | /* Define to the address where bug reports for this package should be sent. */ 55 | #undef PACKAGE_BUGREPORT 56 | 57 | /* Define to the full name of this package. */ 58 | #undef PACKAGE_NAME 59 | 60 | /* Define to the full name and version of this package. */ 61 | #undef PACKAGE_STRING 62 | 63 | /* Define to the one symbol short name of this package. */ 64 | #undef PACKAGE_TARNAME 65 | 66 | /* Define to the version of this package. */ 67 | #undef PACKAGE_VERSION 68 | 69 | /* Define to 1 if you have the ANSI C header files. */ 70 | #undef STDC_HEADERS 71 | 72 | /* Version number of package */ 73 | #undef VERSION 74 | 75 | /* Define to 1 for debug version */ 76 | #undef _DEBUG 77 | 78 | /* Define to 1 for release version */ 79 | #undef _NDEBUG 80 | 81 | /* Define to 1 to use STLPort debug facilities */ 82 | #undef _STLP_DEBUG 83 | 84 | /* Define to 1 if you link STLPort statically */ 85 | #undef _STLP_USE_STATIC_LIB 86 | 87 | /* Define to 1 for debug version */ 88 | #undef __DEBUG__ 89 | 90 | /* Define to empty if `const' does not conform to ANSI C. */ 91 | #undef const 92 | 93 | /* Define to `__inline__' or `__inline' if that's what the C compiler 94 | calls it, or to nothing if 'inline' is not supported under any name. */ 95 | #ifndef __cplusplus 96 | #undef inline 97 | #endif 98 | -------------------------------------------------------------------------------- /configure.in: -------------------------------------------------------------------------------- 1 | AC_INIT(rtf2html, 0.2.0, vlavrinenko@users.sourceforge.net) 2 | AM_INIT_AUTOMAKE(dist-bzip2) 3 | AC_CONFIG_HEADERS(config.h) 4 | AC_CONFIG_SRCDIR(rtf2html.cpp) 5 | 6 | CXXFLAGS= 7 | 8 | AC_PROG_CXX 9 | AC_PROG_CC 10 | AC_PROG_INSTALL 11 | AC_PROG_MAKE_SET 12 | 13 | AC_HEADER_STDC 14 | AC_HEADER_STDBOOL 15 | AC_C_CONST 16 | AC_C_INLINE 17 | 18 | AC_LANG_CPLUSPLUS 19 | 20 | AC_ARG_ENABLE(static,AS_HELP_STRING(--enable-static,link with STLPort statically),,enable_static=no) 21 | if test "x$enable_static" != "xno"; then 22 | AC_DEFINE(_STLP_USE_STATIC_LIB,1,Define to 1 if you link STLPort statically) 23 | fi 24 | AC_ARG_ENABLE(debug,AS_HELP_STRING(--enable-debug,compile with debug info),,enable_debug=no) 25 | if test "x$enable_debug" != "xno"; then 26 | AC_MSG_NOTICE(Enabling debugging info...) 27 | AC_DEFINE(__DEBUG__,1,Define to 1 for debug version) 28 | AC_DEFINE(_DEBUG,1,Define to 1 for debug version) 29 | CFLAGS="$CFLAGS -g -Wall -O0" 30 | AC_DEFINE(_STLP_DEBUG,1,Define to 1 to use STLPort debug facilities) 31 | else 32 | AC_MSG_NOTICE(Disabling debugging info...) 33 | AC_DEFINE(NDEBUG,1,Define to 1 for release version) 34 | AC_DEFINE(_NDEBUG,1,Define to 1 for release version) 35 | CFLAGS=$(echo $CFLAGS|sed 's/-g//g') 36 | fi 37 | 38 | 39 | 40 | AC_LIB_STLPORT(no) 41 | if test "$ac_stlport_use" = "no"; then 42 | AC_CHECK_LIB(stdc++,main,,AC_MSG_ERROR(rtf2html requires either libstdc++ or libstrloprt)) 43 | fi 44 | 45 | AC_CHECK_HEADER(string,,AC_MSG_ERROR(STL classes missing ?)) 46 | AC_CHECK_FUNCS(floor strtol,,AC_MSG_ERROR(STDLIB funcs missing)) 47 | AC_CHECK_FUNC(rint,AC_DEFINE(HAVE_RINT,1,Define to 1 if you have rint function)) 48 | 49 | CXXFLAGS="$CPPFLAGS $CFLAGS" 50 | 51 | AC_OUTPUT(Makefile) 52 | -------------------------------------------------------------------------------- /dbg_iter.h: -------------------------------------------------------------------------------- 1 | template 2 | class dbg_iter_mixin : public virtual T 3 | { 4 | public: 5 | int offset; 6 | dbg_iter_mixin(const T& t) : T(t) 7 | {} 8 | T& operator=(const T& t) 9 | { 10 | return T::operator=(t); 11 | } 12 | dbg_iter_mixin& operator++ () 13 | { 14 | ++offset; 15 | T::operator++(); 16 | return *this; 17 | } 18 | dbg_iter_mixin operator++ (int i) 19 | { 20 | ++offset; 21 | return T::operator++(i); 22 | } 23 | char operator *() const 24 | { 25 | T::value_type c=T::operator*(); 26 | std::cerr< 32 | class dbg_iter : public dbg_iter_mixin 33 | { 34 | public: 35 | dbg_iter(const T& t) : dbg_iter_mixin(t) 36 | {} 37 | }; 38 | 39 | template 40 | class dbg_iter > : 41 | public virtual std::istreambuf_iterator, 42 | public dbg_iter_mixin > 43 | { 44 | public: 45 | dbg_iter(std::basic_streambuf *buf) : std::istreambuf_iterator(buf) 46 | {} 47 | }; 48 | -------------------------------------------------------------------------------- /depcomp: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | # depcomp - compile a program generating dependencies as side-effects 3 | 4 | scriptversion=2004-04-25.13 5 | 6 | # Copyright (C) 1999, 2000, 2003, 2004 Free Software Foundation, Inc. 7 | 8 | # This program is free software; you can redistribute it and/or modify 9 | # it under the terms of the GNU General Public License as published by 10 | # the Free Software Foundation; either version 2, or (at your option) 11 | # any later version. 12 | 13 | # This program is distributed in the hope that it will be useful, 14 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | # GNU General Public License for more details. 17 | 18 | # You should have received a copy of the GNU General Public License 19 | # along with this program; if not, write to the Free Software 20 | # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 21 | # 02111-1307, USA. 22 | 23 | # As a special exception to the GNU General Public License, if you 24 | # distribute this file as part of a program that contains a 25 | # configuration script generated by Autoconf, you may include it under 26 | # the same distribution terms that you use for the rest of that program. 27 | 28 | # Originally written by Alexandre Oliva . 29 | 30 | case $1 in 31 | '') 32 | echo "$0: No command. Try \`$0 --help' for more information." 1>&2 33 | exit 1; 34 | ;; 35 | -h | --h*) 36 | cat <<\EOF 37 | Usage: depcomp [--help] [--version] PROGRAM [ARGS] 38 | 39 | Run PROGRAMS ARGS to compile a file, generating dependencies 40 | as side-effects. 41 | 42 | Environment variables: 43 | depmode Dependency tracking mode. 44 | source Source file read by `PROGRAMS ARGS'. 45 | object Object file output by `PROGRAMS ARGS'. 46 | depfile Dependency file to output. 47 | tmpdepfile Temporary file to use when outputing dependencies. 48 | libtool Whether libtool is used (yes/no). 49 | 50 | Report bugs to . 51 | EOF 52 | exit 0 53 | ;; 54 | -v | --v*) 55 | echo "depcomp $scriptversion" 56 | exit 0 57 | ;; 58 | esac 59 | 60 | if test -z "$depmode" || test -z "$source" || test -z "$object"; then 61 | echo "depcomp: Variables source, object and depmode must be set" 1>&2 62 | exit 1 63 | fi 64 | # `libtool' can also be set to `yes' or `no'. 65 | 66 | if test -z "$depfile"; then 67 | base=`echo "$object" | sed -e 's,^.*/,,' -e 's,\.\([^.]*\)$,.P\1,'` 68 | dir=`echo "$object" | sed 's,/.*$,/,'` 69 | if test "$dir" = "$object"; then 70 | dir= 71 | fi 72 | # FIXME: should be _deps on DOS. 73 | depfile="$dir.deps/$base" 74 | fi 75 | 76 | tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`} 77 | 78 | rm -f "$tmpdepfile" 79 | 80 | # Some modes work just like other modes, but use different flags. We 81 | # parameterize here, but still list the modes in the big case below, 82 | # to make depend.m4 easier to write. Note that we *cannot* use a case 83 | # here, because this file can only contain one case statement. 84 | if test "$depmode" = hp; then 85 | # HP compiler uses -M and no extra arg. 86 | gccflag=-M 87 | depmode=gcc 88 | fi 89 | 90 | if test "$depmode" = dashXmstdout; then 91 | # This is just like dashmstdout with a different argument. 92 | dashmflag=-xM 93 | depmode=dashmstdout 94 | fi 95 | 96 | case "$depmode" in 97 | gcc3) 98 | ## gcc 3 implements dependency tracking that does exactly what 99 | ## we want. Yay! Note: for some reason libtool 1.4 doesn't like 100 | ## it if -MD -MP comes after the -MF stuff. Hmm. 101 | "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" 102 | stat=$? 103 | if test $stat -eq 0; then : 104 | else 105 | rm -f "$tmpdepfile" 106 | exit $stat 107 | fi 108 | mv "$tmpdepfile" "$depfile" 109 | ;; 110 | 111 | gcc) 112 | ## There are various ways to get dependency output from gcc. Here's 113 | ## why we pick this rather obscure method: 114 | ## - Don't want to use -MD because we'd like the dependencies to end 115 | ## up in a subdir. Having to rename by hand is ugly. 116 | ## (We might end up doing this anyway to support other compilers.) 117 | ## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like 118 | ## -MM, not -M (despite what the docs say). 119 | ## - Using -M directly means running the compiler twice (even worse 120 | ## than renaming). 121 | if test -z "$gccflag"; then 122 | gccflag=-MD, 123 | fi 124 | "$@" -Wp,"$gccflag$tmpdepfile" 125 | stat=$? 126 | if test $stat -eq 0; then : 127 | else 128 | rm -f "$tmpdepfile" 129 | exit $stat 130 | fi 131 | rm -f "$depfile" 132 | echo "$object : \\" > "$depfile" 133 | alpha=ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz 134 | ## The second -e expression handles DOS-style file names with drive letters. 135 | sed -e 's/^[^:]*: / /' \ 136 | -e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile" 137 | ## This next piece of magic avoids the `deleted header file' problem. 138 | ## The problem is that when a header file which appears in a .P file 139 | ## is deleted, the dependency causes make to die (because there is 140 | ## typically no way to rebuild the header). We avoid this by adding 141 | ## dummy dependencies for each header file. Too bad gcc doesn't do 142 | ## this for us directly. 143 | tr ' ' ' 144 | ' < "$tmpdepfile" | 145 | ## Some versions of gcc put a space before the `:'. On the theory 146 | ## that the space means something, we add a space to the output as 147 | ## well. 148 | ## Some versions of the HPUX 10.20 sed can't process this invocation 149 | ## correctly. Breaking it into two sed invocations is a workaround. 150 | sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" 151 | rm -f "$tmpdepfile" 152 | ;; 153 | 154 | hp) 155 | # This case exists only to let depend.m4 do its work. It works by 156 | # looking at the text of this script. This case will never be run, 157 | # since it is checked for above. 158 | exit 1 159 | ;; 160 | 161 | sgi) 162 | if test "$libtool" = yes; then 163 | "$@" "-Wp,-MDupdate,$tmpdepfile" 164 | else 165 | "$@" -MDupdate "$tmpdepfile" 166 | fi 167 | stat=$? 168 | if test $stat -eq 0; then : 169 | else 170 | rm -f "$tmpdepfile" 171 | exit $stat 172 | fi 173 | rm -f "$depfile" 174 | 175 | if test -f "$tmpdepfile"; then # yes, the sourcefile depend on other files 176 | echo "$object : \\" > "$depfile" 177 | 178 | # Clip off the initial element (the dependent). Don't try to be 179 | # clever and replace this with sed code, as IRIX sed won't handle 180 | # lines with more than a fixed number of characters (4096 in 181 | # IRIX 6.2 sed, 8192 in IRIX 6.5). We also remove comment lines; 182 | # the IRIX cc adds comments like `#:fec' to the end of the 183 | # dependency line. 184 | tr ' ' ' 185 | ' < "$tmpdepfile" \ 186 | | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' | \ 187 | tr ' 188 | ' ' ' >> $depfile 189 | echo >> $depfile 190 | 191 | # The second pass generates a dummy entry for each header file. 192 | tr ' ' ' 193 | ' < "$tmpdepfile" \ 194 | | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \ 195 | >> $depfile 196 | else 197 | # The sourcefile does not contain any dependencies, so just 198 | # store a dummy comment line, to avoid errors with the Makefile 199 | # "include basename.Plo" scheme. 200 | echo "#dummy" > "$depfile" 201 | fi 202 | rm -f "$tmpdepfile" 203 | ;; 204 | 205 | aix) 206 | # The C for AIX Compiler uses -M and outputs the dependencies 207 | # in a .u file. In older versions, this file always lives in the 208 | # current directory. Also, the AIX compiler puts `$object:' at the 209 | # start of each line; $object doesn't have directory information. 210 | # Version 6 uses the directory in both cases. 211 | stripped=`echo "$object" | sed 's/\(.*\)\..*$/\1/'` 212 | tmpdepfile="$stripped.u" 213 | if test "$libtool" = yes; then 214 | "$@" -Wc,-M 215 | else 216 | "$@" -M 217 | fi 218 | stat=$? 219 | 220 | if test -f "$tmpdepfile"; then : 221 | else 222 | stripped=`echo "$stripped" | sed 's,^.*/,,'` 223 | tmpdepfile="$stripped.u" 224 | fi 225 | 226 | if test $stat -eq 0; then : 227 | else 228 | rm -f "$tmpdepfile" 229 | exit $stat 230 | fi 231 | 232 | if test -f "$tmpdepfile"; then 233 | outname="$stripped.o" 234 | # Each line is of the form `foo.o: dependent.h'. 235 | # Do two passes, one to just change these to 236 | # `$object: dependent.h' and one to simply `dependent.h:'. 237 | sed -e "s,^$outname:,$object :," < "$tmpdepfile" > "$depfile" 238 | sed -e "s,^$outname: \(.*\)$,\1:," < "$tmpdepfile" >> "$depfile" 239 | else 240 | # The sourcefile does not contain any dependencies, so just 241 | # store a dummy comment line, to avoid errors with the Makefile 242 | # "include basename.Plo" scheme. 243 | echo "#dummy" > "$depfile" 244 | fi 245 | rm -f "$tmpdepfile" 246 | ;; 247 | 248 | icc) 249 | # Intel's C compiler understands `-MD -MF file'. However on 250 | # icc -MD -MF foo.d -c -o sub/foo.o sub/foo.c 251 | # ICC 7.0 will fill foo.d with something like 252 | # foo.o: sub/foo.c 253 | # foo.o: sub/foo.h 254 | # which is wrong. We want: 255 | # sub/foo.o: sub/foo.c 256 | # sub/foo.o: sub/foo.h 257 | # sub/foo.c: 258 | # sub/foo.h: 259 | # ICC 7.1 will output 260 | # foo.o: sub/foo.c sub/foo.h 261 | # and will wrap long lines using \ : 262 | # foo.o: sub/foo.c ... \ 263 | # sub/foo.h ... \ 264 | # ... 265 | 266 | "$@" -MD -MF "$tmpdepfile" 267 | stat=$? 268 | if test $stat -eq 0; then : 269 | else 270 | rm -f "$tmpdepfile" 271 | exit $stat 272 | fi 273 | rm -f "$depfile" 274 | # Each line is of the form `foo.o: dependent.h', 275 | # or `foo.o: dep1.h dep2.h \', or ` dep3.h dep4.h \'. 276 | # Do two passes, one to just change these to 277 | # `$object: dependent.h' and one to simply `dependent.h:'. 278 | sed "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile" 279 | # Some versions of the HPUX 10.20 sed can't process this invocation 280 | # correctly. Breaking it into two sed invocations is a workaround. 281 | sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" | 282 | sed -e 's/$/ :/' >> "$depfile" 283 | rm -f "$tmpdepfile" 284 | ;; 285 | 286 | tru64) 287 | # The Tru64 compiler uses -MD to generate dependencies as a side 288 | # effect. `cc -MD -o foo.o ...' puts the dependencies into `foo.o.d'. 289 | # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put 290 | # dependencies in `foo.d' instead, so we check for that too. 291 | # Subdirectories are respected. 292 | dir=`echo "$object" | sed -e 's|/[^/]*$|/|'` 293 | test "x$dir" = "x$object" && dir= 294 | base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'` 295 | 296 | if test "$libtool" = yes; then 297 | # Dependencies are output in .lo.d with libtool 1.4. 298 | # They are output in .o.d with libtool 1.5. 299 | tmpdepfile1="$dir.libs/$base.lo.d" 300 | tmpdepfile2="$dir.libs/$base.o.d" 301 | tmpdepfile3="$dir.libs/$base.d" 302 | "$@" -Wc,-MD 303 | else 304 | tmpdepfile1="$dir$base.o.d" 305 | tmpdepfile2="$dir$base.d" 306 | tmpdepfile3="$dir$base.d" 307 | "$@" -MD 308 | fi 309 | 310 | stat=$? 311 | if test $stat -eq 0; then : 312 | else 313 | rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" 314 | exit $stat 315 | fi 316 | 317 | if test -f "$tmpdepfile1"; then 318 | tmpdepfile="$tmpdepfile1" 319 | elif test -f "$tmpdepfile2"; then 320 | tmpdepfile="$tmpdepfile2" 321 | else 322 | tmpdepfile="$tmpdepfile3" 323 | fi 324 | if test -f "$tmpdepfile"; then 325 | sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile" 326 | # That's a tab and a space in the []. 327 | sed -e 's,^.*\.[a-z]*:[ ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile" 328 | else 329 | echo "#dummy" > "$depfile" 330 | fi 331 | rm -f "$tmpdepfile" 332 | ;; 333 | 334 | #nosideeffect) 335 | # This comment above is used by automake to tell side-effect 336 | # dependency tracking mechanisms from slower ones. 337 | 338 | dashmstdout) 339 | # Important note: in order to support this mode, a compiler *must* 340 | # always write the preprocessed file to stdout, regardless of -o. 341 | "$@" || exit $? 342 | 343 | # Remove the call to Libtool. 344 | if test "$libtool" = yes; then 345 | while test $1 != '--mode=compile'; do 346 | shift 347 | done 348 | shift 349 | fi 350 | 351 | # Remove `-o $object'. 352 | IFS=" " 353 | for arg 354 | do 355 | case $arg in 356 | -o) 357 | shift 358 | ;; 359 | $object) 360 | shift 361 | ;; 362 | *) 363 | set fnord "$@" "$arg" 364 | shift # fnord 365 | shift # $arg 366 | ;; 367 | esac 368 | done 369 | 370 | test -z "$dashmflag" && dashmflag=-M 371 | # Require at least two characters before searching for `:' 372 | # in the target name. This is to cope with DOS-style filenames: 373 | # a dependency such as `c:/foo/bar' could be seen as target `c' otherwise. 374 | "$@" $dashmflag | 375 | sed 's:^[ ]*[^: ][^:][^:]*\:[ ]*:'"$object"'\: :' > "$tmpdepfile" 376 | rm -f "$depfile" 377 | cat < "$tmpdepfile" > "$depfile" 378 | tr ' ' ' 379 | ' < "$tmpdepfile" | \ 380 | ## Some versions of the HPUX 10.20 sed can't process this invocation 381 | ## correctly. Breaking it into two sed invocations is a workaround. 382 | sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" 383 | rm -f "$tmpdepfile" 384 | ;; 385 | 386 | dashXmstdout) 387 | # This case only exists to satisfy depend.m4. It is never actually 388 | # run, as this mode is specially recognized in the preamble. 389 | exit 1 390 | ;; 391 | 392 | makedepend) 393 | "$@" || exit $? 394 | # Remove any Libtool call 395 | if test "$libtool" = yes; then 396 | while test $1 != '--mode=compile'; do 397 | shift 398 | done 399 | shift 400 | fi 401 | # X makedepend 402 | shift 403 | cleared=no 404 | for arg in "$@"; do 405 | case $cleared in 406 | no) 407 | set ""; shift 408 | cleared=yes ;; 409 | esac 410 | case "$arg" in 411 | -D*|-I*) 412 | set fnord "$@" "$arg"; shift ;; 413 | # Strip any option that makedepend may not understand. Remove 414 | # the object too, otherwise makedepend will parse it as a source file. 415 | -*|$object) 416 | ;; 417 | *) 418 | set fnord "$@" "$arg"; shift ;; 419 | esac 420 | done 421 | obj_suffix="`echo $object | sed 's/^.*\././'`" 422 | touch "$tmpdepfile" 423 | ${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@" 424 | rm -f "$depfile" 425 | cat < "$tmpdepfile" > "$depfile" 426 | sed '1,2d' "$tmpdepfile" | tr ' ' ' 427 | ' | \ 428 | ## Some versions of the HPUX 10.20 sed can't process this invocation 429 | ## correctly. Breaking it into two sed invocations is a workaround. 430 | sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" 431 | rm -f "$tmpdepfile" "$tmpdepfile".bak 432 | ;; 433 | 434 | cpp) 435 | # Important note: in order to support this mode, a compiler *must* 436 | # always write the preprocessed file to stdout. 437 | "$@" || exit $? 438 | 439 | # Remove the call to Libtool. 440 | if test "$libtool" = yes; then 441 | while test $1 != '--mode=compile'; do 442 | shift 443 | done 444 | shift 445 | fi 446 | 447 | # Remove `-o $object'. 448 | IFS=" " 449 | for arg 450 | do 451 | case $arg in 452 | -o) 453 | shift 454 | ;; 455 | $object) 456 | shift 457 | ;; 458 | *) 459 | set fnord "$@" "$arg" 460 | shift # fnord 461 | shift # $arg 462 | ;; 463 | esac 464 | done 465 | 466 | "$@" -E | 467 | sed -n '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' | 468 | sed '$ s: \\$::' > "$tmpdepfile" 469 | rm -f "$depfile" 470 | echo "$object : \\" > "$depfile" 471 | cat < "$tmpdepfile" >> "$depfile" 472 | sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile" 473 | rm -f "$tmpdepfile" 474 | ;; 475 | 476 | msvisualcpp) 477 | # Important note: in order to support this mode, a compiler *must* 478 | # always write the preprocessed file to stdout, regardless of -o, 479 | # because we must use -o when running libtool. 480 | "$@" || exit $? 481 | IFS=" " 482 | for arg 483 | do 484 | case "$arg" in 485 | "-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI") 486 | set fnord "$@" 487 | shift 488 | shift 489 | ;; 490 | *) 491 | set fnord "$@" "$arg" 492 | shift 493 | shift 494 | ;; 495 | esac 496 | done 497 | "$@" -E | 498 | sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::echo "`cygpath -u \\"\1\\"`":p' | sort | uniq > "$tmpdepfile" 499 | rm -f "$depfile" 500 | echo "$object : \\" > "$depfile" 501 | . "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s:: \1 \\:p' >> "$depfile" 502 | echo " " >> "$depfile" 503 | . "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s::\1\::p' >> "$depfile" 504 | rm -f "$tmpdepfile" 505 | ;; 506 | 507 | none) 508 | exec "$@" 509 | ;; 510 | 511 | *) 512 | echo "Unknown depmode $depmode" 1>&2 513 | exit 1 514 | ;; 515 | esac 516 | 517 | exit 0 518 | 519 | # Local Variables: 520 | # mode: shell-script 521 | # sh-indentation: 2 522 | # eval: (add-hook 'write-file-hooks 'time-stamp) 523 | # time-stamp-start: "scriptversion=" 524 | # time-stamp-format: "%:y-%02m-%02d.%02H" 525 | # time-stamp-end: "$" 526 | # End: 527 | -------------------------------------------------------------------------------- /fmt_opts.cpp: -------------------------------------------------------------------------------- 1 | #include "fmt_opts.h" 2 | 3 | strmap formatting_options::styles; 4 | 5 | std::string formatting_options::get_par_str() const 6 | { 7 | std::string style; 8 | switch (papAlign) 9 | { 10 | case formatting_options::align_right: 11 | style+="text-align:right;"; 12 | break; 13 | case formatting_options::align_center: 14 | style+="text-align:center;"; 15 | break; 16 | case formatting_options::align_justify: 17 | style+="text-align:justify;"; 18 | } 19 | if (papFirst!=0) 20 | { 21 | style+="text-indent:"; 22 | style+=from_int(papFirst); 23 | style+="pt;"; 24 | } 25 | if (papLeft!=0) 26 | { 27 | style+="margin-left:"; 28 | style+=from_int(papLeft); 29 | style+="pt;"; 30 | } 31 | if (papRight!=0) 32 | { 33 | style+="margin-right:"; 34 | style+=from_int(papRight); 35 | style+="pt;"; 36 | } 37 | if (papBefore!=0) 38 | { 39 | style+="margin-top:"; 40 | style+=from_int(papBefore); 41 | style+="pt;"; 42 | } 43 | if (papAfter!=0) 44 | { 45 | style+="margin-bottom:"; 46 | style+=from_int(papAfter); 47 | style+="pt;"; 48 | } 49 | if (style.empty()) 50 | return std::string("

"); 51 | else 52 | { 53 | return std::string("

"; 54 | } 55 | } 56 | 57 | std::string formatting_options::get_style_id(const std::string &style) 58 | { 59 | strmap::iterator i_style = styles.find(style); 60 | if (i_style == styles.end()) 61 | { 62 | i_style = styles.insert(strmap::value_type(style, std::string("cls") + from_int(styles.size()))).first; 63 | } 64 | return i_style->second; 65 | } 66 | 67 | std::string formatting_options::get_styles() 68 | { 69 | std::string result; 70 | for (strmap::const_iterator i = styles.begin(); i != styles.end(); ++i) 71 | { 72 | result += std::string(".") + i->second + " {" + i->first + "}\n"; 73 | } 74 | return result; 75 | } 76 | 77 | std::string formatter::format(const formatting_options &_opt) 78 | { 79 | formatting_options last_opt, opt(_opt); 80 | std::string result; 81 | if (!opt_stack.empty()) 82 | { 83 | int cnt=0; 84 | fo_deque::reverse_iterator i; 85 | for (i=opt_stack.rbegin(); i!=opt_stack.rend(); ++i) 86 | { 87 | if (*i==opt) 88 | break; 89 | ++cnt; 90 | } 91 | if (cnt==0) 92 | return ""; 93 | if (i!=opt_stack.rend()) 94 | { 95 | while (cnt--) 96 | { 97 | result+=""; 98 | opt_stack.pop_back(); 99 | } 100 | return result; 101 | } 102 | last_opt=opt_stack.back(); 103 | } 104 | if (last_opt.chpVAlign!=formatting_options::va_normal 105 | && last_opt.chpVAlign!=opt.chpVAlign) 106 | { 107 | int cnt=0; 108 | fo_deque::reverse_iterator i; 109 | for (i=opt_stack.rbegin(); i!=opt_stack.rend(); ++i) 110 | { 111 | if (i->chpVAlign==formatting_options::va_normal) 112 | break; 113 | ++cnt; 114 | } 115 | while (cnt--) 116 | { 117 | result+=""; 118 | opt_stack.pop_back(); 119 | } 120 | last_opt=opt_stack.empty()?formatting_options():opt_stack.back(); 121 | } 122 | std::string style; 123 | if (opt.chpBold!=last_opt.chpBold) 124 | { 125 | style+="font-weight:"; 126 | style+=opt.chpBold?"bold":"normal"; 127 | style+=";"; 128 | } 129 | if (opt.chpAllCaps!=last_opt.chpAllCaps) 130 | { 131 | style+="text-transform:"; 132 | style+=opt.chpAllCaps?"uppercase":"none"; 133 | style+=";"; 134 | } 135 | if (opt.chpItalic!=last_opt.chpItalic) 136 | { 137 | style+="font-style:"; 138 | style+=opt.chpItalic?"italic":"normal"; 139 | style+=";"; 140 | } 141 | if (opt.chpUnderline!=last_opt.chpUnderline) 142 | { 143 | style+="text-decoration:"; 144 | style+=opt.chpUnderline?"underline":"none"; 145 | style+=";"; 146 | } 147 | if (opt.chpVAlign!=formatting_options::va_normal) 148 | opt.chpFontSize=(int)(0.7*(opt.chpFontSize?opt.chpFontSize:24)); 149 | if (opt.chpFontSize!=last_opt.chpFontSize) 150 | { 151 | style+="font-size:"; 152 | style+=from_int(opt.chpFontSize/2); 153 | style+="pt;"; 154 | } 155 | if (opt.chpVAlign!=last_opt.chpVAlign) 156 | { 157 | style+="vertical-align:"; 158 | style+=opt.chpVAlign==formatting_options::va_sub?"sub":"super"; 159 | style+=";"; 160 | } 161 | if (opt.chpFColor!=last_opt.chpFColor) 162 | { 163 | style+="color:"; 164 | style+=opt.chpFColor.r>0?"#"+hex(opt.chpFColor.r&0xFF) 165 | +hex(opt.chpFColor.g&0xFF) 166 | +hex(opt.chpFColor.b&0xFF) 167 | :"WindowText"; 168 | style+=";"; 169 | } 170 | if (opt.chpBColor!=last_opt.chpBColor) 171 | { 172 | style+="background-color:"; 173 | style+=opt.chpBColor.r>0?"#"+hex(opt.chpBColor.r&0xFF) 174 | +hex(opt.chpBColor.g&0xFF) 175 | +hex(opt.chpBColor.b&0xFF) 176 | :"Window"; 177 | style+=";"; 178 | } 179 | if (opt.chpHighlight!=last_opt.chpHighlight) 180 | { 181 | style+="background-color:"; 182 | switch (opt.chpHighlight) 183 | { 184 | case 0: style+="Window"; break; 185 | case 1: style+="black"; break; 186 | case 2: style+="blue"; break; 187 | case 3: style+="aqua"; break; 188 | case 4: style+="lime"; break; 189 | case 5: style+="fuchsia"; break; 190 | case 6: style+="red"; break; 191 | case 7: style+="yellow"; break; 192 | case 9: style+="navy"; break; 193 | case 10: style+="teal"; break; 194 | case 11: style+="green"; break; 195 | case 12: style+="purple"; break; 196 | case 13: style+="maroon"; break; 197 | case 14: style+="olive"; break; 198 | case 15: style+="gray"; break; 199 | case 16: style+="silver"; break; 200 | } 201 | style+=";"; 202 | } 203 | if (opt.chpVShift!=last_opt.chpVShift) 204 | { 205 | style += "position:relative;top:" + from_int(opt.chpVShift / 2) + "pt;"; 206 | } 207 | if (opt.chpFont!=last_opt.chpFont) 208 | { 209 | style+="font-family:'"; 210 | style+=opt.chpFont.name.empty()?"serif":opt.chpFont.name; 211 | style+="'"; 212 | switch (opt.chpFont.family) 213 | { 214 | case font::ff_serif: style+=", serif"; break; 215 | case font::ff_sans_serif: style+=", sans-serif"; break; 216 | case font::ff_cursive: style+=", cursive"; break; 217 | case font::ff_fantasy: style+=", fantasy"; break; 218 | case font::ff_monospace: style+=", monospace"; break; 219 | } 220 | style+=";"; 221 | } 222 | opt_stack.push_back(opt); 223 | return result + ""; 224 | } 225 | 226 | std::string formatter::close() 227 | { 228 | std::string result; 229 | for (fo_deque::iterator i=opt_stack.begin(); i!=opt_stack.end(); ++i) 230 | result+=""; 231 | return result; 232 | } 233 | -------------------------------------------------------------------------------- /fmt_opts.h: -------------------------------------------------------------------------------- 1 | #ifndef __FMT_OPTS_H__ 2 | #define __FMT_OPTS_H__ 3 | 4 | #include "config.h" 5 | #include "common.h" 6 | #include 7 | #include 8 | #include 9 | #include 10 | 11 | struct color { 12 | int r, g, b; 13 | color() : r(-1), g(-1), b(-1) {} 14 | bool operator==(const color &clr) 15 | { 16 | return r==clr.r && g==clr.g && b==clr.b; 17 | } 18 | bool operator!=(const color &clr) 19 | { 20 | return !(*this==clr); 21 | } 22 | color &operator=(const color &clr) 23 | { 24 | r=clr.r; g=clr.g; b=clr.b; 25 | return *this; 26 | } 27 | }; 28 | 29 | typedef std::vector colorvect; 30 | 31 | struct font { 32 | enum font_family {ff_none, ff_serif, ff_sans_serif, ff_cursive, 33 | ff_fantasy, ff_monospace}; 34 | font_family family; 35 | std::string name; 36 | int pitch; 37 | int charset; 38 | font() : family(ff_none), name(), pitch(0), charset(0) {} 39 | bool operator==(const font &f) 40 | { 41 | return family==f.family && name==f.name; 42 | } 43 | bool operator!=(const font &f) 44 | { 45 | return !(*this==f); 46 | } 47 | font &operator=(const font &f) 48 | { 49 | family=f.family; name=f.name; pitch=f.pitch; charset=f.charset; 50 | return *this; 51 | } 52 | }; 53 | 54 | typedef std::map fontmap; 55 | typedef std::map strmap; 56 | 57 | struct formatting_options 58 | { 59 | static strmap styles; 60 | enum halign {align_left, align_right, align_center, align_justify, align_error}; 61 | enum valign {va_normal, va_sub, va_sup}; 62 | bool chpBold, chpAllCaps, chpItalic, chpUnderline; 63 | valign chpVAlign; 64 | int chpFontSize, chpHighlight, chpVShift; 65 | color chpFColor, chpBColor; 66 | font chpFont; 67 | int papLeft, papRight, papFirst; 68 | int papBefore, papAfter; 69 | halign papAlign; 70 | bool papInTbl; 71 | formatting_options() 72 | { 73 | chpBold=chpAllCaps=chpItalic=chpUnderline=false; 74 | chpVAlign=va_normal; 75 | chpFontSize=chpHighlight=chpVShift=0; 76 | papLeft=papRight=papFirst=papBefore=papAfter=0; 77 | papAlign=align_left; 78 | papInTbl=false; 79 | } 80 | bool operator==(const formatting_options &opt) // tests only for character options 81 | { 82 | return chpBold==opt.chpBold && chpAllCaps == opt.chpAllCaps 83 | && chpItalic==opt.chpItalic 84 | && chpUnderline==opt.chpUnderline && chpVAlign==opt.chpVAlign 85 | && chpFontSize==opt.chpFontSize 86 | && chpFColor==opt.chpFColor && chpBColor==opt.chpBColor 87 | && chpHighlight==opt.chpHighlight && chpFont==opt.chpFont 88 | && chpVShift==opt.chpVShift; 89 | } 90 | bool operator!=(const formatting_options &opt) // tests only for character options 91 | { 92 | return !(*this==opt); 93 | } 94 | formatting_options &operator=(const formatting_options &opt) 95 | { 96 | chpBold=opt.chpBold; chpAllCaps=opt.chpAllCaps; 97 | chpItalic=opt.chpItalic; 98 | chpUnderline=opt.chpUnderline; chpVAlign=opt.chpVAlign; 99 | chpFontSize=opt.chpFontSize; 100 | chpFColor=opt.chpFColor; chpBColor=opt.chpBColor; 101 | chpHighlight=opt.chpHighlight; chpFont=opt.chpFont; 102 | chpVShift=opt.chpVShift; 103 | papLeft=opt.papLeft; papRight=opt.papRight; 104 | papFirst=opt.papFirst; papBefore=opt.papBefore; papAfter=opt.papAfter; 105 | papAlign=opt.papAlign; papInTbl=opt.papInTbl; 106 | return *this; 107 | } 108 | std::string get_par_str() const; 109 | static std::string get_style_id(const std::string &style); 110 | static std::string get_styles(); 111 | }; 112 | 113 | typedef std::stack fo_stack; 114 | 115 | typedef std::deque fo_deque; 116 | 117 | class formatter { 118 | private: 119 | fo_deque opt_stack; 120 | public: 121 | std::string format(const formatting_options &opt); 122 | std::string close(); 123 | void clear() { opt_stack.clear(); } 124 | }; 125 | 126 | class html_text { 127 | private: 128 | const formatting_options &opt; 129 | formatter fmt; 130 | std::string text; 131 | public: 132 | html_text(const formatting_options &_opt) : opt(_opt) {} 133 | const std::string &str() { return text; } 134 | template void write(T s) 135 | { 136 | text+=fmt.format(opt)+s; 137 | } 138 | std::string close() { return fmt.close(); } 139 | // void write(char c) { write(std::string()+c); } 140 | void clear() { text.clear(); fmt.clear(); } 141 | }; 142 | 143 | #endif 144 | 145 | -------------------------------------------------------------------------------- /install-sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # install - install a program, script, or datafile 3 | 4 | scriptversion=2004-04-01.17 5 | 6 | # This originates from X11R5 (mit/util/scripts/install.sh), which was 7 | # later released in X11R6 (xc/config/util/install.sh) with the 8 | # following copyright and license. 9 | # 10 | # Copyright (C) 1994 X Consortium 11 | # 12 | # Permission is hereby granted, free of charge, to any person obtaining a copy 13 | # of this software and associated documentation files (the "Software"), to 14 | # deal in the Software without restriction, including without limitation the 15 | # rights to use, copy, modify, merge, publish, distribute, sublicense, and/or 16 | # sell copies of the Software, and to permit persons to whom the Software is 17 | # furnished to do so, subject to the following conditions: 18 | # 19 | # The above copyright notice and this permission notice shall be included in 20 | # all copies or substantial portions of the Software. 21 | # 22 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 23 | # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 24 | # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 25 | # X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN 26 | # AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC- 27 | # TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 28 | # 29 | # Except as contained in this notice, the name of the X Consortium shall not 30 | # be used in advertising or otherwise to promote the sale, use or other deal- 31 | # ings in this Software without prior written authorization from the X Consor- 32 | # tium. 33 | # 34 | # 35 | # FSF changes to this file are in the public domain. 36 | # 37 | # Calling this script install-sh is preferred over install.sh, to prevent 38 | # `make' implicit rules from creating a file called install from it 39 | # when there is no Makefile. 40 | # 41 | # This script is compatible with the BSD install script, but was written 42 | # from scratch. It can only install one file at a time, a restriction 43 | # shared with many OS's install programs. 44 | 45 | # set DOITPROG to echo to test this script 46 | 47 | # Don't use :- since 4.3BSD and earlier shells don't like it. 48 | doit="${DOITPROG-}" 49 | 50 | # put in absolute paths if you don't have them in your path; or use env. vars. 51 | 52 | mvprog="${MVPROG-mv}" 53 | cpprog="${CPPROG-cp}" 54 | chmodprog="${CHMODPROG-chmod}" 55 | chownprog="${CHOWNPROG-chown}" 56 | chgrpprog="${CHGRPPROG-chgrp}" 57 | stripprog="${STRIPPROG-strip}" 58 | rmprog="${RMPROG-rm}" 59 | mkdirprog="${MKDIRPROG-mkdir}" 60 | 61 | transformbasename= 62 | transform_arg= 63 | instcmd="$mvprog" 64 | chmodcmd="$chmodprog 0755" 65 | chowncmd= 66 | chgrpcmd= 67 | stripcmd= 68 | rmcmd="$rmprog -f" 69 | mvcmd="$mvprog" 70 | src= 71 | dst= 72 | dir_arg= 73 | 74 | usage="Usage: $0 [OPTION]... SRCFILE DSTFILE 75 | or: $0 [OPTION]... SRCFILES... DIRECTORY 76 | or: $0 -d DIRECTORIES... 77 | 78 | In the first form, install SRCFILE to DSTFILE, removing SRCFILE by default. 79 | In the second, create the directory path DIR. 80 | 81 | Options: 82 | -b=TRANSFORMBASENAME 83 | -c copy source (using $cpprog) instead of moving (using $mvprog). 84 | -d create directories instead of installing files. 85 | -g GROUP $chgrp installed files to GROUP. 86 | -m MODE $chmod installed files to MODE. 87 | -o USER $chown installed files to USER. 88 | -s strip installed files (using $stripprog). 89 | -t=TRANSFORM 90 | --help display this help and exit. 91 | --version display version info and exit. 92 | 93 | Environment variables override the default commands: 94 | CHGRPPROG CHMODPROG CHOWNPROG CPPROG MKDIRPROG MVPROG RMPROG STRIPPROG 95 | " 96 | 97 | while test -n "$1"; do 98 | case $1 in 99 | -b=*) transformbasename=`echo $1 | sed 's/-b=//'` 100 | shift 101 | continue;; 102 | 103 | -c) instcmd=$cpprog 104 | shift 105 | continue;; 106 | 107 | -d) dir_arg=true 108 | shift 109 | continue;; 110 | 111 | -g) chgrpcmd="$chgrpprog $2" 112 | shift 113 | shift 114 | continue;; 115 | 116 | --help) echo "$usage"; exit 0;; 117 | 118 | -m) chmodcmd="$chmodprog $2" 119 | shift 120 | shift 121 | continue;; 122 | 123 | -o) chowncmd="$chownprog $2" 124 | shift 125 | shift 126 | continue;; 127 | 128 | -s) stripcmd=$stripprog 129 | shift 130 | continue;; 131 | 132 | -t=*) transformarg=`echo $1 | sed 's/-t=//'` 133 | shift 134 | continue;; 135 | 136 | --version) echo "$0 $scriptversion"; exit 0;; 137 | 138 | *) # When -d is used, all remaining arguments are directories to create. 139 | test -n "$dir_arg" && break 140 | # Otherwise, the last argument is the destination. Remove it from $@. 141 | for arg 142 | do 143 | if test -n "$dstarg"; then 144 | # $@ is not empty: it contains at least $arg. 145 | set fnord "$@" "$dstarg" 146 | shift # fnord 147 | fi 148 | shift # arg 149 | dstarg=$arg 150 | done 151 | break;; 152 | esac 153 | done 154 | 155 | if test -z "$1"; then 156 | if test -z "$dir_arg"; then 157 | echo "$0: no input file specified." >&2 158 | exit 1 159 | fi 160 | # It's OK to call `install-sh -d' without argument. 161 | # This can happen when creating conditional directories. 162 | exit 0 163 | fi 164 | 165 | for src 166 | do 167 | # Protect names starting with `-'. 168 | case $src in 169 | -*) src=./$src ;; 170 | esac 171 | 172 | if test -n "$dir_arg"; then 173 | dst=$src 174 | src= 175 | 176 | if test -d "$dst"; then 177 | instcmd=: 178 | chmodcmd= 179 | else 180 | instcmd=$mkdirprog 181 | fi 182 | else 183 | # Waiting for this to be detected by the "$instcmd $src $dsttmp" command 184 | # might cause directories to be created, which would be especially bad 185 | # if $src (and thus $dsttmp) contains '*'. 186 | if test ! -f "$src" && test ! -d "$src"; then 187 | echo "$0: $src does not exist." >&2 188 | exit 1 189 | fi 190 | 191 | if test -z "$dstarg"; then 192 | echo "$0: no destination specified." >&2 193 | exit 1 194 | fi 195 | 196 | dst=$dstarg 197 | # Protect names starting with `-'. 198 | case $dst in 199 | -*) dst=./$dst ;; 200 | esac 201 | 202 | # If destination is a directory, append the input filename; won't work 203 | # if double slashes aren't ignored. 204 | if test -d "$dst"; then 205 | dst=$dst/`basename "$src"` 206 | fi 207 | fi 208 | 209 | # This sed command emulates the dirname command. 210 | dstdir=`echo "$dst" | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'` 211 | 212 | # Make sure that the destination directory exists. 213 | 214 | # Skip lots of stat calls in the usual case. 215 | if test ! -d "$dstdir"; then 216 | defaultIFS=' 217 | ' 218 | IFS="${IFS-$defaultIFS}" 219 | 220 | oIFS=$IFS 221 | # Some sh's can't handle IFS=/ for some reason. 222 | IFS='%' 223 | set - `echo "$dstdir" | sed -e 's@/@%@g' -e 's@^%@/@'` 224 | IFS=$oIFS 225 | 226 | pathcomp= 227 | 228 | while test $# -ne 0 ; do 229 | pathcomp=$pathcomp$1 230 | shift 231 | if test ! -d "$pathcomp"; then 232 | $mkdirprog "$pathcomp" || lasterr=$? 233 | # mkdir can fail with a `File exist' error in case several 234 | # install-sh are creating the directory concurrently. This 235 | # is OK. 236 | test ! -d "$pathcomp" && { (exit ${lasterr-1}); exit; } 237 | fi 238 | pathcomp=$pathcomp/ 239 | done 240 | fi 241 | 242 | if test -n "$dir_arg"; then 243 | $doit $instcmd "$dst" \ 244 | && { test -z "$chowncmd" || $doit $chowncmd "$dst"; } \ 245 | && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } \ 246 | && { test -z "$stripcmd" || $doit $stripcmd "$dst"; } \ 247 | && { test -z "$chmodcmd" || $doit $chmodcmd "$dst"; } 248 | 249 | else 250 | # If we're going to rename the final executable, determine the name now. 251 | if test -z "$transformarg"; then 252 | dstfile=`basename "$dst"` 253 | else 254 | dstfile=`basename "$dst" $transformbasename \ 255 | | sed $transformarg`$transformbasename 256 | fi 257 | 258 | # don't allow the sed command to completely eliminate the filename. 259 | test -z "$dstfile" && dstfile=`basename "$dst"` 260 | 261 | # Make a couple of temp file names in the proper directory. 262 | dsttmp=$dstdir/_inst.$$_ 263 | rmtmp=$dstdir/_rm.$$_ 264 | 265 | # Trap to clean up those temp files at exit. 266 | trap 'status=$?; rm -f "$dsttmp" "$rmtmp" && exit $status' 0 267 | trap '(exit $?); exit' 1 2 13 15 268 | 269 | # Move or copy the file name to the temp name 270 | $doit $instcmd "$src" "$dsttmp" && 271 | 272 | # and set any options; do chmod last to preserve setuid bits. 273 | # 274 | # If any of these fail, we abort the whole thing. If we want to 275 | # ignore errors from any of these, just make sure not to ignore 276 | # errors from the above "$doit $instcmd $src $dsttmp" command. 277 | # 278 | { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } \ 279 | && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } \ 280 | && { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } \ 281 | && { test -z "$chmodcmd" || $doit $chmodcmd "$dsttmp"; } && 282 | 283 | # Now rename the file to the real destination. 284 | { $doit $mvcmd -f "$dsttmp" "$dstdir/$dstfile" 2>/dev/null \ 285 | || { 286 | # The rename failed, perhaps because mv can't rename something else 287 | # to itself, or perhaps because mv is so ancient that it does not 288 | # support -f. 289 | 290 | # Now remove or move aside any old file at destination location. 291 | # We try this two ways since rm can't unlink itself on some 292 | # systems and the destination file might be busy for other 293 | # reasons. In this case, the final cleanup might fail but the new 294 | # file should still install successfully. 295 | { 296 | if test -f "$dstdir/$dstfile"; then 297 | $doit $rmcmd -f "$dstdir/$dstfile" 2>/dev/null \ 298 | || $doit $mvcmd -f "$dstdir/$dstfile" "$rmtmp" 2>/dev/null \ 299 | || { 300 | echo "$0: cannot unlink or rename $dstdir/$dstfile" >&2 301 | (exit 1); exit 302 | } 303 | else 304 | : 305 | fi 306 | } && 307 | 308 | # Now rename the file to the real destination. 309 | $doit $mvcmd "$dsttmp" "$dstdir/$dstfile" 310 | } 311 | } 312 | fi || { (exit 1); exit; } 313 | done 314 | 315 | # The final little trick to "correctly" pass the exit status to the exit trap. 316 | { 317 | (exit 0); exit 318 | } 319 | 320 | # Local variables: 321 | # eval: (add-hook 'write-file-hooks 'time-stamp) 322 | # time-stamp-start: "scriptversion=" 323 | # time-stamp-format: "%:y-%02m-%02d.%02H" 324 | # time-stamp-end: "$" 325 | # End: 326 | -------------------------------------------------------------------------------- /missing: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | # Common stub for a few missing GNU programs while installing. 3 | 4 | scriptversion=2003-09-02.23 5 | 6 | # Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003 7 | # Free Software Foundation, Inc. 8 | # Originally by Fran,cois Pinard , 1996. 9 | 10 | # This program is free software; you can redistribute it and/or modify 11 | # it under the terms of the GNU General Public License as published by 12 | # the Free Software Foundation; either version 2, or (at your option) 13 | # any later version. 14 | 15 | # This program is distributed in the hope that it will be useful, 16 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 17 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 | # GNU General Public License for more details. 19 | 20 | # You should have received a copy of the GNU General Public License 21 | # along with this program; if not, write to the Free Software 22 | # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 23 | # 02111-1307, USA. 24 | 25 | # As a special exception to the GNU General Public License, if you 26 | # distribute this file as part of a program that contains a 27 | # configuration script generated by Autoconf, you may include it under 28 | # the same distribution terms that you use for the rest of that program. 29 | 30 | if test $# -eq 0; then 31 | echo 1>&2 "Try \`$0 --help' for more information" 32 | exit 1 33 | fi 34 | 35 | run=: 36 | 37 | # In the cases where this matters, `missing' is being run in the 38 | # srcdir already. 39 | if test -f configure.ac; then 40 | configure_ac=configure.ac 41 | else 42 | configure_ac=configure.in 43 | fi 44 | 45 | msg="missing on your system" 46 | 47 | case "$1" in 48 | --run) 49 | # Try to run requested program, and just exit if it succeeds. 50 | run= 51 | shift 52 | "$@" && exit 0 53 | # Exit code 63 means version mismatch. This often happens 54 | # when the user try to use an ancient version of a tool on 55 | # a file that requires a minimum version. In this case we 56 | # we should proceed has if the program had been absent, or 57 | # if --run hadn't been passed. 58 | if test $? = 63; then 59 | run=: 60 | msg="probably too old" 61 | fi 62 | ;; 63 | esac 64 | 65 | # If it does not exist, or fails to run (possibly an outdated version), 66 | # try to emulate it. 67 | case "$1" in 68 | 69 | -h|--h|--he|--hel|--help) 70 | echo "\ 71 | $0 [OPTION]... PROGRAM [ARGUMENT]... 72 | 73 | Handle \`PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an 74 | error status if there is no known handling for PROGRAM. 75 | 76 | Options: 77 | -h, --help display this help and exit 78 | -v, --version output version information and exit 79 | --run try to run the given command, and emulate it if it fails 80 | 81 | Supported PROGRAM values: 82 | aclocal touch file \`aclocal.m4' 83 | autoconf touch file \`configure' 84 | autoheader touch file \`config.h.in' 85 | automake touch all \`Makefile.in' files 86 | bison create \`y.tab.[ch]', if possible, from existing .[ch] 87 | flex create \`lex.yy.c', if possible, from existing .c 88 | help2man touch the output file 89 | lex create \`lex.yy.c', if possible, from existing .c 90 | makeinfo touch the output file 91 | tar try tar, gnutar, gtar, then tar without non-portable flags 92 | yacc create \`y.tab.[ch]', if possible, from existing .[ch] 93 | 94 | Send bug reports to ." 95 | ;; 96 | 97 | -v|--v|--ve|--ver|--vers|--versi|--versio|--version) 98 | echo "missing $scriptversion (GNU Automake)" 99 | ;; 100 | 101 | -*) 102 | echo 1>&2 "$0: Unknown \`$1' option" 103 | echo 1>&2 "Try \`$0 --help' for more information" 104 | exit 1 105 | ;; 106 | 107 | aclocal*) 108 | if test -z "$run" && ($1 --version) > /dev/null 2>&1; then 109 | # We have it, but it failed. 110 | exit 1 111 | fi 112 | 113 | echo 1>&2 "\ 114 | WARNING: \`$1' is $msg. You should only need it if 115 | you modified \`acinclude.m4' or \`${configure_ac}'. You might want 116 | to install the \`Automake' and \`Perl' packages. Grab them from 117 | any GNU archive site." 118 | touch aclocal.m4 119 | ;; 120 | 121 | autoconf) 122 | if test -z "$run" && ($1 --version) > /dev/null 2>&1; then 123 | # We have it, but it failed. 124 | exit 1 125 | fi 126 | 127 | echo 1>&2 "\ 128 | WARNING: \`$1' is $msg. You should only need it if 129 | you modified \`${configure_ac}'. You might want to install the 130 | \`Autoconf' and \`GNU m4' packages. Grab them from any GNU 131 | archive site." 132 | touch configure 133 | ;; 134 | 135 | autoheader) 136 | if test -z "$run" && ($1 --version) > /dev/null 2>&1; then 137 | # We have it, but it failed. 138 | exit 1 139 | fi 140 | 141 | echo 1>&2 "\ 142 | WARNING: \`$1' is $msg. You should only need it if 143 | you modified \`acconfig.h' or \`${configure_ac}'. You might want 144 | to install the \`Autoconf' and \`GNU m4' packages. Grab them 145 | from any GNU archive site." 146 | files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' ${configure_ac}` 147 | test -z "$files" && files="config.h" 148 | touch_files= 149 | for f in $files; do 150 | case "$f" in 151 | *:*) touch_files="$touch_files "`echo "$f" | 152 | sed -e 's/^[^:]*://' -e 's/:.*//'`;; 153 | *) touch_files="$touch_files $f.in";; 154 | esac 155 | done 156 | touch $touch_files 157 | ;; 158 | 159 | automake*) 160 | if test -z "$run" && ($1 --version) > /dev/null 2>&1; then 161 | # We have it, but it failed. 162 | exit 1 163 | fi 164 | 165 | echo 1>&2 "\ 166 | WARNING: \`$1' is $msg. You should only need it if 167 | you modified \`Makefile.am', \`acinclude.m4' or \`${configure_ac}'. 168 | You might want to install the \`Automake' and \`Perl' packages. 169 | Grab them from any GNU archive site." 170 | find . -type f -name Makefile.am -print | 171 | sed 's/\.am$/.in/' | 172 | while read f; do touch "$f"; done 173 | ;; 174 | 175 | autom4te) 176 | if test -z "$run" && ($1 --version) > /dev/null 2>&1; then 177 | # We have it, but it failed. 178 | exit 1 179 | fi 180 | 181 | echo 1>&2 "\ 182 | WARNING: \`$1' is needed, but is $msg. 183 | You might have modified some files without having the 184 | proper tools for further handling them. 185 | You can get \`$1' as part of \`Autoconf' from any GNU 186 | archive site." 187 | 188 | file=`echo "$*" | sed -n 's/.*--output[ =]*\([^ ]*\).*/\1/p'` 189 | test -z "$file" && file=`echo "$*" | sed -n 's/.*-o[ ]*\([^ ]*\).*/\1/p'` 190 | if test -f "$file"; then 191 | touch $file 192 | else 193 | test -z "$file" || exec >$file 194 | echo "#! /bin/sh" 195 | echo "# Created by GNU Automake missing as a replacement of" 196 | echo "# $ $@" 197 | echo "exit 0" 198 | chmod +x $file 199 | exit 1 200 | fi 201 | ;; 202 | 203 | bison|yacc) 204 | echo 1>&2 "\ 205 | WARNING: \`$1' $msg. You should only need it if 206 | you modified a \`.y' file. You may need the \`Bison' package 207 | in order for those modifications to take effect. You can get 208 | \`Bison' from any GNU archive site." 209 | rm -f y.tab.c y.tab.h 210 | if [ $# -ne 1 ]; then 211 | eval LASTARG="\${$#}" 212 | case "$LASTARG" in 213 | *.y) 214 | SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'` 215 | if [ -f "$SRCFILE" ]; then 216 | cp "$SRCFILE" y.tab.c 217 | fi 218 | SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'` 219 | if [ -f "$SRCFILE" ]; then 220 | cp "$SRCFILE" y.tab.h 221 | fi 222 | ;; 223 | esac 224 | fi 225 | if [ ! -f y.tab.h ]; then 226 | echo >y.tab.h 227 | fi 228 | if [ ! -f y.tab.c ]; then 229 | echo 'main() { return 0; }' >y.tab.c 230 | fi 231 | ;; 232 | 233 | lex|flex) 234 | echo 1>&2 "\ 235 | WARNING: \`$1' is $msg. You should only need it if 236 | you modified a \`.l' file. You may need the \`Flex' package 237 | in order for those modifications to take effect. You can get 238 | \`Flex' from any GNU archive site." 239 | rm -f lex.yy.c 240 | if [ $# -ne 1 ]; then 241 | eval LASTARG="\${$#}" 242 | case "$LASTARG" in 243 | *.l) 244 | SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'` 245 | if [ -f "$SRCFILE" ]; then 246 | cp "$SRCFILE" lex.yy.c 247 | fi 248 | ;; 249 | esac 250 | fi 251 | if [ ! -f lex.yy.c ]; then 252 | echo 'main() { return 0; }' >lex.yy.c 253 | fi 254 | ;; 255 | 256 | help2man) 257 | if test -z "$run" && ($1 --version) > /dev/null 2>&1; then 258 | # We have it, but it failed. 259 | exit 1 260 | fi 261 | 262 | echo 1>&2 "\ 263 | WARNING: \`$1' is $msg. You should only need it if 264 | you modified a dependency of a manual page. You may need the 265 | \`Help2man' package in order for those modifications to take 266 | effect. You can get \`Help2man' from any GNU archive site." 267 | 268 | file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'` 269 | if test -z "$file"; then 270 | file=`echo "$*" | sed -n 's/.*--output=\([^ ]*\).*/\1/p'` 271 | fi 272 | if [ -f "$file" ]; then 273 | touch $file 274 | else 275 | test -z "$file" || exec >$file 276 | echo ".ab help2man is required to generate this page" 277 | exit 1 278 | fi 279 | ;; 280 | 281 | makeinfo) 282 | if test -z "$run" && (makeinfo --version) > /dev/null 2>&1; then 283 | # We have makeinfo, but it failed. 284 | exit 1 285 | fi 286 | 287 | echo 1>&2 "\ 288 | WARNING: \`$1' is $msg. You should only need it if 289 | you modified a \`.texi' or \`.texinfo' file, or any other file 290 | indirectly affecting the aspect of the manual. The spurious 291 | call might also be the consequence of using a buggy \`make' (AIX, 292 | DU, IRIX). You might want to install the \`Texinfo' package or 293 | the \`GNU make' package. Grab either from any GNU archive site." 294 | file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'` 295 | if test -z "$file"; then 296 | file=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'` 297 | file=`sed -n '/^@setfilename/ { s/.* \([^ ]*\) *$/\1/; p; q; }' $file` 298 | fi 299 | touch $file 300 | ;; 301 | 302 | tar) 303 | shift 304 | if test -n "$run"; then 305 | echo 1>&2 "ERROR: \`tar' requires --run" 306 | exit 1 307 | fi 308 | 309 | # We have already tried tar in the generic part. 310 | # Look for gnutar/gtar before invocation to avoid ugly error 311 | # messages. 312 | if (gnutar --version > /dev/null 2>&1); then 313 | gnutar "$@" && exit 0 314 | fi 315 | if (gtar --version > /dev/null 2>&1); then 316 | gtar "$@" && exit 0 317 | fi 318 | firstarg="$1" 319 | if shift; then 320 | case "$firstarg" in 321 | *o*) 322 | firstarg=`echo "$firstarg" | sed s/o//` 323 | tar "$firstarg" "$@" && exit 0 324 | ;; 325 | esac 326 | case "$firstarg" in 327 | *h*) 328 | firstarg=`echo "$firstarg" | sed s/h//` 329 | tar "$firstarg" "$@" && exit 0 330 | ;; 331 | esac 332 | fi 333 | 334 | echo 1>&2 "\ 335 | WARNING: I can't seem to be able to run \`tar' with the given arguments. 336 | You may want to install GNU tar or Free paxutils, or check the 337 | command line arguments." 338 | exit 1 339 | ;; 340 | 341 | *) 342 | echo 1>&2 "\ 343 | WARNING: \`$1' is needed, and is $msg. 344 | You might have modified some files without having the 345 | proper tools for further handling them. Check the \`README' file, 346 | it often tells you about the needed prerequisites for installing 347 | this package. You may also peek at any GNU archive site, in case 348 | some other package would contain this missing \`$1' program." 349 | exit 1 350 | ;; 351 | esac 352 | 353 | exit 0 354 | 355 | # Local variables: 356 | # eval: (add-hook 'write-file-hooks 'time-stamp) 357 | # time-stamp-start: "scriptversion=" 358 | # time-stamp-format: "%:y-%02m-%02d.%02H" 359 | # time-stamp-end: "$" 360 | # End: 361 | -------------------------------------------------------------------------------- /mkinstalldirs: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | # mkinstalldirs --- make directory hierarchy 3 | # Author: Noah Friedman 4 | # Created: 1993-05-16 5 | # Public domain 6 | 7 | errstatus=0 8 | dirmode="" 9 | 10 | usage="\ 11 | Usage: mkinstalldirs [-h] [--help] [-m mode] dir ..." 12 | 13 | # process command line arguments 14 | while test $# -gt 0 ; do 15 | case $1 in 16 | -h | --help | --h*) # -h for help 17 | echo "$usage" 1>&2 18 | exit 0 19 | ;; 20 | -m) # -m PERM arg 21 | shift 22 | test $# -eq 0 && { echo "$usage" 1>&2; exit 1; } 23 | dirmode=$1 24 | shift 25 | ;; 26 | --) # stop option processing 27 | shift 28 | break 29 | ;; 30 | -*) # unknown option 31 | echo "$usage" 1>&2 32 | exit 1 33 | ;; 34 | *) # first non-opt arg 35 | break 36 | ;; 37 | esac 38 | done 39 | 40 | for file 41 | do 42 | if test -d "$file"; then 43 | shift 44 | else 45 | break 46 | fi 47 | done 48 | 49 | case $# in 50 | 0) exit 0 ;; 51 | esac 52 | 53 | case $dirmode in 54 | '') 55 | if mkdir -p -- . 2>/dev/null; then 56 | echo "mkdir -p -- $*" 57 | exec mkdir -p -- "$@" 58 | fi 59 | ;; 60 | *) 61 | if mkdir -m "$dirmode" -p -- . 2>/dev/null; then 62 | echo "mkdir -m $dirmode -p -- $*" 63 | exec mkdir -m "$dirmode" -p -- "$@" 64 | fi 65 | ;; 66 | esac 67 | 68 | for file 69 | do 70 | set fnord `echo ":$file" | sed -ne 's/^:\//#/;s/^://;s/\// /g;s/^#/\//;p'` 71 | shift 72 | 73 | pathcomp= 74 | for d 75 | do 76 | pathcomp="$pathcomp$d" 77 | case $pathcomp in 78 | -*) pathcomp=./$pathcomp ;; 79 | esac 80 | 81 | if test ! -d "$pathcomp"; then 82 | echo "mkdir $pathcomp" 83 | 84 | mkdir "$pathcomp" || lasterr=$? 85 | 86 | if test ! -d "$pathcomp"; then 87 | errstatus=$lasterr 88 | else 89 | if test ! -z "$dirmode"; then 90 | echo "chmod $dirmode $pathcomp" 91 | lasterr="" 92 | chmod "$dirmode" "$pathcomp" || lasterr=$? 93 | 94 | if test ! -z "$lasterr"; then 95 | errstatus=$lasterr 96 | fi 97 | fi 98 | fi 99 | fi 100 | 101 | pathcomp="$pathcomp/" 102 | done 103 | done 104 | 105 | exit $errstatus 106 | 107 | # Local Variables: 108 | # mode: shell-script 109 | # sh-indentation: 2 110 | # End: 111 | # mkinstalldirs ends here 112 | -------------------------------------------------------------------------------- /rtf2html.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lvu/rtf2html/d343dddd63e2921e976f9210e58239fa2ca13848/rtf2html.cpp -------------------------------------------------------------------------------- /rtf_keyword.cpp: -------------------------------------------------------------------------------- 1 | #include "rtf_keyword.h" 2 | rtf_keyword::keyword_map::keyword_map() : base_class() 3 | { 4 | insert(value_type("b", rkw_b)); 5 | insert(value_type("bin", rkw_bin)); 6 | insert(value_type("blue", rkw_blue)); 7 | insert(value_type("brdrnone", rkw_brdrnone)); 8 | insert(value_type("bullet", rkw_bullet)); 9 | insert(value_type("caps", rkw_caps)); 10 | insert(value_type("cb", rkw_cb)); 11 | insert(value_type("cell", rkw_cell)); 12 | insert(value_type("cellx", rkw_cellx)); 13 | insert(value_type("cf", rkw_cf)); 14 | insert(value_type("clbrdrb", rkw_clbrdrb)); 15 | insert(value_type("clbrdrl", rkw_clbrdrl)); 16 | insert(value_type("clbrdrr", rkw_clbrdrr)); 17 | insert(value_type("clbrdrt", rkw_clbrdrt)); 18 | insert(value_type("clvertalb", rkw_clvertalb)); 19 | insert(value_type("clvertalc", rkw_clvertalc)); 20 | insert(value_type("clvertalt", rkw_clvertalt)); 21 | insert(value_type("clvmgf", rkw_clvmgf)); 22 | insert(value_type("clvmrg", rkw_clvmrg)); 23 | insert(value_type("colortbl", rkw_colortbl)); 24 | insert(value_type("dn", rkw_dn)); 25 | insert(value_type("emdash", rkw_emdash)); 26 | insert(value_type("emspace", rkw_emspace)); 27 | insert(value_type("endash", rkw_endash)); 28 | insert(value_type("enspace", rkw_enspace)); 29 | insert(value_type("f", rkw_f)); 30 | insert(value_type("fprq", rkw_fprq)); 31 | insert(value_type("fcharset", rkw_fcharset)); 32 | insert(value_type("fnil", rkw_fnil)); 33 | insert(value_type("froman", rkw_froman)); 34 | insert(value_type("fswiss", rkw_fswiss)); 35 | insert(value_type("fmodern", rkw_fmodern)); 36 | insert(value_type("fscript", rkw_fscript)); 37 | insert(value_type("fdecor", rkw_fdecor)); 38 | insert(value_type("ftech", rkw_ftech)); 39 | insert(value_type("fbidi", rkw_fbidi)); 40 | insert(value_type("field", rkw_field)); 41 | insert(value_type("filetbl", rkw_filetbl)); 42 | insert(value_type("fldrslt", rkw_fldrslt)); 43 | insert(value_type("fonttbl", rkw_fonttbl)); 44 | insert(value_type("footer", rkw_footer)); 45 | insert(value_type("footerf", rkw_footerf)); 46 | insert(value_type("fs", rkw_fs)); 47 | insert(value_type("green", rkw_green)); 48 | insert(value_type("header", rkw_header)); 49 | insert(value_type("headerf", rkw_headerf)); 50 | insert(value_type("highlight", rkw_highlight)); 51 | insert(value_type("i", rkw_i)); 52 | insert(value_type("info", rkw_info)); 53 | insert(value_type("intbl", rkw_intbl)); 54 | insert(value_type("ldblquote", rkw_ldblquote)); 55 | insert(value_type("li", rkw_li)); 56 | insert(value_type("line", rkw_line)); 57 | insert(value_type("lquote", rkw_lquote)); 58 | insert(value_type("margl", rkw_margl)); 59 | insert(value_type("object", rkw_object)); 60 | insert(value_type("paperw", rkw_paperw)); 61 | insert(value_type("par", rkw_par)); 62 | insert(value_type("pard", rkw_pard)); 63 | insert(value_type("pict", rkw_pict)); 64 | insert(value_type("plain", rkw_plain)); 65 | insert(value_type("qc", rkw_qc)); 66 | insert(value_type("qj", rkw_qj)); 67 | insert(value_type("ql", rkw_ql)); 68 | insert(value_type("qr", rkw_qr)); 69 | insert(value_type("rdblquote", rkw_rdblquote)); 70 | insert(value_type("red", rkw_red)); 71 | insert(value_type("ri", rkw_ri)); 72 | insert(value_type("row", rkw_row)); 73 | insert(value_type("rquote", rkw_rquote)); 74 | insert(value_type("sa", rkw_sa)); 75 | insert(value_type("sb", rkw_sb)); 76 | insert(value_type("sect", rkw_sect)); 77 | insert(value_type("softline", rkw_softline)); 78 | insert(value_type("stylesheet", rkw_stylesheet)); 79 | insert(value_type("sub", rkw_sub)); 80 | insert(value_type("super", rkw_super)); 81 | insert(value_type("tab", rkw_tab)); 82 | insert(value_type("title", rkw_title)); 83 | insert(value_type("trleft", rkw_trleft)); 84 | insert(value_type("trowd", rkw_trowd)); 85 | insert(value_type("trrh", rkw_trrh)); 86 | insert(value_type("ul", rkw_ul)); 87 | insert(value_type("ulnone", rkw_ulnone)); 88 | insert(value_type("up", rkw_up)); 89 | insert(value_type("u", rkw_unicode)); 90 | } 91 | 92 | rtf_keyword::keyword_map rtf_keyword::keymap; 93 | -------------------------------------------------------------------------------- /rtf_keyword.h: -------------------------------------------------------------------------------- 1 | #ifndef __RTF_KEYWORD_H__ 2 | #define __RTF_KEYWORD_H__ 3 | 4 | #include "config.h" 5 | #include 6 | #include 7 | #include 8 | #include 9 | 10 | class rtf_keyword{ 11 | public: 12 | enum keyword_type {rkw_unknown, 13 | rkw_b, rkw_bin, rkw_blue, rkw_brdrnone, rkw_bullet, 14 | rkw_caps, rkw_cb, rkw_cell, rkw_cellx, rkw_cf, rkw_clbrdrb, rkw_clbrdrl, 15 | rkw_clbrdrr, rkw_clbrdrt, rkw_clvertalb, rkw_clvertalc, 16 | rkw_clvertalt, rkw_clvmgf, rkw_clvmrg, rkw_colortbl, 17 | rkw_dn, 18 | rkw_emdash, rkw_emspace, rkw_endash, rkw_enspace, 19 | rkw_fi, rkw_field, rkw_filetbl, 20 | rkw_f, rkw_fprq, rkw_fcharset, 21 | rkw_fnil, rkw_froman, rkw_fswiss, rkw_fmodern, 22 | rkw_fscript, rkw_fdecor, rkw_ftech, rkw_fbidi, 23 | rkw_fldrslt, rkw_fonttbl, rkw_footer, rkw_footerf, rkw_fs, 24 | rkw_green, 25 | rkw_header, rkw_headerf, rkw_highlight, 26 | rkw_i, rkw_info, rkw_intbl, 27 | rkw_ldblquote, rkw_li, rkw_line, rkw_lquote, 28 | rkw_margl, 29 | rkw_object, 30 | rkw_paperw, rkw_par, rkw_pard, rkw_pict, rkw_plain, 31 | rkw_qc, rkw_qj, rkw_ql, rkw_qmspace, rkw_qr, 32 | rkw_rdblquote, rkw_red, rkw_ri, rkw_row, rkw_rquote, 33 | rkw_sa, rkw_sb, rkw_sect, rkw_softline, rkw_stylesheet, 34 | rkw_sub, rkw_super, 35 | rkw_tab, rkw_title, rkw_trleft, rkw_trowd, rkw_trrh, 36 | rkw_ul, rkw_ulnone, rkw_up, rkw_unicode 37 | }; 38 | private: 39 | class keyword_map : public std::map 40 | { 41 | private: 42 | typedef std::map base_class; 43 | public: 44 | keyword_map(); 45 | }; 46 | private: 47 | static keyword_map keymap; 48 | std::string s_keyword; 49 | keyword_type e_keyword; 50 | int param; 51 | char ctrl_chr; 52 | bool is_ctrl_chr; 53 | public: 54 | // iter must point after the backslash starting the keyword. We don't check it. 55 | // after construction, iter points at the char following the keyword 56 | template explicit rtf_keyword(InputIter &iter); 57 | bool is_control_char() const 58 | { return is_ctrl_chr; } 59 | const std::string &keyword_str() const 60 | { return s_keyword; } 61 | keyword_type keyword() const 62 | { return e_keyword; } 63 | int parameter() const 64 | { return param; } 65 | char control_char() const 66 | { return ctrl_chr; } 67 | }; 68 | 69 | template 70 | rtf_keyword::rtf_keyword(InputIter &iter) 71 | { 72 | char curchar=*iter; 73 | is_ctrl_chr=!isalpha(curchar); 74 | 75 | if (is_ctrl_chr) 76 | { 77 | ctrl_chr=curchar; 78 | ++iter; 79 | } 80 | else 81 | { 82 | do 83 | s_keyword+=curchar; 84 | while (isalpha(curchar=*++iter)); 85 | std::string param_str; 86 | while (isdigit(curchar)||curchar=='-') 87 | { 88 | param_str+=curchar; 89 | curchar=*++iter; 90 | } 91 | if (param_str.empty()) 92 | param=-1; 93 | else 94 | param=std::atoi(param_str.c_str()); 95 | if (curchar==' ') 96 | ++iter; 97 | keyword_map::iterator kw_pos=keymap.find(s_keyword); 98 | if (kw_pos==keymap.end()) 99 | e_keyword=rkw_unknown; 100 | else 101 | e_keyword=kw_pos->second; 102 | } 103 | } 104 | 105 | #endif 106 | -------------------------------------------------------------------------------- /rtf_table.cpp: -------------------------------------------------------------------------------- 1 | #include "rtf_table.h" 2 | #include 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include 8 | 9 | typedef std::set intset; 10 | 11 | template 12 | std::basic_ostream& operator<<(std::basic_ostream &dest, std::set &s) 13 | { 14 | for (typename std::set::iterator i=s.begin(); i!=s.end(); ++i) 15 | dest<<*i<<" "; 16 | return dest; 17 | } 18 | 19 | std::string table::make() 20 | { 21 | std::string result; 22 | intset pts; 23 | iterator row, span_row, row2; 24 | table_cell_defs::iterator cell_def, prev_cell_def, cell_def_2; 25 | table_cells::iterator cell; 26 | intset::iterator pt, ptp; 27 | int left, right, colspan; 28 | bool btop, bbottom, bleft, bright; 29 | std::string style; 30 | for (row=begin(); row!=end();) 31 | { 32 | if ((*row)->Cells.empty()) 33 | { 34 | delete *row; 35 | row=erase(row); 36 | } 37 | else 38 | { 39 | pts.insert((*row)->Left); 40 | for (cell_def=(*row)->CellDefs->begin(); cell_def!=(*row)->CellDefs->end(); ++cell_def) 41 | { 42 | pts.insert((*cell_def)->Right); 43 | } 44 | ++row; 45 | } 46 | } 47 | if (pts.empty()) 48 | { 49 | throw std::logic_error("No CellDefs!"); 50 | } 51 | pt=pts.begin(); 52 | ptp=pts.end(); 53 | ptp--; 54 | result=""; 59 | result+=""; 60 | for (ptp=pt++=pts.begin(); pt!=pts.end(); ptp=pt++) 61 | { 62 | result+=""; 65 | //coefficient may be different 66 | } 67 | result+="\n"; 68 | 69 | // first, we'll determine all the rowspans and leftsides 70 | for (row=begin(); row!=end(); ++row) 71 | { 72 | if ((*row)->CellDefs->size()!=(*row)->Cells.size()) 73 | throw std::logic_error("Number of Cells and number of CellDefs are unequal!"); 74 | for (cell_def=(*row)->CellDefs->begin(), cell=(*row)->Cells.begin(); 75 | cell!=(*row)->Cells.end(); 76 | ++cell, prev_cell_def=cell_def++ 77 | ) 78 | { 79 | if (cell_def==(*row)->CellDefs->begin()) 80 | (*cell_def)->Left=(*row)->Left; 81 | else 82 | (*cell_def)->Left=(*prev_cell_def)->Right; 83 | if ((*cell_def)->FirstMerged) 84 | { 85 | for (span_row=row, ++span_row; span_row!=end(); 86 | ++span_row) 87 | { 88 | cell_def_2= 89 | std::find_if((*span_row)->CellDefs->begin(), 90 | (*span_row)->CellDefs->end(), 91 | std::bind2nd( 92 | std::mem_fun(&table_cell_def::right_equals), 93 | (*cell_def)->Right)); 94 | if (cell_def_2==(*span_row)->CellDefs->end()) 95 | break; 96 | if (!(*cell_def_2)->Merged) 97 | break; 98 | } 99 | (*cell)->Rowspan=span_row-row; 100 | } 101 | } 102 | } 103 | 104 | for (row=begin(); row!=end(); ++row) 105 | { 106 | result+=""; 107 | pt=pts.find((*row)->Left); 108 | if (pt==pts.end()) 109 | throw std::logic_error("No row.left point!"); 110 | if (pt!=pts.begin()) 111 | { 112 | result+=""; 115 | } 116 | for (cell_def=(*row)->CellDefs->begin(), cell=(*row)->Cells.begin(); 117 | cell!=(*row)->Cells.end(); ++cell, ++cell_def) 118 | { 119 | ptp=pts.find((*cell_def)->Right); 120 | if (ptp==pts.end()) 121 | throw std::logic_error("No celldef.right point!"); 122 | colspan=std::distance(pt, ptp); 123 | pt=ptp; 124 | if (!(*cell_def)->Merged) 125 | { 126 | result+="Left; 129 | right=(*cell_def)->Right; 130 | bbottom=(*cell_def)->BorderBottom; 131 | btop=(*cell_def)->BorderTop; 132 | bleft=(*cell_def)->BorderLeft; 133 | bright=(*cell_def)->BorderRight; 134 | span_row=row; 135 | if ((*cell_def)->FirstMerged) 136 | std::advance(span_row, (*cell)->Rowspan-1); 137 | for (row2=row; row2!=span_row; ++row2) 138 | { 139 | cell_def_2= 140 | std::find_if((*row2)->CellDefs->begin(), 141 | (*row2)->CellDefs->end(), 142 | std::bind2nd( 143 | std::mem_fun(&table_cell_def::right_equals), 144 | left)); 145 | if (cell_def_2!=(*row2)->CellDefs->end()) 146 | { 147 | bleft=bleft && (*cell_def_2)->BorderRight; 148 | } 149 | cell_def_2= 150 | std::find_if((*row2)->CellDefs->begin(), 151 | (*row2)->CellDefs->end(), 152 | std::bind2nd( 153 | std::mem_fun(&table_cell_def::left_equals), 154 | right)); 155 | if (cell_def_2!=(*row2)->CellDefs->end()) 156 | { 157 | bright=bright && (*cell_def_2)->BorderLeft; 158 | } 159 | } 160 | 161 | if (bbottom && btop && bleft && bright) 162 | { 163 | style="border:1px solid black;"; 164 | } 165 | else 166 | { 167 | style=""; 168 | if (bbottom) 169 | style+="border-bottom:1px solid black;"; 170 | if (btop) 171 | style+="border-top:1px solid black;"; 172 | if (bleft) 173 | style+="border-left:1px solid black;"; 174 | if (bright) 175 | style+="border-right:1px solid black;"; 176 | } 177 | if (!style.empty()) 178 | { 179 | result+=" style=\""; 180 | result+=style; 181 | result+="\""; 182 | } 183 | if (colspan>1) 184 | { 185 | result+=" colspan="; 186 | result+=from_int(colspan); 187 | } 188 | if ((*cell_def)->FirstMerged) 189 | { 190 | result+=" rowspan="; 191 | result+=from_int((*cell)->Rowspan); 192 | } 193 | 194 | switch ((*cell_def)->VAlign) 195 | { 196 | case table_cell_def::valign_top: 197 | result+=" valign=top"; 198 | break; 199 | case table_cell_def::valign_bottom: 200 | result+=" valign=bottom"; 201 | break; 202 | } 203 | 204 | result+=">"; 205 | if ((*cell)->Text[0]>0) 206 | result+=(*cell)->Text; 207 | else 208 | result+=" "; 209 | result+=""; 210 | } 211 | } 212 | result+=""; 213 | } 214 | result+="
"; 215 | return result; 216 | } 217 | -------------------------------------------------------------------------------- /rtf_table.h: -------------------------------------------------------------------------------- 1 | #ifndef __RTF_H__ 2 | #define __RTF_H__ 3 | 4 | #include "config.h" 5 | #if defined(_STLP_DEBUG) && defined (__BORLANDC__) 6 | #include // Just to make debug version of STLPort work under BC 7 | #endif 8 | #include "common.h" 9 | #include 10 | #include 11 | #include 12 | #include 13 | 14 | struct table_cell 15 | { 16 | int Rowspan; 17 | std::string Text; 18 | table_cell() : Rowspan(0) {} 19 | }; 20 | 21 | struct table_cell_def 22 | { 23 | enum valign {valign_top, valign_bottom, valign_center}; 24 | bool BorderTop, BorderBottom, BorderLeft, BorderRight; 25 | bool *ActiveBorder; 26 | int Right, Left; 27 | bool Merged, FirstMerged; 28 | valign VAlign; 29 | table_cell_def() 30 | { 31 | BorderTop=BorderBottom=BorderLeft=BorderRight=Merged=FirstMerged=false; 32 | ActiveBorder=NULL; 33 | Right=Left=0; 34 | VAlign=valign_top; 35 | } 36 | bool right_equals(int x) { return x==Right; } 37 | bool left_equals(int x) { return x==Left; } 38 | }; 39 | 40 | template 41 | class killing_ptr_vector : public std::vector 42 | { 43 | public: 44 | ~killing_ptr_vector() 45 | { 46 | for (typename killing_ptr_vector::iterator i=this->begin(); i!=this->end(); ++i) 47 | delete *i; 48 | } 49 | }; 50 | 51 | typedef killing_ptr_vector table_cells; 52 | typedef killing_ptr_vector table_cell_defs; 53 | 54 | typedef std::list table_cell_defs_list; 55 | 56 | struct table_row 57 | { 58 | table_cells Cells; 59 | table_cell_defs_list::iterator CellDefs; 60 | int Height; 61 | int Left; 62 | table_row() : Height(-1000), Left(-1000) {} 63 | }; 64 | 65 | class table : public killing_ptr_vector 66 | { 67 | private: 68 | typedef killing_ptr_vector base_class; 69 | public: 70 | table() : base_class() {} 71 | std::string make(); 72 | }; 73 | 74 | #endif 75 | -------------------------------------------------------------------------------- /rtf_tools.h: -------------------------------------------------------------------------------- 1 | #ifndef __RTF_TOOLS_H__ 2 | #define __RTF_TOOLS_H__ 3 | 4 | #include "config.h" 5 | #include "common.h" 6 | #include "rtf_keyword.h" 7 | 8 | template 9 | void skip_group(InputIter &iter); 10 | 11 | template 12 | std::string char_by_code(InputIter &iter); 13 | 14 | 15 | /**************************************** 16 | function assumes that file pointer points AFTER the opening brace 17 | and that the group is really closed. cs is caller's curchar. 18 | Returns the character that comes after the enclosing brace. 19 | *****************************************/ 20 | 21 | template 22 | void skip_group(InputIter &iter) 23 | { 24 | int cnt=1; 25 | while (cnt) 26 | { 27 | switch (*iter++) 28 | { 29 | case '{': 30 | cnt++; 31 | break; 32 | case '}': 33 | cnt--; 34 | break; 35 | case '\\': 36 | { 37 | rtf_keyword kw(iter); 38 | if (!kw.is_control_char() && kw.keyword()==rtf_keyword::rkw_bin 39 | && kw.parameter()>0) 40 | { 41 | std::advance(iter, kw.parameter()); 42 | } 43 | break; 44 | } 45 | } 46 | } 47 | } 48 | 49 | template 50 | std::string char_by_code(InputIter &iter) 51 | { 52 | std::string stmp(1, *iter++); 53 | stmp += *iter++; 54 | int code = std::strtol(stmp.c_str(), NULL, 16); 55 | switch (code) 56 | { 57 | case 0x3f: 58 | return std::string(); 59 | case 147: 60 | return "“"; 61 | case 148: 62 | return "”"; 63 | case 167: 64 | return "§"; 65 | case 188: 66 | return "¼"; 67 | default: 68 | return std::string(1, (char)code); //(std::string("&#") + from_int(code) + ";"); 69 | } 70 | } 71 | 72 | #endif 73 | -------------------------------------------------------------------------------- /stlport.m4: -------------------------------------------------------------------------------- 1 | # AC_LIB_STLPORT - implement the --with-stlport / --with-stlport-headers= 2 | # and --with-stlport-libs= flags 3 | # Usage: AC_LIB_STLPORT[(DEFAULT)] 4 | # Where DEFAULT is either `yes' or `no'. If omitted, it defaults to 5 | # `yes'. 6 | # 7 | # If all tests succeed, CPPFLAGS will be *prepended* with 8 | # -nostdinc++ -I 9 | # and LIBS will be appended with 10 | # -l 11 | # 12 | # directory defaults to /usr/include/stlport, but can be overridden with the 13 | # --with-stlport-headers directive; 14 | # library defaults to stlport, and can be overridden with the 15 | # --with-stlport-libs directive 16 | # 17 | # $Id: stlport.m4,v 1.4 2007-07-31 15:39:42 vlavrinenko Exp $ 18 | # 19 | # This file is (c) 2001 Jasper Spaans, 20 | # Please send your comments, suggestions and bugfixes to the above 21 | # e-mail address. 22 | # 23 | # This program is free software; you can redistribute it and/or modify it 24 | # under the terms of the GNU Lesser General Public License as published by 25 | # the Free Software Foundation; either version 2 of the License, or (at 26 | # your option) any later version. 27 | # 28 | # This program is distributed in the hope that it will be useful, but 29 | # WITHOUT ANY WARRANTY; without even the implied warranty of 30 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser 31 | # General Public License for more details. 32 | # 33 | # You should have received a copy of the GNU Lesser General Public License 34 | # along with this program; if not, write to the Free Software Foundation, 35 | # Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 36 | 37 | AC_DEFUN([AC_LIB_STLPORT], 38 | [define([AC_LIB_STLPORT_DEFAULT], ifelse($1, no, no, yes))dnl 39 | AC_MSG_CHECKING(whether to use stlport libraries) 40 | AC_ARG_WITH(stlport, AC_HELP_STRING(--with-stlport,use sgi stlport headers and libraries), 41 | [ if test "x$withval" = xno ; then 42 | ac_stlport_use="no" 43 | fi], 44 | ac_stlport_use=AC_LIB_STLPORT_DEFAULT) 45 | AC_ARG_WITH(stlport-headers, AC_HELP_STRING(--with-stlport-headers,where to find stlport headers), 46 | [ if test "x$withval" = xno ; then 47 | ac_stlport_use="no" 48 | else 49 | ac_stlport_headers="$with_stlport_headers" 50 | fi], 51 | [ 52 | ac_stlport_headers="/usr/include/stlport" 53 | ]) 54 | AC_ARG_WITH(stlport-libs, AC_HELP_STRING(--with-stlport-libs, where to find stlport libraries), 55 | [ if test "x$withval" = xno ; then 56 | ac_stlport_use="no" 57 | else 58 | ac_stlport_libs="$with_stlport_libs" 59 | fi], 60 | [ 61 | ac_stlport_libs="stlport" 62 | ]) 63 | 64 | if test "$ac_stlport_use" = no ; then 65 | AC_MSG_RESULT(no) 66 | else 67 | AC_MSG_RESULT(yes) 68 | AC_MSG_CHECKING(where to find stlport headers) 69 | ac_stlport_save_CPPFLAGS="$CPPFLAGS" 70 | ac_stlport_save_LIBS="$LIBS" 71 | CPPFLAGS="-I$ac_stlport_headers $CPPFLAGS" 72 | LIBS="-l$ac_stlport_libs $LIBS" 73 | if test "$MSYSTEM" = "MINGW32"; then 74 | CPPFLAGS="$CPPFLAGS -mthreads" 75 | fi 76 | AC_LANG_PUSH(C++) 77 | AC_TRY_COMPILE([#include ],, 78 | 79 | AC_MSG_RESULT($ac_stlport_headers) 80 | AC_MSG_CHECKING(where to find stlport libraries) 81 | AC_TRY_RUN([#include 82 | #include 83 | int 84 | main() 85 | { 86 | std::cout << "" << std::ends; 87 | return(0); 88 | } 89 | ], 90 | AC_SUBST(CPPFLAGS) 91 | AC_SUBST(LIBS) 92 | AC_MSG_RESULT($ac_stlport_libs), 93 | AC_MSG_ERROR(failed)), 94 | AC_MSG_ERROR(failed)) 95 | fi 96 | ]) 97 | --------------------------------------------------------------------------------