Permalink
Browse files

wx-config-win version suitable for Windows users building for wxWidge…

…ts 2.9.

Ignore-this: 153eb358c7244b0bf4469e32840be20f

The attached wx-confg-win directory is forked from http://wx-config-win.googlecode.com
and represents a substantially simplified implementation of the wx-config script.

Compared to the version at Google Code, this is modified as follows:
- Support wxWidgets 2.9 (by far the major change)
- Support build on Visual Studio as well as GCC

Note that he changes have *only* been tested for wxWidgets compiled with MinGW
compiler, and almost certainly will not work for wxWidgets compiled with other
compilers.

Note that wx-config.cpp can be successfully compiled using a MinGW compiler
with the following command line:

g++ wx-config.cpp -o wx-config.exe

For the convenience of those who do not have a working MinGW or Visual Studio
installation, I have included a pre-compiled and linked wx-config.exe which
will work if you place it in your path.

Note that this is a temporary work-around until I can find a way to cabal install
wx-config-win. Currently I find that ghc wx-config.cpp -lstdc++ compiles and
links, but is no use as it dynamically links libstdc++.dll, and this is not
in the path when time comes to run wx-config.§

darcs-hash:20120413121421-75908-5975dfefff34666f07a308bf4f23cd60c4ec688f.gz
  • Loading branch information...
1 parent b1c388c commit 3be193e5cc9254616aca596cc6066c0e773466f5 @jodonoghue committed Apr 13, 2012
View
573 wx-config-win/LICENSE
@@ -0,0 +1,573 @@
+----------------------------------------------------------------------
+ PREAMBLE
+
+The wxHaskell libraries are distributed under the wxWindows library
+license. The documentation is subject to the wxWidgets documentation
+license.
+
+See "http://www.wxwidgets.org/newlicen.htm" for the legal description
+of the license, which is also included in this document.
+
+The wxWindows library licence is essentially the L-GPL (Library General
+Public Licence), with an exception stating that derived works in binary
+form may be distributed on the user's own terms. This means that it is
+possible to create commercial software with this library without paying
+royalties or disclosing source code. This is a solution that satisfies
+those who wish to produce GPL'ed software using wxHaskell, and also
+those producing proprietary software.
+
+This library is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the wxWidgets
+library license for more details.
+
+
+----------------------------------------------------------------------
+ WXWINDOWS LIBRARY LICENCE
+ TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+ This library is free software; you can redistribute it and/or modify it
+ under the terms of the GNU Library General Public Licence as published by
+ the Free Software Foundation; either version 2 of the Licence, or (at
+ your option) any later version.
+
+ This library is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library
+ General Public Licence for more details.
+
+ You should have received a copy of the GNU Library General Public Licence
+ along with this software, usually in a file named COPYING.LIB. If not,
+ write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330,
+ Boston, MA 02111-1307 USA.
+
+ EXCEPTION NOTICE
+
+ 1. As a special exception, the copyright holders of this library give
+ permission for additional uses of the text contained in this release of
+ the library as licenced under the wxWindows Library Licence, applying
+ either version 3 of the Licence, or (at your option) any later version of
+ the Licence as published by the copyright holders of version 3 of the
+ Licence document.
+
+ 2. The exception is that you may use, copy, link, modify and distribute
+ under the user's own terms, binary object code versions of works based
+ on the Library.
+
+ 3. If you copy code from files distributed under the terms of the GNU
+ General Public Licence or the GNU Library General Public Licence into a
+ copy of this library, as this licence permits, the exception does not
+ apply to the code that you add in this way. To avoid misleading anyone as
+ to the status of such modified files, you must delete this exception
+ notice from such code and/or adjust the licensing conditions notice
+ accordingly.
+
+ 4. If you write modifications of your own for this library, it is your
+ choice whether to permit this exception to apply to your modifications.
+ If you do not wish that, you must delete the exception notice from such
+ code and/or adjust the licensing conditions notice accordingly.
+
+
+----------------------------------------------------------------------
+ GNU LESSER GENERAL PUBLIC LICENSE
+ Version 2.1, February 1999
+
+ Copyright (C) 1991, 1999 Free Software Foundation, Inc.
+ 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+[This is the first released version of the Lesser GPL. It also counts
+ as the successor of the GNU Library Public License, version 2, hence
+ the version number 2.1.]
+
+ Preamble
+
+ The licenses for most software are designed to take away your
+freedom to share and change it. By contrast, the GNU General Public
+Licenses are intended to guarantee your freedom to share and change
+free software--to make sure the software is free for all its users.
+
+ This license, the Lesser General Public License, applies to some
+specially designated software packages--typically libraries--of the
+Free Software Foundation and other authors who decide to use it. You
+can use it too, but we suggest you first think carefully about whether
+this license or the ordinary General Public License is the better
+strategy to use in any particular case, based on the explanations below.
+
+ When we speak of free software, we are referring to freedom of use,
+not price. Our General Public Licenses are designed to make sure that
+you have the freedom to distribute copies of free software (and charge
+for this service if you wish); that you receive source code or can get
+it if you want it; that you can change the software and use pieces of
+it in new free programs; and that you are informed that you can do
+these things.
+
+ To protect your rights, we need to make restrictions that forbid
+distributors to deny you these rights or to ask you to surrender these
+rights. These restrictions translate to certain responsibilities for
+you if you distribute copies of the library or if you modify it.
+
+ For example, if you distribute copies of the library, whether gratis
+or for a fee, you must give the recipients all the rights that we gave
+you. You must make sure that they, too, receive or can get the source
+code. If you link other code with the library, you must provide
+complete object files to the recipients, so that they can relink them
+with the library after making changes to the library and recompiling
+it. And you must show them these terms so they know their rights.
+
+ We protect your rights with a two-step method: (1) we copyright the
+library, and (2) we offer you this license, which gives you legal
+permission to copy, distribute and/or modify the library.
+
+ To protect each distributor, we want to make it very clear that
+there is no warranty for the free library. Also, if the library is
+modified by someone else and passed on, the recipients should know
+that what they have is not the original version, so that the original
+author's reputation will not be affected by problems that might be
+introduced by others.
+
+ Finally, software patents pose a constant threat to the existence of
+any free program. We wish to make sure that a company cannot
+effectively restrict the users of a free program by obtaining a
+restrictive license from a patent holder. Therefore, we insist that
+any patent license obtained for a version of the library must be
+consistent with the full freedom of use specified in this license.
+
+ Most GNU software, including some libraries, is covered by the
+ordinary GNU General Public License. This license, the GNU Lesser
+General Public License, applies to certain designated libraries, and
+is quite different from the ordinary General Public License. We use
+this license for certain libraries in order to permit linking those
+libraries into non-free programs.
+
+ When a program is linked with a library, whether statically or using
+a shared library, the combination of the two is legally speaking a
+combined work, a derivative of the original library. The ordinary
+General Public License therefore permits such linking only if the
+entire combination fits its criteria of freedom. The Lesser General
+Public License permits more lax criteria for linking other code with
+the library.
+
+ We call this license the "Lesser" General Public License because it
+does Less to protect the user's freedom than the ordinary General
+Public License. It also provides other free software developers Less
+of an advantage over competing non-free programs. These disadvantages
+are the reason we use the ordinary General Public License for many
+libraries. However, the Lesser license provides advantages in certain
+special circumstances.
+
+ For example, on rare occasions, there may be a special need to
+encourage the widest possible use of a certain library, so that it becomes
+a de-facto standard. To achieve this, non-free programs must be
+allowed to use the library. A more frequent case is that a free
+library does the same job as widely used non-free libraries. In this
+case, there is little to gain by limiting the free library to free
+software only, so we use the Lesser General Public License.
+
+ In other cases, permission to use a particular library in non-free
+programs enables a greater number of people to use a large body of
+free software. For example, permission to use the GNU C Library in
+non-free programs enables many more people to use the whole GNU
+operating system, as well as its variant, the GNU/Linux operating
+system.
+
+ Although the Lesser General Public License is Less protective of the
+users' freedom, it does ensure that the user of a program that is
+linked with the Library has the freedom and the wherewithal to run
+that program using a modified version of the Library.
+
+ The precise terms and conditions for copying, distribution and
+modification follow. Pay close attention to the difference between a
+"work based on the library" and a "work that uses the library". The
+former contains code derived from the library, whereas the latter must
+be combined with the library in order to run.
+
+ GNU LESSER GENERAL PUBLIC LICENSE
+ TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+ 0. This License Agreement applies to any software library or other
+program which contains a notice placed by the copyright holder or
+other authorized party saying it may be distributed under the terms of
+this Lesser General Public License (also called "this License").
+Each licensee is addressed as "you".
+
+ A "library" means a collection of software functions and/or data
+prepared so as to be conveniently linked with application programs
+(which use some of those functions and data) to form executables.
+
+ The "Library", below, refers to any such software library or work
+which has been distributed under these terms. A "work based on the
+Library" means either the Library or any derivative work under
+copyright law: that is to say, a work containing the Library or a
+portion of it, either verbatim or with modifications and/or translated
+straightforwardly into another language. (Hereinafter, translation is
+included without limitation in the term "modification".)
+
+ "Source code" for a work means the preferred form of the work for
+making modifications to it. For a library, complete source code means
+all the source code for all modules it contains, plus any associated
+interface definition files, plus the scripts used to control compilation
+and installation of the library.
+
+ Activities other than copying, distribution and modification are not
+covered by this License; they are outside its scope. The act of
+running a program using the Library is not restricted, and output from
+such a program is covered only if its contents constitute a work based
+on the Library (independent of the use of the Library in a tool for
+writing it). Whether that is true depends on what the Library does
+and what the program that uses the Library does.
+
+ 1. You may copy and distribute verbatim copies of the Library's
+complete source code as you receive it, in any medium, provided that
+you conspicuously and appropriately publish on each copy an
+appropriate copyright notice and disclaimer of warranty; keep intact
+all the notices that refer to this License and to the absence of any
+warranty; and distribute a copy of this License along with the
+Library.
+
+ You may charge a fee for the physical act of transferring a copy,
+and you may at your option offer warranty protection in exchange for a
+fee.
+
+ 2. You may modify your copy or copies of the Library or any portion
+of it, thus forming a work based on the Library, and copy and
+distribute such modifications or work under the terms of Section 1
+above, provided that you also meet all of these conditions:
+
+ a) The modified work must itself be a software library.
+
+ b) You must cause the files modified to carry prominent notices
+ stating that you changed the files and the date of any change.
+
+ c) You must cause the whole of the work to be licensed at no
+ charge to all third parties under the terms of this License.
+
+ d) If a facility in the modified Library refers to a function or a
+ table of data to be supplied by an application program that uses
+ the facility, other than as an argument passed when the facility
+ is invoked, then you must make a good faith effort to ensure that,
+ in the event an application does not supply such function or
+ table, the facility still operates, and performs whatever part of
+ its purpose remains meaningful.
+
+ (For example, a function in a library to compute square roots has
+ a purpose that is entirely well-defined independent of the
+ application. Therefore, Subsection 2d requires that any
+ application-supplied function or table used by this function must
+ be optional: if the application does not supply it, the square
+ root function must still compute square roots.)
+
+These requirements apply to the modified work as a whole. If
+identifiable sections of that work are not derived from the Library,
+and can be reasonably considered independent and separate works in
+themselves, then this License, and its terms, do not apply to those
+sections when you distribute them as separate works. But when you
+distribute the same sections as part of a whole which is a work based
+on the Library, the distribution of the whole must be on the terms of
+this License, whose permissions for other licensees extend to the
+entire whole, and thus to each and every part regardless of who wrote
+it.
+
+Thus, it is not the intent of this section to claim rights or contest
+your rights to work written entirely by you; rather, the intent is to
+exercise the right to control the distribution of derivative or
+collective works based on the Library.
+
+In addition, mere aggregation of another work not based on the Library
+with the Library (or with a work based on the Library) on a volume of
+a storage or distribution medium does not bring the other work under
+the scope of this License.
+
+ 3. You may opt to apply the terms of the ordinary GNU General Public
+License instead of this License to a given copy of the Library. To do
+this, you must alter all the notices that refer to this License, so
+that they refer to the ordinary GNU General Public License, version 2,
+instead of to this License. (If a newer version than version 2 of the
+ordinary GNU General Public License has appeared, then you can specify
+that version instead if you wish.) Do not make any other change in
+these notices.
+
+ Once this change is made in a given copy, it is irreversible for
+that copy, so the ordinary GNU General Public License applies to all
+subsequent copies and derivative works made from that copy.
+
+ This option is useful when you wish to copy part of the code of
+the Library into a program that is not a library.
+
+ 4. You may copy and distribute the Library (or a portion or
+derivative of it, under Section 2) in object code or executable form
+under the terms of Sections 1 and 2 above provided that you accompany
+it with the complete corresponding machine-readable source code, which
+must be distributed under the terms of Sections 1 and 2 above on a
+medium customarily used for software interchange.
+
+ If distribution of object code is made by offering access to copy
+from a designated place, then offering equivalent access to copy the
+source code from the same place satisfies the requirement to
+distribute the source code, even though third parties are not
+compelled to copy the source along with the object code.
+
+ 5. A program that contains no derivative of any portion of the
+Library, but is designed to work with the Library by being compiled or
+linked with it, is called a "work that uses the Library". Such a
+work, in isolation, is not a derivative work of the Library, and
+therefore falls outside the scope of this License.
+
+ However, linking a "work that uses the Library" with the Library
+creates an executable that is a derivative of the Library (because it
+contains portions of the Library), rather than a "work that uses the
+library". The executable is therefore covered by this License.
+Section 6 states terms for distribution of such executables.
+
+ When a "work that uses the Library" uses material from a header file
+that is part of the Library, the object code for the work may be a
+derivative work of the Library even though the source code is not.
+Whether this is true is especially significant if the work can be
+linked without the Library, or if the work is itself a library. The
+threshold for this to be true is not precisely defined by law.
+
+ If such an object file uses only numerical parameters, data
+structure layouts and accessors, and small macros and small inline
+functions (ten lines or less in length), then the use of the object
+file is unrestricted, regardless of whether it is legally a derivative
+work. (Executables containing this object code plus portions of the
+Library will still fall under Section 6.)
+
+ Otherwise, if the work is a derivative of the Library, you may
+distribute the object code for the work under the terms of Section 6.
+Any executables containing that work also fall under Section 6,
+whether or not they are linked directly with the Library itself.
+
+ 6. As an exception to the Sections above, you may also combine or
+link a "work that uses the Library" with the Library to produce a
+work containing portions of the Library, and distribute that work
+under terms of your choice, provided that the terms permit
+modification of the work for the customer's own use and reverse
+engineering for debugging such modifications.
+
+ You must give prominent notice with each copy of the work that the
+Library is used in it and that the Library and its use are covered by
+this License. You must supply a copy of this License. If the work
+during execution displays copyright notices, you must include the
+copyright notice for the Library among them, as well as a reference
+directing the user to the copy of this License. Also, you must do one
+of these things:
+
+ a) Accompany the work with the complete corresponding
+ machine-readable source code for the Library including whatever
+ changes were used in the work (which must be distributed under
+ Sections 1 and 2 above); and, if the work is an executable linked
+ with the Library, with the complete machine-readable "work that
+ uses the Library", as object code and/or source code, so that the
+ user can modify the Library and then relink to produce a modified
+ executable containing the modified Library. (It is understood
+ that the user who changes the contents of definitions files in the
+ Library will not necessarily be able to recompile the application
+ to use the modified definitions.)
+
+ b) Use a suitable shared library mechanism for linking with the
+ Library. A suitable mechanism is one that (1) uses at run time a
+ copy of the library already present on the user's computer system,
+ rather than copying library functions into the executable, and (2)
+ will operate properly with a modified version of the library, if
+ the user installs one, as long as the modified version is
+ interface-compatible with the version that the work was made with.
+
+ c) Accompany the work with a written offer, valid for at
+ least three years, to give the same user the materials
+ specified in Subsection 6a, above, for a charge no more
+ than the cost of performing this distribution.
+
+ d) If distribution of the work is made by offering access to copy
+ from a designated place, offer equivalent access to copy the above
+ specified materials from the same place.
+
+ e) Verify that the user has already received a copy of these
+ materials or that you have already sent this user a copy.
+
+ For an executable, the required form of the "work that uses the
+Library" must include any data and utility programs needed for
+reproducing the executable from it. However, as a special exception,
+the materials to be distributed need not include anything that is
+normally distributed (in either source or binary form) with the major
+components (compiler, kernel, and so on) of the operating system on
+which the executable runs, unless that component itself accompanies
+the executable.
+
+ It may happen that this requirement contradicts the license
+restrictions of other proprietary libraries that do not normally
+accompany the operating system. Such a contradiction means you cannot
+use both them and the Library together in an executable that you
+distribute.
+
+ 7. You may place library facilities that are a work based on the
+Library side-by-side in a single library together with other library
+facilities not covered by this License, and distribute such a combined
+library, provided that the separate distribution of the work based on
+the Library and of the other library facilities is otherwise
+permitted, and provided that you do these two things:
+
+ a) Accompany the combined library with a copy of the same work
+ based on the Library, uncombined with any other library
+ facilities. This must be distributed under the terms of the
+ Sections above.
+
+ b) Give prominent notice with the combined library of the fact
+ that part of it is a work based on the Library, and explaining
+ where to find the accompanying uncombined form of the same work.
+
+ 8. You may not copy, modify, sublicense, link with, or distribute
+the Library except as expressly provided under this License. Any
+attempt otherwise to copy, modify, sublicense, link with, or
+distribute the Library is void, and will automatically terminate your
+rights under this License. However, parties who have received copies,
+or rights, from you under this License will not have their licenses
+terminated so long as such parties remain in full compliance.
+
+ 9. You are not required to accept this License, since you have not
+signed it. However, nothing else grants you permission to modify or
+distribute the Library or its derivative works. These actions are
+prohibited by law if you do not accept this License. Therefore, by
+modifying or distributing the Library (or any work based on the
+Library), you indicate your acceptance of this License to do so, and
+all its terms and conditions for copying, distributing or modifying
+the Library or works based on it.
+
+ 10. Each time you redistribute the Library (or any work based on the
+Library), the recipient automatically receives a license from the
+original licensor to copy, distribute, link with or modify the Library
+subject to these terms and conditions. You may not impose any further
+restrictions on the recipients' exercise of the rights granted herein.
+You are not responsible for enforcing compliance by third parties with
+this License.
+
+ 11. If, as a consequence of a court judgment or allegation of patent
+infringement or for any other reason (not limited to patent issues),
+conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License. If you cannot
+distribute so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you
+may not distribute the Library at all. For example, if a patent
+license would not permit royalty-free redistribution of the Library by
+all those who receive copies directly or indirectly through you, then
+the only way you could satisfy both it and this License would be to
+refrain entirely from distribution of the Library.
+
+If any portion of this section is held invalid or unenforceable under any
+particular circumstance, the balance of the section is intended to apply,
+and the section as a whole is intended to apply in other circumstances.
+
+It is not the purpose of this section to induce you to infringe any
+patents or other property right claims or to contest validity of any
+such claims; this section has the sole purpose of protecting the
+integrity of the free software distribution system which is
+implemented by public license practices. Many people have made
+generous contributions to the wide range of software distributed
+through that system in reliance on consistent application of that
+system; it is up to the author/donor to decide if he or she is willing
+to distribute software through any other system and a licensee cannot
+impose that choice.
+
+This section is intended to make thoroughly clear what is believed to
+be a consequence of the rest of this License.
+
+ 12. If the distribution and/or use of the Library is restricted in
+certain countries either by patents or by copyrighted interfaces, the
+original copyright holder who places the Library under this License may add
+an explicit geographical distribution limitation excluding those countries,
+so that distribution is permitted only in or among countries not thus
+excluded. In such case, this License incorporates the limitation as if
+written in the body of this License.
+
+ 13. The Free Software Foundation may publish revised and/or new
+versions of the Lesser General Public License from time to time.
+Such new versions will be similar in spirit to the present version,
+but may differ in detail to address new problems or concerns.
+
+Each version is given a distinguishing version number. If the Library
+specifies a version number of this License which applies to it and
+"any later version", you have the option of following the terms and
+conditions either of that version or of any later version published by
+the Free Software Foundation. If the Library does not specify a
+license version number, you may choose any version ever published by
+the Free Software Foundation.
+
+ 14. If you wish to incorporate parts of the Library into other free
+programs whose distribution conditions are incompatible with these,
+write to the author to ask for permission. For software which is
+copyrighted by the Free Software Foundation, write to the Free
+Software Foundation; we sometimes make exceptions for this. Our
+decision will be guided by the two goals of preserving the free status
+of all derivatives of our free software and of promoting the sharing
+and reuse of software generally.
+
+ NO WARRANTY
+
+ 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
+WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
+EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
+OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY
+KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
+LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
+THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
+
+ 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
+WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
+AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU
+FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
+CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
+LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
+RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
+FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
+SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
+DAMAGES.
+
+ END OF TERMS AND CONDITIONS
+
+ How to Apply These Terms to Your New Libraries
+
+ If you develop a new library, and you want it to be of the greatest
+possible use to the public, we recommend making it free software that
+everyone can redistribute and change. You can do so by permitting
+redistribution under these terms (or, alternatively, under the terms of the
+ordinary General Public License).
+
+ To apply these terms, attach the following notices to the library. It is
+safest to attach them to the start of each source file to most effectively
+convey the exclusion of warranty; and each file should have at least the
+"copyright" line and a pointer to where the full notice is found.
+
+ <one line to give the library's name and a brief idea of what it does.>
+ Copyright (C) <year> <name of author>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+Also add information on how to contact you by electronic and paper mail.
+
+You should also get your employer (if you work as a programmer) or your
+school, if any, to sign a "copyright disclaimer" for the library, if
+necessary. Here is a sample; alter the names:
+
+ Yoyodyne, Inc., hereby disclaims all copyright interest in the
+ library `Frob' (a library for tweaking knobs) written by James Random Hacker.
+
+ <signature of Ty Coon>, 1 April 1990
+ Ty Coon, President of Vice
+
+That's all there is to it!
View
20 wx-config-win/wx-config-win.sln
@@ -0,0 +1,20 @@
+
+Microsoft Visual Studio Solution File, Format Version 12.00
+# Visual Studio 11
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "wx-config-win", "wx-config-win\wx-config-win.vcxproj", "{39652E79-C767-4B36-A2E2-DEFDC5021F9C}"
+EndProject
+Global
+ GlobalSection(SolutionConfigurationPlatforms) = preSolution
+ Debug|Win32 = Debug|Win32
+ Release|Win32 = Release|Win32
+ EndGlobalSection
+ GlobalSection(ProjectConfigurationPlatforms) = postSolution
+ {39652E79-C767-4B36-A2E2-DEFDC5021F9C}.Debug|Win32.ActiveCfg = Debug|Win32
+ {39652E79-C767-4B36-A2E2-DEFDC5021F9C}.Debug|Win32.Build.0 = Debug|Win32
+ {39652E79-C767-4B36-A2E2-DEFDC5021F9C}.Release|Win32.ActiveCfg = Release|Win32
+ {39652E79-C767-4B36-A2E2-DEFDC5021F9C}.Release|Win32.Build.0 = Release|Win32
+ EndGlobalSection
+ GlobalSection(SolutionProperties) = preSolution
+ HideSolutionNode = FALSE
+ EndGlobalSection
+EndGlobal
View
2,780 wx-config-win/wx-config-win/wx-config.cpp
@@ -0,0 +1,2780 @@
+////////////////////////////////////////////////////////////////////////////////////////////////////
+// Name: wx-config-win.cpp
+// Purpose: A wx-config implementation for Windows
+// Author: Takeshi Miya
+// Created: 2006-03-23
+// Copyright: (c) Takeshi Miya, 2006
+// (c) J. O'Donoghue, 2012
+// Licence: wxWidgets licence
+////////////////////////////////////////////////////////////////////////////////////////////////////
+
+// Allows building under VS2010
+#undef UNICODE
+#pragma warning( disable : 4996 )
+
+#include <iostream>
+#include <string>
+#include <cstdlib>
+
+#include <map>
+#include <fstream>
+#include <algorithm>
+#include <vector>
+
+#include <windows.h>
+
+#define ARRAY_LENGTH(a) (sizeof(a) / sizeof(a[0]))
+
+// -------------------------------------------------------------------------------------------------
+
+std::string usageText[] = {
+ "Usage: wx-config [--prefix[=DIR]] [--wxcfg[=DIR]] [--release], [--version]",
+ " [--universal[=yes|no]] [--unicode[=yes|no]] [--static[=yes|no]]",
+ " [--debug[=yes|no] [--basename] [--cc] [--cxx] [--cflags]",
+ " [--cxxflags] [--rcflags] [--ld] [-v] [--compiler[=gcc|dmc|vc]",
+ " [--libs [LIBS...]"
+ "",
+ "",
+ " --prefix[=DIR] Path to the wxWidgets installation (ie. C:\\wxWidgets)",
+ " --wxcfg[=DIR] Relative path to build.cfg file (ie. gcc_dll\\mswud)",
+ " --cflags Outputs all pre-processor and compiler flags.",
+ " --cxxflags Same as --cflags but for C++.",
+ " --rcflags Outputs all resource compiler flags. [UNTESTED]",
+ " --libs [LIBS...] Outputs library names to use - see below.",
+ "",
+ " --debug[=yes|no] Uses a debug configuration if found.",
+ " --unicode[=yes|no] Uses an unicode configuration if found.",
+ " --static[=yes|no] Uses a static configuration if found.",
+ " --universal[=yes|no] Uses an universal configuration if found.",
+ " --compiler[=gcc,dmc,vc] Selects the compiler.",
+ " --release Outputs the wxWidgets release number.",
+ " --version Outputs the wxWidgets version.",
+ " --basename Outputs the base name of the wxWidgets libraries.",
+ " --cc Outputs the name of the C compiler.",
+ " --cxx Outputs the name of the C++ compiler.",
+ " --ld Outputs the linker command.",
+ " -v Outputs the revision of wx-config.",
+ "",
+ "",
+ " Note that using --prefix is not needed if you have defined the",
+ " environmental variable WXWIN.",
+ "",
+ " Note that using --wxcfg is not needed if you have defined the",
+ " environmental variable WXCFG."
+ "",
+ " The LIBS arguments (comma or space separated) may be used to specify",
+ " the wxWidgets libraries that you wish to use in your application. The",
+ " \"std\" label may be used to import all libraries which would be used if",
+ " none were specified explicitly, e.g. wx-config --libs core,base. The \"all\"",
+ " label may be used to import all libraries found to be installed.",
+ ""
+};
+
+// The full list of libs in a standard wxWidgets build. This is ordered so that
+// static linking will work
+std::string allLibs_a[] =
+{
+ "xrc", "stc", "richtext", "ribbon", "propgrid", "aui", "gl", "media", "html",
+ "webview", "qa", "adv", "core", "xml", "net", "base"
+};
+std::vector<std::string> allLibs(allLibs_a, allLibs_a + ARRAY_LENGTH(allLibs_a));
+
+// The libraries you get if you ask for "std". This is ordered so that static
+// linking will work
+std::string stdLibs_a[] =
+{
+ "xrc", "html", "qa", "adv", "core", "xml", "net", "base"
+};
+std::vector<std::string> stdLibs(stdLibs_a, stdLibs_a + ARRAY_LENGTH(stdLibs_a));
+
+void usage()
+{
+ // Print error text
+ for (int i = 0; i < ARRAY_LENGTH(usageText); i++)
+ {
+ std::cerr << usageText[i] << std::endl;
+ }
+}
+
+bool contains(std::vector<std::string> vec, std::string val)
+{
+ std::vector<std::string>::iterator it = vec.begin();
+ bool result = false;
+
+ if (vec.size() == 0)
+ return result;
+
+ do
+ {
+ result = (*it == val);
+ ++it;
+ } while (!result && it != vec.end());
+
+ return result;
+}
+
+std::vector<std::string> replace(std::vector<std::string> vec, std::string old_val, std::vector<std::string> new_vals)
+{
+ std::vector<std::string> result;
+ std::vector<std::string>::iterator it;
+
+ for (it = vec.begin(); it != vec.end(); ++it)
+ {
+ if (*it == old_val)
+ {
+ std::vector<std::string>::iterator jt;
+ for (jt = new_vals.begin(); jt != new_vals.end() ; ++jt)
+ {
+ result.push_back(*jt);
+ }
+ }
+ else
+ {
+ result.push_back(*it);
+ }
+ }
+
+ return result;
+}
+
+std::string getSvnRevision()
+{
+ std::string str = "$Rev: 26 $";
+ if (str.length() > 8)
+ return str.substr(6, str.length()-8);
+ else
+ return "X";
+}
+
+std::string getSvnDate()
+{
+ std::string str = "$Date: 2006-12-21 02:08:16 +0000 (Thu, 21 Dec 2006) $";
+ if (str.length() > 16)
+ return str.substr(7, 10);
+ else
+ return "2012-04-04";
+}
+
+static const std::string g_tokError = "wx-config Error: ";
+static const std::string g_tokWarning = "wx-config Warning: ";
+
+// -------------------------------------------------------------------------------------------------
+
+/// Program options
+class Options
+{
+public:
+ std::string& operator[](const std::string& key)
+ {
+ return m_vars[key];
+ }
+
+ bool keyExists(const std::string& key) const
+ {
+ return m_vars.count(key) != 0;
+ }
+
+ const std::string& keyValue(const std::string& key) const
+ {
+ return m_vars.find(key)->second;
+ }
+
+ std::map<std::string,std::string>& getVars()
+ {
+ return m_vars;
+ }
+protected:
+ std::map<std::string,std::string> m_vars;
+};
+
+// -------------------------------------------------------------------------------------------------
+
+/// File build.cfg/config.* options
+class BuildFileOptions : public Options
+{
+public:
+ BuildFileOptions(const std::string& filepath)
+ {
+ parse(filepath);
+ }
+
+ bool parse(const std::string& filepath)
+ {
+ std::string line;
+ std::ifstream file(filepath.c_str());
+ if (file.is_open())
+ {
+ while (!file.eof() )
+ {
+ std::getline(file, line);
+
+ // it's a comment line
+ if (line.find_first_of('#') != std::string::npos)
+ continue;
+
+ // strip spaces
+ line.erase( std::remove(line.begin(), line.end(), ' '), line.end() );
+
+ split(line);
+ }
+ file.close();
+
+ if (!m_vars.empty())
+ return true;
+ }
+ else
+ std::cout << g_tokError << "Unable to open file '" << filepath.c_str() << "'." << std::endl;
+
+ return false;
+ }
+
+protected:
+ void split(const std::string& line)
+ {
+ size_t sep = line.find('=');
+ if (sep != std::string::npos)
+ {
+ std::string key = line.substr(0, sep);
+ std::string val = line.substr(sep+1, line.size()-sep-1);
+ m_vars[key] = val;
+ }
+ }
+};
+
+// -------------------------------------------------------------------------------------------------
+
+/// File setup.h options
+class SetupHOptions
+{
+public:
+ bool& operator[](const std::string& key)
+ {
+ return m_vars[key];
+ }
+
+ bool keyExists(const std::string& key) const
+ {
+ return m_vars.count(key) != 0;
+ }
+
+ bool keyValue(const std::string& key) const
+ {
+ return m_vars.find(key)->second;
+ }
+
+ typedef std::map<std::string,bool> StringBoolMap;
+
+ StringBoolMap& getVars()
+ {
+ return m_vars;
+ }
+protected:
+ StringBoolMap m_vars;
+
+
+public:
+ SetupHOptions(const std::string& filepath)
+ {
+ parse(filepath);
+ }
+
+ bool parse(const std::string& filepath)
+ {
+ std::string line;
+ std::ifstream file(filepath.c_str());
+ if (file.is_open())
+ {
+ while (!file.eof())
+ {
+ std::getline(file, line);
+
+ // does the splitting/parsing
+ split(line);
+ }
+ file.close();
+
+ if (!m_vars.empty())
+ return true;
+ }
+ else
+ std::cout << g_tokError << "Unable to open file '" << filepath.c_str() << "'." << std::endl;
+
+ return false;
+ }
+
+ void printDebug()
+ {
+ std::cout << "DEBUG: setup.h contents BEGIN -------------------------------------------------" << std::endl;
+ for (StringBoolMap::iterator it = m_vars.begin(); it != m_vars.end(); ++it)
+ std::cout << it->first << "=" << it->second << std::endl;
+ std::cout << "DEBUG: setup.h contents END ---------------------------------------------------" << std::endl;
+ }
+
+protected:
+ void split(std::string& line)
+ {
+ // it's a comment line
+ if (line.find_first_of('/') != std::string::npos)
+ return; // skips the line
+
+ // strip spaces and tabs
+ line.erase( std::remove(line.begin(), line.end(), ' '), line.end() );
+ line.erase( std::remove(line.begin(), line.end(), '\t'), line.end() );
+
+ std::string tokDefine("#define");
+ size_t posDefine = line.find_first_of(tokDefine);
+
+ // it's a #define line
+ if (posDefine != std::string::npos)
+ {
+ std::string key;
+ bool val;
+
+ // resolves val, checking if last char is 0 or 1
+ char lastChar = line.at(line.length()-1); // TODO: I don't like this line :P
+ if (lastChar == '0')
+ val = false;
+ else if (lastChar == '1')
+ val = true;
+ else
+ return; // skips the line
+
+ // resolves key
+ size_t startPos = posDefine + tokDefine.length();
+ key = line.substr(startPos, line.length() - startPos - 1);
+
+ // finally saves the parsed data!
+ m_vars[key] = val;
+ }
+ }
+};
+
+
+// -------------------------------------------------------------------------------------------------
+
+/// Command line options
+class CmdLineOptions : public Options
+{
+public:
+ CmdLineOptions(int argc, char* argv[])
+ {
+ parse(argc, argv);
+ }
+
+ bool validArgs()
+ {
+ bool valid = keyExists("--compiler") ||
+ keyExists("--variable") ||
+ keyExists("--define-variable") ||
+ keyExists("--prefix") ||
+ keyExists("--wxcfg") ||
+ keyExists("--libs") ||
+ keyExists("--cflags") ||
+ keyExists("--cxxflags") ||
+ keyExists("--cppflags") ||
+ keyExists("--rcflags") ||
+ keyExists("--list") ||
+ keyExists("--debug") ||
+ keyExists("--unicode") ||
+ keyExists("--static") ||
+ keyExists("--universal") ||
+ keyExists("--release") ||
+ keyExists("--version") ||
+ keyExists("--basename") ||
+ keyExists("--cc") ||
+ keyExists("--cxx") ||
+ keyExists("--ld") ||
+ keyExists("-v");
+
+ // TODO: not all flags are being validated
+ if (!valid)
+ {
+ if (m_vars.size() > 1 && !keyExists("--help"))
+ std::cout << g_tokError << "Unrecognised option: '" << m_vars.begin()->first << "'\n" << std::endl;
+
+ usage();
+ }
+
+ return valid;
+ }
+
+ bool parse(int argc, char* argv[])
+ {
+ for(int i=0; i<argc; ++i)
+ {
+ std::string line;
+ line = argv[i];
+ split(line);
+ }
+ parseLibs(argv[argc-1]);
+
+ return true;
+ }
+
+ std::vector<std::string> getLibs() const
+ {
+ return m_libs;
+ }
+
+protected:
+
+ void split(const std::string& line)
+ {
+ size_t sep = line.find("=");
+ if (sep != std::string::npos)
+ {
+ std::string key = line.substr(0, sep);
+ std::string val = line.substr(sep+1, line.size()-sep-1);
+ m_vars[key] = val;
+ }
+ else
+ m_vars[line] = "";
+ }
+
+ bool libExists(const std::string& lib)
+ {
+ return std::find(m_libs.begin(), m_libs.end(), lib) != m_libs.end();
+ }
+
+ void addLib(const std::string& lib)
+ {
+ // adds the lib if its not present already
+ if (!libExists(lib))
+ m_libs.push_back(lib);
+ }
+
+ void parseLibs(const std::string libs)
+ {
+ std::string param = libs;
+
+ // if the last parameter doesn't haves a -- switch
+ if (param.find("--") == std::string::npos)
+ {
+ // saves in the vector, comma separated text like "text1,text2,text3,text4"
+ while(true)
+ {
+ size_t comma = param.find(",");
+ if (comma != std::string::npos)
+ {
+ m_libs.push_back(param.substr(0, comma));
+ param = param.substr(comma+1, param.size()-comma-1);
+ }
+ else
+ {
+ m_libs.push_back(param);
+ break;
+ }
+ }
+ }
+
+ // assuming magic keyword 'std' as a lib parameter for non-monolithic
+ // magic keyword std: links with libraries defined in stdLibs
+ // Note that we cannot deal with the 'all' magic keyword here because
+ // we do not yet know what 'all' the libraries present are :-(
+ // If no list of libraries, assume we want "std"
+ if (m_libs.empty())
+ {
+ for (int l = 0; l < ARRAY_LENGTH(stdLibs); ++l)
+ {
+ addLib(stdLibs[l]);
+ }
+ }
+ }
+
+ std::vector<std::string> m_libs;
+};
+
+// -------------------------------------------------------------------------------------------------
+
+/// Struct to keep programs
+struct CompilerPrograms
+{
+ std::string cc; // C compiler
+ std::string cxx; // C++ compiler
+ std::string ld; // dynamic libs linker
+ std::string lib; // static libs linker
+ std::string windres; // resource compiler
+};
+
+/// Struct to keep switches
+struct CompilerSwitches
+{
+ std::string includeDirs; // -I
+ std::string resIncludeDirs; // --include-dir
+ std::string libDirs; // -L
+ std::string linkLibs; // -l
+ std::string libPrefix; // lib
+ std::string libExtension; // a
+ std::string defines; // -D
+ std::string resDefines; // --define
+ std::string genericSwitch; // -
+ std::string objectExtension; // o
+ bool forceLinkerUseQuotes; // use quotes for filenames in linker command line (needed or not)?
+ bool forceCompilerUseQuotes; // use quotes for filenames in compiler command line (needed or not)?
+ bool linkerNeedsLibPrefix; // when adding a link library, linker needs prefix?
+ bool linkerNeedsLibExtension; // when adding a link library, linker needs extension?
+ bool supportsPCH; // supports precompiled headers?
+ std::string PCHExtension; // precompiled headers extension
+};
+
+static bool g_sEasyMode = false;
+
+void checkEasyMode(CmdLineOptions& cl)
+{
+ if (cl.keyExists("--easymode"))
+ {
+ if (cl["--easymode"] == "no")
+ g_sEasyMode = false;
+ else if (cl["--easymode"] == "yes" || cl["--easymode"].empty())
+ g_sEasyMode = true;
+ }
+}
+
+// -------------------------------------------------------------------------------------------------
+
+// Look at the directory indicated by WXCFG to determine what libraries are *actually*
+// installed. The Unix version doesn't need to do this because it already knows what was
+// configured (it was 'burned' into wx-config as part of the configure process), whereas
+// we don't have that luxury
+
+std::vector<std::string> getInstalledLibs(Options& po)
+{
+ // Note - we need only the first directory in WXCFG.
+ std::string libDir = po["wxcfg"].substr(0,po["wxcfg"].find("\\"));
+ std::string cfgWildcard = po["prefix"] + "\\lib\\" + libDir + "\\libwx*_*.a";
+ TCHAR* szFindFiles = strncpy(new char[MAX_PATH], cfgWildcard.c_str(), MAX_PATH);
+ std::vector<std::string>* pLibsList = new std::vector<std::string>;
+ WIN32_FIND_DATA ffd;
+
+ // Use WIN32 API to find all wxWidgets implibs (i.e. libwx*_**.a), as this is what gcc wants
+ // Note that this will 'fail' to find the base library, so we will add it back later (a valid
+ // install must contain base)
+ HANDLE hDir = FindFirstFile(szFindFiles, &ffd);
+
+ if (hDir != INVALID_HANDLE_VALUE)
+ {
+ do
+ {
+ if (!(ffd.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY))
+ {
+ std::string fn(ffd.cFileName);
+ pLibsList->push_back(fn);
+ }
+ } while (FindNextFile(hDir, &ffd) != 0);
+ }
+ FindClose(hDir);
+
+ // Now filter out for the library names, we want the part immedately after the '_' character,
+ // up to (and excluding) the '.' character.
+ std::vector<std::string>::iterator it;
+ std::vector<std::string> libs;
+
+ for (it = pLibsList->begin(); it != pLibsList->end(); ++it)
+ {
+ std::string i = *it;
+ std::string name = i.substr(i.find("_") + 1);
+ name = name.substr(0, name.find("."));
+ libs.push_back(name);
+ }
+
+ // Add back base
+ libs.push_back("base");
+
+ delete pLibsList;
+ return libs;
+}
+
+/// Compiler abstract base class
+class Compiler
+{
+public:
+ Compiler(const std::string& name) : m_name(name) {}
+
+ std::string easyMode(const std::string& str)
+ {
+ if (g_sEasyMode)
+ return str;
+ else
+ return std::string();
+ }
+
+ std::string addFlag(const std::string& flag)
+ {
+ if (flag.empty())
+ return "";
+ return flag + " ";
+ }
+
+ std::string addLib(const std::string& lib)
+ {
+ std::string result;
+ result = m_switches.linkLibs;
+
+ if (m_switches.linkerNeedsLibPrefix)
+ result += m_switches.libPrefix;
+
+ result += lib;
+
+ if (m_switches.linkerNeedsLibExtension)
+ result += "." + m_switches.libExtension;
+
+ result += " ";
+
+ if (lib.empty())
+ return "";
+ return result;
+ }
+
+ std::string addDefine(const std::string& define)
+ {
+ if (define.empty())
+ return "";
+ return m_switches.defines + define + " ";
+ }
+
+ std::string addResDefine(const std::string& resDefine)
+ {
+ if (resDefine.empty())
+ return "";
+ return m_switches.resDefines + " " + resDefine + " ";
+ }
+
+ std::string addIncludeDir(const std::string& includeDir)
+ {
+ if (includeDir.empty())
+ return "";
+ return m_switches.includeDirs + includeDir + " ";
+ }
+
+ std::string addLinkerDir(const std::string& libDir)
+ {
+ if (libDir.empty())
+ return "";
+ return m_switches.libDirs + libDir + " ";
+ }
+
+ std::string addResIncludeDir(const std::string& resIncludeDir)
+ {
+ if (resIncludeDir.empty())
+ return "";
+ return m_switches.resIncludeDirs + " " + resIncludeDir + " ";
+ }
+
+ std::string getName() const
+ {
+ return m_name;
+ }
+
+ // Configure "base" library link libs (multilib.bkl#24)
+ void process_base(Options& po, BuildFileOptions& cfg)
+ {
+ if (cfg["MONOLITHIC"] == "0")
+ po["__WXLIB_BASE_p"] = addLib(po["LIB_BASENAME_BASE"]);
+ }
+
+ // Configure "net" library link libs (multilib.bkl#48, depends: base)
+ void process_net(Options& po, BuildFileOptions& cfg)
+ {
+ if (cfg["MONOLITHIC"] == "0")
+ po["__WXLIB_NET_p"] = addLib(po["LIB_BASENAME_BASE"] + "_net");
+ }
+
+ // Configure "XML" library link libs (multilib.bkl#238, depends: base, $(EXTRALIBS_XML))
+ void process_xml(Options& po, BuildFileOptions& cfg)
+ {
+ if (cfg["MONOLITHIC"] == "0")
+ po["__WXLIB_XML_p"] = addLib(po["LIB_BASENAME_BASE"] + "_xml");
+ }
+
+ // Configure "core" library link libs (multilib.bkl#72, depends: base)
+ void process_core(Options& po, BuildFileOptions& cfg)
+ {
+ if (cfg["MONOLITHIC"] == "0" && cfg["USE_GUI"] == "1")
+ po["__WXLIB_CORE_p"] = addLib(po["LIB_BASENAME_MSW"] + "_core");
+ }
+
+ // Configure "adv" library link libs (multilib.bkl#98, depends: core, base)
+ void process_adv(Options& po, BuildFileOptions& cfg)
+ {
+ if (cfg["MONOLITHIC"] == "0" && cfg["USE_GUI"] == "1")
+ po["__WXLIB_ADV_p"] = addLib(po["LIB_BASENAME_MSW"] + "_adv");
+ }
+
+ // Configure "qa" library link libs (multilib.bkl#213, depends: core, base, xml)
+ void process_qa(Options& po, BuildFileOptions& cfg)
+ {
+ if (cfg["MONOLITHIC"] == "0" && cfg["USE_GUI"] == "1" && cfg["USE_QA"] == "1")
+ {
+ po["__WXLIB_QA_p"] = addLib(po["LIB_BASENAME_MSW"] + "_qa");
+ po["__WXLIB_XML_p"] = addLib(po["LIB_BASENAME_BASE"] + "_xml");
+ }
+ }
+
+ // Configure "xrc" library link libs (multilib.bkl#262, depends: adv, core, xml, base)
+ void process_xrc(Options& po, BuildFileOptions& cfg, SetupHOptions& sho)
+ {
+ if (cfg["MONOLITHIC"] == "0" && cfg["USE_GUI"] == "1" && (cfg["USE_XRC"] == "1" || sho["wxUSE_XRC"]))
+ {
+ po["__WXLIB_XRC_p"] = addLib(po["LIB_BASENAME_MSW"] + "_xrc");
+ po["__WXLIB_XML_p"] = addLib(po["LIB_BASENAME_BASE"] + "_xml");
+ po["__WXLIB_ADV_p"] = addLib(po["LIB_BASENAME_MSW"] + "_adv");
+ }
+ }
+
+ // Configure "aui" library link libs (multilib.bkl#289, depends: adv, core, base)
+ // in this one, for some reason there is no USE_AUI in BuildFileOptions, so we need
+ // to look in SetupHOPtions.
+ void process_aui(Options& po, BuildFileOptions& cfg, SetupHOptions& sho)
+ {
+ if (cfg["MONOLITHIC"] == "0" && (cfg["USE_AUI"] == "1" || sho["wxUSE_AUI"]))
+ {
+ po["__WXLIB_AUI_p"] = addLib(po["LIB_BASENAME_MSW"] + "_aui");
+ po["__WXLIB_ADV_p"] = addLib(po["LIB_BASENAME_MSW"] + "_adv");
+ }
+ }
+
+ // Configure "ribbon" library link libs (multilib.bkl#314, depends: adv, core, base)
+ // in this one, for some reason there is no USE_RIBBON in BuildFileOptions, so we need
+ // to look in SetupHOPtions.
+ void process_ribbon(Options& po, BuildFileOptions& cfg, SetupHOptions& sho)
+ {
+ if (cfg["MONOLITHIC"] == "0" && (cfg["USE_RIBBON"] == "1" || sho["wxUSE_RIBBON"]))
+ {
+ po["__WXLIB_RIBBON_p"] = addLib(po["LIB_BASENAME_MSW"] + "_ribbon");
+ po["__WXLIB_ADV_p"] = addLib(po["LIB_BASENAME_MSW"] + "_adv");
+ }
+ }
+
+ // Configure "propgrid" library link libs (multilib.bkl#339, depends: adv, core, base)
+ // in this one, for some reason there is no USE_PROPGRID in BuildFileOptions, so we need
+ // to look in SetupHOPtions.
+ void process_propgrid(Options& po, BuildFileOptions& cfg, SetupHOptions& sho)
+ {
+ if (cfg["MONOLITHIC"] == "0" && (cfg["USE_PROPGRID"] == "1" || sho["wxUSE_PROPGRID"]))
+ {
+ po["__WXLIB_PROPGRID_p"] = addLib(po["LIB_BASENAME_MSW"] + "_propgrid");
+ po["__WXLIB_ADV_p"] = addLib(po["LIB_BASENAME_MSW"] + "_adv");
+ }
+ }
+
+ // Configure "richtext" library link libs (multilib.bkl#364, depends: adv, $(htmldll_library_link), xml, core, base)
+ // in this one, for some reason there is no USE_RICHTEXT in BuildFileOptions, so we need
+ // to look in SetupHOPtions.
+ void process_richtext(Options& po, BuildFileOptions& cfg, SetupHOptions& sho)
+ {
+ if (cfg["MONOLITHIC"] == "0" && (cfg["USE_RICHTEXT"] == "1" || sho["wxUSE_RICHTEXT"]))
+ {
+ po["__WXLIB_RICHTEXT_p"] = addLib(po["LIB_BASENAME_MSW"] + "_richtext");
+ po["__WXLIB_ADV_p"] = addLib(po["LIB_BASENAME_MSW"] + "_adv");
+ po["__WXLIB_XML_p"] = addLib(po["LIB_BASENAME_MSW"] + "_xml");
+ }
+ }
+
+ // Configure "stc" library link libs (multilib.bkl#395, depends: core, base)
+ // in this one, for some reason there is no USE_STC in BuildFileOptions, so we need
+ // to look in SetupHOPtions.
+ void process_stc(Options& po, BuildFileOptions& cfg, SetupHOptions& sho)
+ {
+ if (cfg["MONOLITHIC"] == "0" && (cfg["USE_STC"] == "1" || sho["wxUSE_STC"]))
+ po["__WXLIB_STC_p"] = addLib(po["LIB_BASENAME_MSW"] + "_stc");
+ }
+
+ // Configure "html" library link libs (multilib.bkl#150, depends: base, core, $(EXTRALIBS_HTML))
+ void process_html(Options& po, BuildFileOptions& cfg)
+ {
+ if (cfg["MONOLITHIC"] == "0" && cfg["USE_GUI"] == "1" && cfg["USE_HTML"] == "1")
+ po["__WXLIB_HTML_p"] = addLib(po["LIB_BASENAME_MSW"] + "_html");
+ }
+
+ // Configure "webview" library link libs (multilib.bkl#180, depends: base, core)
+ // TODO: Parse webview from BuildFileOptions
+ void process_webview(Options& po, BuildFileOptions& cfg)
+ {
+ if (cfg["MONOLITHIC"] == "0" && cfg["USE_GUI"] == "1" && cfg["USE_WEBVIEW"] == "1")
+ po["__WXLIB_WEBVIEW_p"] = addLib(po["LIB_BASENAME_MSW"] + "_webview");
+ }
+
+ // Configure "media" library link libs (multilib.bkl#124, depends: base, core, $(EXTRALIBS_MEDIA))
+ void process_media(Options& po, BuildFileOptions& cfg)
+ {
+ if (cfg["MONOLITHIC"] == "0" && cfg["USE_GUI"] == "1" && cfg["USE_MEDIA"] == "1")
+ po["__WXLIB_MEDIA_p"] = addLib(po["LIB_BASENAME_MSW"] + "_media");
+ }
+
+ // Configure "gl" library link libs (opengl.bkl#17, depends: base, core, $(EXTRALIBS_OPENGL))
+ void process_opengl(Options& po, BuildFileOptions& cfg)
+ {
+ /// Doesn't matter if it's monolithic or not
+ if (cfg["USE_OPENGL"] == "1" && cfg["USE_GUI"] == "1")
+ {
+ po["__WXLIB_OPENGL_p"] = addLib(po["LIB_BASENAME_MSW"] + "_gl");
+ po["EXTRALIBS_FOR_OPENGL"] += addLib("opengl32") + addLib("glu32");
+ }
+ }
+
+ void process_3(Options& po, const CmdLineOptions& cl, BuildFileOptions& cfg)
+ {
+ SetupHOptions sho(po["wxcfgsetuphfile"]);
+
+ // FIXME: proper place of this would be in a first hook, say process_1();
+ if (cl.keyExists("--define-variable"))
+ {
+ std::string strDef = cl.keyValue("--define-variable");
+ size_t sep = strDef.find("=");
+ if (sep != std::string::npos)
+ {
+ std::string key = strDef.substr(0, sep);
+ std::string val = strDef.substr(sep+1, strDef.size()-sep-1);
+
+ po[key] = val;
+ cfg[key] = val;
+
+ if (val == "1" || val == "true")
+ sho[key] = true;
+ else if (val == "0" || val == "false")
+ sho[key] = false;
+ }
+ else
+ {
+ std::cout << g_tokError << "Failed to define a variable as '"
+ << cl.keyValue("--define-variable") << "'." << std::endl;
+ std::cout << "The syntax is --define-variable=VARIABLENAME=VARIABLEVALUE" << std::endl;
+ exit(1);
+ }
+ }
+
+ /// Overriding flags sho->cfg!!
+ /// This makes sho variables haves more privilege than cfg ones
+ //-------------------------------------------------------------
+ if (sho.keyExists("wxUSE_UNICODE_MSLU"))
+ sho["wxUSE_UNICODE_MSLU"] ? cfg["MSLU"] = "1" : cfg["MSLU"] = "0";
+
+ // TODO: probably better!!!:
+ if (cfg.keyExists("MSLU"))
+ sho["wxUSE_UNICODE_MSLU"] ? cfg["MSLU"] = "1" : cfg["MSLU"] = "0";
+
+ //-------------------------------------------------------------
+
+ /// Overriding compiler programs
+ if (cfg.keyExists("CC"))
+ m_programs.cc = cfg["CC"];
+
+ if (cfg.keyExists("CXX"))
+ m_programs.cxx = cfg["CXX"];
+
+ if (cfg.keyExists("LD"))
+ m_programs.ld = cfg["LD"];
+
+ if (cfg.keyExists("LIB"))
+ m_programs.lib = cfg["LIB"];
+
+ if (cfg.keyExists("WINDRES"))
+ m_programs.windres = cfg["WINDRES"];
+
+ //-------------------------------------------------------------
+
+
+ // BASENAME variables
+ po["LIB_BASENAME_MSW"] = "wx" + po["PORTNAME"] + po["WXUNIVNAME"] + po["WX_RELEASE_NODOT"];
+ po["LIB_BASENAME_MSW"] += po["WXUNICODEFLAG"] + po["WXDEBUGFLAG"] + cfg["WX_LIB_FLAVOUR"];
+
+ po["LIB_BASENAME_BASE"] = "wxbase" + po["WX_RELEASE_NODOT"] + po["WXUNICODEFLAG"];
+ po["LIB_BASENAME_BASE"] += po["WXDEBUGFLAG"] + cfg["WX_LIB_FLAVOUR"];
+
+ // The requested libraries are passed in at the command line. There are two 'magic' cases,
+ // "std" indicates that we want the standard libraries, which are defined in stdLibs. In
+ // this case we should replace "std" with stdLibs.
+ // The second 'magic' case is "all", which requests all of the installed libraries. We need
+ // to fetch these manually, as we don't know, a priori, what was built (this is done when
+ // wx-config.in is made into wx-config on Unix-like builds)
+
+ std::vector<std::string> cl_libs = cl.getLibs();
+
+ if (contains(cl_libs, "std"))
+ cl_libs = replace(cl_libs, "std", stdLibs);
+ else if (contains(cl_libs, "all"))
+ cl_libs = replace(cl_libs, "all", getInstalledLibs(po));
+
+ // Now generate the main library outputs
+ std::vector<std::string>::iterator i;
+ for (i = cl_libs.begin(); i != cl_libs.end(); ++i)
+ {
+ std::string lib = *i;
+
+ if (lib == "base")
+ process_base(po, cfg);
+ else if (lib == "net")
+ process_net(po, cfg);
+ else if (lib == "xml")
+ process_xml(po, cfg);
+ else if (lib == "core")
+ process_core(po,cfg);
+ else if (lib == "adv")
+ process_adv(po, cfg);
+ else if (lib == "qa")
+ process_qa(po, cfg);
+ else if (lib == "html")
+ process_html(po, cfg);
+ else if (lib == "media")
+ process_media(po, cfg);
+ else if (lib == "gl")
+ process_opengl(po, cfg);
+ else if (lib == "aui")
+ process_aui(po, cfg, sho);
+ else if (lib == "propgrid")
+ process_propgrid(po, cfg, sho);
+ else if (lib == "ribbon")
+ process_ribbon(po, cfg, sho);
+ else if (lib == "richtext")
+ process_richtext(po, cfg, sho);
+ else if (lib == "webview")
+ process_webview(po, cfg);
+ else if (lib == "stc")
+ process_stc(po, cfg, sho);
+ else if (lib == "xrc")
+ process_xrc(po, cfg, sho);
+ else
+ po["__WXLIB_ARGS_p"] += addLib(po["LIB_BASENAME_MSW"] + "_" + lib);
+ }
+
+ if (cfg["MONOLITHIC"] == "1")
+ po["__WXLIB_MONO_p"] = addLib(po["LIB_BASENAME_MSW"]);
+
+
+ /// External libs (to wxWidgets)
+
+ if (cfg["USE_GUI"] == "1" && sho["wxUSE_LIBTIFF"])
+ po["__LIB_TIFF_p"] = addLib("wxtiff" + po["WXDEBUGFLAG"]);
+
+ if (cfg["USE_GUI"] == "1" && sho["wxUSE_LIBJPEG"])
+ po["__LIB_JPEG_p"] = addLib("wxjpeg" + po["WXDEBUGFLAG"]);
+
+ if (cfg["USE_GUI"] == "1" && sho["wxUSE_LIBPNG"] && sho["wxUSE_ZLIB"])
+ po["__LIB_PNG_p"] = addLib("wxpng" + po["WXDEBUGFLAG"]);
+
+ if (sho["wxUSE_ZLIB"])
+ po["__LIB_ZLIB_p"] = addLib("wxzlib" + po["WXDEBUGFLAG"]);
+
+ if (sho["wxUSE_REGEX"])
+ po["__LIB_REGEX_p"] = addLib("wxregex" + po["WXUNICODEFLAG"] + po["WXDEBUGFLAG"]);
+
+ // FIXME: in truth the check should be for wxUSE_XML but... the sho parser is very simple :P
+ if (sho["wxUSE_XRC"])
+ po["__LIB_EXPAT_p"] = addLib("wxexpat" + po["WXDEBUGFLAG"]);
+
+ if (cfg["MSLU"] == "1")
+ po["__LIB_UNICOWS_p"] = addLib("unicows");
+
+ if (cfg["USE_GDIPLUS"] == "1")
+ po["__GDIPLUS_LIB_p"] = addLib("gdiplus");
+
+ po["__LIB_KERNEL32_p"] = addLib("kernel32");
+ po["__LIB_USER32_p"] = addLib("user32");
+ po["__LIB_GDI32_p"] = addLib("gdi32");
+ po["__LIB_COMDLG32_p"] = addLib("comdlg32");
+ po["__LIB_WINSPOOL_p"] = addLib("winspool");
+ po["__LIB_WINMM_p"] = addLib("winmm");
+ po["__LIB_SHELL32_p"] = addLib("shell32");
+ po["__LIB_COMCTL32_p"] = addLib("comctl32");
+
+ if (sho["wxUSE_OLE"])
+ {
+ po["__LIB_OLE32_p"] = addLib("ole32");
+ po["__LIB_OLEAUT32_p"] = addLib("oleaut32");
+ po["__LIB_OLEACC_p"] = addLib("oleacc"); // NOTE: not being used
+ po["__LIB_OLE2W32_p"] = addLib("ole2w32"); // NOTE: not being used
+ }
+
+ po["__LIB_UUID_p"] = addLib("uuid");
+ po["__LIB_RPCRT4_p"] = addLib("rpcrt4");
+ po["__LIB_ADVAPI32_p"] = addLib("advapi32");
+
+ if (sho["wxUSE_SOCKETS"])
+ po["__LIB_WSOCK32_p"] = addLib("wsock32");
+
+
+ /* TODO: From BAKEFILE
+ <!-- link-in system libs that wx depends on: -->
+ <!-- If on borland, we don't need to do much -->
+ <if cond="FORMAT=='borland'">
+ <sys-lib>ole2w32</sys-lib>
+ <sys-lib>odbc32</sys-lib>
+ </if>
+
+ <!-- Non-borland, on the other hand... -->
+ <if cond="FORMAT not in ['borland','msevc4prj']">
+ <sys-lib>kernel32</sys-lib>
+ <sys-lib>user32</sys-lib>
+ <sys-lib>gdi32</sys-lib>
+ <sys-lib>comdlg32</sys-lib>
+ <sys-lib>winspool</sys-lib>
+ <sys-lib>winmm</sys-lib>
+ <sys-lib>shell32</sys-lib>
+ <sys-lib>comctl32</sys-lib>
+ <sys-lib>ole32</sys-lib>
+ <sys-lib>oleaut32</sys-lib>
+ <sys-lib>uuid</sys-lib>
+ <sys-lib>rpcrt4</sys-lib>
+ <sys-lib>advapi32</sys-lib>
+ <sys-lib>wsock32</sys-lib>
+ <sys-lib>odbc32</sys-lib>
+ </if>
+
+ <!-- Libs common to both borland and MSVC -->
+ <if cond="FORMAT=='msvc' or FORMAT=='msvc6prj' or FORMAT=='borland'">
+ <sys-lib>oleacc</sys-lib>
+*/
+ }
+
+ std::string getAllLibs(Options& po)
+ {
+ std::string libs;
+
+ // __WXLIB_ARGS_p is a library supplied by the user. Put these first as probably depend on others
+ libs += po["__WXLIB_ARGS_p"];
+
+ // Main list of DLLs: ordered by: xrc stc richtext ribbon propgrid webview aui gl media html qa adv core xml net base
+ libs += po["__WXLIB_XRC_p"] + po["__WXLIB_STC_p"] + po["__WXLIB_RICHTEXT_p"];
+ libs += po["__WXLIB_RIBBON_p"] + po["__WXLIB_PROPGRID_p"] + po["__WXLIB_WEBVIEW_p"];
+ libs += po["__WXLIB_AUI_p"] + po["__WXLIB_OPENGL_p"] + po["__WXLIB_MEDIA_p"];
+ libs += po["__WXLIB_HTML_p"] + po["__WXLIB_QA_p"] + po["__WXLIB_ADV_p"];
+ libs += po["__WXLIB_CORE_p"] + po["__WXLIB_XML_p"] + po["__WXLIB_NET_p"];
+ libs += po["__WXLIB_BASE_p"] + po["__WXLIB_MONO_p"];
+
+ libs += po["__LIB_TIFF_p"] + po["__LIB_JPEG_p"] + po["__LIB_PNG_p"];
+ libs += po["__LIB_ZLIB_p"] + po["__LIB_REGEX_p"] + po["__LIB_EXPAT_p"];
+ libs += po["EXTRALIBS_FOR_OPENGL"];
+ libs += po["EXTRALIBS_FOR_BASE"] + po["__UNICOWS_LIB_p"] + po["__GDIPLUS_LIB_p"];
+ libs += po["__LIB_KERNEL32_p"] + po["__LIB_USER32_p"] + po["__LIB_GDI32_p"];
+ libs += po["__LIB_COMDLG32_p"] + po["__LIB_REGEX_p"] + po["__LIB_WINSPOOL_p"];
+ libs += po["__LIB_WINMM_p"] + po["__LIB_SHELL32_p"] + po["__LIB_COMCTL32_p"];
+ libs += po["__LIB_OLE32_p"] + po["__LIB_OLEAUT32_p"] + po["__LIB_UUID_p"];
+ libs += po["__LIB_RPCRT4_p"] + po["__LIB_ADVAPI32_p"] + po["__LIB_WSOCK32_p"];
+
+ return libs;
+ }
+
+ void getVariablesValues(Options& po, const CmdLineOptions& cl, BuildFileOptions& cfg)
+ {
+ if (cl.keyExists("--variable"))
+ {
+ std::string var = cl.keyValue("--variable");
+
+ if (po.keyExists(var))
+ po["variable"] += "PO: " + var + "=" + po[var] + "\n";
+ else
+ po["variable"] += "PO: " + var + " does not exist.\n";
+
+ if (cfg.keyExists(var))
+ po["variable"] += "CFG: " + var + "=" + cfg[var] + "\n";
+ else
+ po["variable"] += "CFG: " + var + " does not exist.\n";
+ }
+ }
+
+protected:
+ // set the following members in your class
+ std::string m_name;
+ CompilerPrograms m_programs;
+ CompilerSwitches m_switches;
+};
+
+// -------------------------------------------------------------------------------------------------
+
+/// MinGW compiler
+class CompilerMinGW : public Compiler
+{
+public:
+ CompilerMinGW() : Compiler("gcc")
+ {
+ m_programs.cc = "mingw32-gcc";
+ m_programs.cxx = "mingw32-g++";
+ m_programs.ld = "mingw32-g++ -shared -fPIC -o ";
+ m_programs.lib = "ar.exe";
+ m_programs.windres = "windres";
+
+ m_switches.includeDirs = "-I";
+ m_switches.resIncludeDirs = "--include-dir";
+ m_switches.libDirs = "-L";
+ m_switches.linkLibs = "-l";
+ m_switches.libPrefix = "lib";
+ m_switches.libExtension = "a";
+ m_switches.defines = "-D";
+ m_switches.resDefines = "--define";
+ m_switches.genericSwitch = "-";
+ m_switches.forceCompilerUseQuotes = false;
+ m_switches.forceLinkerUseQuotes = false;
+ m_switches.linkerNeedsLibPrefix = false;
+ m_switches.linkerNeedsLibExtension = false;
+ m_switches.supportsPCH = true;
+ m_switches.PCHExtension = "h.gch";
+ }
+
+ void process(Options& po, const CmdLineOptions& cl)
+ {
+ /// Searchs for '<prefix>\build\msw\config.*' first
+ std::string cfg_first = po["prefix"] + "\\build\\msw\\config." + getName();
+
+ /// config.* options
+ BuildFileOptions cfg(cfg_first);
+
+ /// build.cfg options
+ cfg.parse(po["wxcfgfile"]);
+
+
+ // ### Variables: ###
+ po["WX_RELEASE_NODOT"] = cfg["WXVER_MAJOR"] + cfg["WXVER_MINOR"];
+ if (po["WX_RELEASE_NODOT"].empty())
+ po["WX_RELEASE_NODOT"] = "29";
+
+ // ### Conditionally set variables: ###
+ if (cfg["GCC_VERSION"] == "2.95")
+ po["GCCFLAGS"] = addFlag("-fvtable-thunks");
+
+ if (cfg["USE_GUI"] == "0")
+ po["PORTNAME"] = "base";
+
+ if (cfg["USE_GUI"] == "1")
+ po["PORTNAME"] = "msw";
+
+ if (cfg["BUILD"] == "debug" && cfg["DEBUG_FLAG"] == "default")
+ po["WXDEBUGFLAG"] = "";
+
+ if (cfg["DEBUG_FLAG"] == "1")
+ po["WXDEBUGFLAG"] = "";
+
+ if (cfg["UNICODE"] == "1")
+ po["WXUNICODEFLAG"] = "u";
+
+ if (cfg["WXUNIV"] == "1")
+ po["WXUNIVNAME"] = "univ";
+
+ if (cfg["SHARED"] == "1")
+ {
+ po["WXDLLFLAG"] = "dll";
+ po["LIBTYPE_SUFFIX"] = "dll";
+ }
+
+ if (cfg["SHARED"] == "0")
+ po["LIBTYPE_SUFFIX"] = "lib";
+
+ if (cfg["MONOLITHIC"] == "0")
+ po["EXTRALIBS_FOR_BASE"] = "";
+
+ if (cfg["MONOLITHIC"] == "1")
+ po["EXTRALIBS_FOR_BASE"] = "";
+
+ if (cfg["BUILD"] == "debug")
+ po["__OPTIMIZEFLAG_2"] = addFlag("-O0");
+
+ if (cfg["BUILD"] == "release")
+ po["__OPTIMIZEFLAG_2"] = addFlag("-O2");
+
+ if (cfg["USE_RTTI"] == "1")
+ po["__RTTIFLAG_5"] = addFlag("");
+
+ if (cfg["USE_EXCEPTIONS"] == "0")
+ po["__EXCEPTIONSFLAG_6"] = addFlag("-fno-exceptions");
+
+ if (cfg["USE_EXCEPTIONS"] == "1")
+ po["__EXCEPTIONSFLAG_6"] = addFlag("");
+
+ if (cfg["WXUNIV"] == "1")
+ po["__WXUNIV_DEFINE_p"] = addDefine("__WXUNIVERSAL__");
+
+ if (cfg["WXUNIV"] == "1")
+ po["__WXUNIV_DEFINE_p_1"] = addResDefine("__WXUNIVERSAL__");
+
+ if (cfg["BUILD"] == "debug" && cfg["DEBUG_FLAG"] == "default")
+ po["__DEBUG_DEFINE_p"] = addDefine("__WXDEBUG__");
+
+ if (cfg["DEBUG_FLAG"] == "1")
+ po["__DEBUG_DEFINE_p"] = addDefine("__WXDEBUG__");
+
+ if (cfg["BUILD"] == "debug" && cfg["DEBUG_FLAG"] == "default")
+ po["__DEBUG_DEFINE_p_1"] = addResDefine("__WXDEBUG__");
+
+ if (cfg["DEBUG_FLAG"] == "1")
+ po["__DEBUG_DEFINE_p_1"] = addResDefine("__WXDEBUG__");
+
+ if (cfg["USE_EXCEPTIONS"] == "0")
+ po["__EXCEPTIONS_DEFINE_p"] = addDefine("wxNO_EXCEPTIONS");
+
+ if (cfg["USE_EXCEPTIONS"] == "0")
+ po["__EXCEPTIONS_DEFINE_p_1"] = addResDefine("wxNO_EXCEPTIONS");
+
+ if (cfg["USE_RTTI"] == "0")
+ po["__RTTI_DEFINE_p"] = addDefine("wxNO_RTTI");
+
+ if (cfg["USE_RTTI"] == "0")
+ po["__RTTI_DEFINE_p_1"] = addResDefine("wxNO_RTTI");
+
+ if (cfg["USE_THREADS"] == "0")
+ po["__THREAD_DEFINE_p"] = addDefine("wxNO_THREADS");
+
+ if (cfg["USE_THREADS"] == "0")
+ po["__THREAD_DEFINE_p_1"] = addResDefine("wxNO_THREADS");
+
+ if (cfg["UNICODE"] == "1")
+ po["__UNICODE_DEFINE_p"] = addDefine("_UNICODE");
+
+ if (cfg["UNICODE"] == "1")
+ po["__UNICODE_DEFINE_p_1"] = addResDefine("_UNICODE");
+
+ if (cfg["MSLU"] == "1")
+ po["__MSLU_DEFINE_p"] = addDefine("wxUSE_UNICODE_MSLU=1");
+
+ if (cfg["MSLU"] == "1")
+ po["__MSLU_DEFINE_p_1"] = addResDefine("wxUSE_UNICODE_MSLU=1");
+
+ if (cfg["USE_GDIPLUS"] == "1")
+ po["__GFXCTX_DEFINE_p"] = addDefine("wxUSE_GRAPHICS_CONTEXT=1");
+
+ if (cfg["USE_GDIPLUS"] == "1")
+ po["__GFXCTX_DEFINE_p_1"] = addResDefine("wxUSE_GRAPHICS_CONTEXT=1");
+
+ if (cfg["SHARED"] == "1")
+ po["__DLLFLAG_p"] = addDefine("WXUSINGDLL");
+
+ if (cfg["SHARED"] == "1")
+ po["__DLLFLAG_p_1"] = addResDefine("WXUSINGDLL");
+
+ process_3(po, cl, cfg);
+ //----------------------------------------------------
+
+ if (cfg["BUILD"] == "debug" && cfg["DEBUG_INFO"] == "default")
+ po["__DEBUGINFO"] = addFlag("-g");
+
+ if (cfg["BUILD"] == "release" && cfg["DEBUG_INFO"] == "default")
+ po["__DEBUGINFO"] = addFlag("");
+
+ if (cfg["DEBUG_INFO"] == "0")
+ po["__DEBUGINFO"] = addFlag("");
+
+ if (cfg["DEBUG_INFO"] == "1")
+ po["__DEBUGINFO"] = addFlag("-g");
+
+ if (cfg["USE_THREADS"] == "0")
+ po["__THREADSFLAG"] = addFlag("");
+
+ if (cfg["USE_THREADS"] == "1")
+ po["__THREADSFLAG"] = addFlag("-mthreads");
+
+ //----------------------------------------------------
+
+ // ### Variables, Part 2: ###
+ po["LIBDIRNAME"] = po["prefix"] + "\\lib\\" + getName() + "_" + po["LIBTYPE_SUFFIX"] + cfg["CFG"];
+
+ po["SETUPHDIR"] = po["LIBDIRNAME"] + "\\" + po["PORTNAME"] + po["WXUNIVNAME"];
+ po["SETUPHDIR"] += po["WXUNICODEFLAG"] + po["WXDEBUGFLAG"];
+
+ po["cflags"] = easyMode(po["__DEBUGINFO"]) + easyMode(po["__OPTIMIZEFLAG_2"]) + po["__THREADSFLAG"];
+ po["cflags"] += po["GCCFLAGS"] + addDefine("HAVE_W32API_H") + addDefine("__WXMSW__") + po["__WXUNIV_DEFINE_p"];
+ po["cflags"] += po["__DEBUG_DEFINE_p"] + po["__EXCEPTIONS_DEFINE_p"] + po["__RTTI_DEFINE_p"];
+ po["cflags"] += po["__THREAD_DEFINE_p"] + po["__UNICODE_DEFINE_p"] + po["__MSLU_DEFINE_p"];
+ po["cflags"] += po["__GFXCTX_DEFINE_p"];
+ po["cflags"] += addIncludeDir(po["SETUPHDIR"]) + addIncludeDir(po["prefix"] + "\\include");/*-W */
+ po["cflags"] += easyMode(addFlag("-Wall")) + easyMode(addIncludeDir(".")) + po["__DLLFLAG_p"];
+ po["cflags"] += easyMode(addIncludeDir(".\\..\\..\\samples")) + /*addDefine("NOPCH") +*/ po["__RTTIFLAG_5"] + po["__EXCEPTIONSFLAG_6"];
+ po["cflags"] += addFlag("-Wno-ctor-dtor-privacy") + addFlag("-pipe") + addFlag("-fmessage-length=0");
+ po["cflags"] += addFlag("-Wl,--subsystem,windows") + addFlag("-mwindows") + addFlag("-Wl,--enable-auto-import");
+ po["cflags"] += cfg["CPPFLAGS"] + " " + cfg["CXXFLAGS"] + " ";
+
+ po["libs"] = cfg["LDFLAGS"] + " ";
+ po["libs"] += easyMode(po["__DEBUGINFO"]) + po["__THREADSFLAG"];
+ po["libs"] += addLinkerDir(po["LIBDIRNAME"]);
+ po["libs"] += easyMode(addFlag("-Wl,--subsystem,windows")) + easyMode(addFlag("-mwindows"));
+ po["libs"] += getAllLibs(po);
+
+ po["rcflags"] = addFlag("--use-temp-file") + addResDefine("__WXMSW__") + po["__WXUNIV_DEFINE_p_1"];
+ po["rcflags"] += po["__DEBUG_DEFINE_p_1"] + po["__EXCEPTIONS_DEFINE_p_1"];
+ po["rcflags"] += po["__RTTI_DEFINE_p_1"] + po["__THREAD_DEFINE_p_1"] + po["__UNICODE_DEFINE_p_1"];
+ po["rcflags"] += po["__MSLU_DEFINE_p_1"] + po["__GFXCTX_DEFINE_p_1"] + addResIncludeDir(po["SETUPHDIR"]);
+ po["rcflags"] += addResIncludeDir(po["prefix"] + "\\include") + easyMode(addResIncludeDir("."));
+ po["rcflags"] += po["__DLLFLAG_p_1"];
+ po["rcflags"] += easyMode(addResIncludeDir(po["prefix"] + "\\samples"));
+
+ po["release"] = cfg["WXVER_MAJOR"] + "." + cfg["WXVER_MINOR"];
+ po["version"] = cfg["WXVER_MAJOR"] + "." + cfg["WXVER_MINOR"] + "." + cfg["WXVER_RELEASE"];
+ po["basename"] = "wx" + po["PORTNAME"] + po["WXUNIVNAME"] + po["WX_RELEASE_NODOT"];
+ po["basename"] += po["WXUNICODEFLAG"] + po["WXDEBUGFLAG"] + cfg["WX_LIB_FLAVOUR"];
+ po["cc"] = m_programs.cc;
+ po["cxx"] = m_programs.cxx;
+ po["ld"] = m_programs.ld;
+
+ getVariablesValues(po, cl, cfg);
+ }
+};
+
+// -------------------------------------------------------------------------------------------------
+
+/// DMars compiler
+class CompilerDMC : public Compiler
+{
+public:
+ CompilerDMC() : Compiler("dmc")
+ {
+ m_programs.cc = "dmc";
+ m_programs.cxx = "dmc";
+ m_programs.ld = "link";
+ m_programs.lib = "lib";
+ m_programs.windres = "rcc";
+
+ m_switches.includeDirs = "-I";
+ m_switches.resIncludeDirs = "--include-dir"; ////////////
+ m_switches.libDirs = "";
+ m_switches.linkLibs = "";
+ m_switches.libPrefix = "";
+ m_switches.libExtension = "lib";
+ m_switches.defines = "-D";
+ m_switches.resDefines = "-D";//////////////////////////////////(doesnt uses space)
+ m_switches.genericSwitch = "-";
+ m_switches.forceCompilerUseQuotes = false;
+ m_switches.forceLinkerUseQuotes = true;
+ m_switches.linkerNeedsLibPrefix = false;
+ m_switches.linkerNeedsLibExtension = true;
+ }
+
+
+ void process(Options& po, const CmdLineOptions& cl)
+ {
+ /// Searchs for '<prefix>\build\msw\config.*' first
+ std::string cfg_first = po["prefix"] + "\\build\\msw\\config." + getName();
+
+ /// config.* options
+ BuildFileOptions cfg(cfg_first);
+
+ /// build.cfg options
+ cfg.parse(po["wxcfgfile"]);
+
+
+ // ### Variables: ###
+ po["WX_RELEASE_NODOT"] = cfg["WXVER_MAJOR"] + cfg["WXVER_MINOR"];
+ if (po["WX_RELEASE_NODOT"].empty())
+ po["WX_RELEASE_NODOT"] = "26";
+
+ // ### Conditionally set variables: ###
+ if (cfg["USE_GUI"] == "0")
+ po["PORTNAME"] = "base";
+
+ if (cfg["USE_GUI"] == "1")
+ po["PORTNAME"] = "msw";
+
+ if (cfg["BUILD"] == "debug" && cfg["DEBUG_FLAG"] == "default")
+ po["WXDEBUGFLAG"] = "d";
+
+ if (cfg["DEBUG_FLAG"] == "1")
+ po["WXDEBUGFLAG"] = "d";
+
+ if (cfg["UNICODE"] == "1")
+ po["WXUNICODEFLAG"] = "u";
+
+ if (cfg["WXUNIV"] == "1")
+ po["WXUNIVNAME"] = "univ";
+
+ if (cfg["SHARED"] == "1")
+ po["WXDLLFLAG"] = "dll";
+
+ if (cfg["SHARED"] == "0")
+ po["LIBTYPE_SUFFIX"] = "lib";
+
+ if (cfg["SHARED"] == "1")
+ po["LIBTYPE_SUFFIX"] = "dll";
+
+ if (cfg["MONOLITHIC"] == "0")
+ po["EXTRALIBS_FOR_BASE"] = "";
+
+ if (cfg["MONOLITHIC"] == "1")
+ po["EXTRALIBS_FOR_BASE"] = "";
+
+ //----------------------------------------------------
+
+ if (cfg["BUILD"] == "debug" && cfg["DEBUG_INFO"] == "default")
+ po["__DEBUGINFO_0"] = addFlag("-g");
+
+ if (cfg["BUILD"] == "release" && cfg["DEBUG_INFO"] == "default")
+ po["__DEBUGINFO_0"] = addFlag("");
+
+ if (cfg["DEBUG_INFO"] == "0")
+ po["__DEBUGINFO_0"] = addFlag("");
+
+ if (cfg["DEBUG_INFO"] == "1")
+ po["__DEBUGINFO_0"] = addFlag("-g");
+
+ if (cfg["BUILD"] == "debug" && cfg["DEBUG_INFO"] == "default")
+ po["__DEBUGINFO_1"] = addFlag("/DEBUG /CODEVIEW");
+
+ if (cfg["BUILD"] == "release" && cfg["DEBUG_INFO"] == "default")
+ po["__DEBUGINFO_1"] = addFlag("");
+
+ if (cfg["DEBUG_INFO"] == "0")
+ po["__DEBUGINFO_1"] = addFlag("");
+
+ if (cfg["DEBUG_INFO"] == "1")
+ po["__DEBUGINFO_1"] = addFlag("/DEBUG /CODEVIEW");
+ /*
+ if (cfg["BUILD"] == "debug" && cfg["DEBUG_RUNTIME_LIBS"] == "default")
+ po["____DEBUGRUNTIME_2_p"] = addDefine("_DEBUG");
+
+ if (cfg["BUILD"] == "release" && cfg["DEBUG_RUNTIME_LIBS"] == "default")
+ po["____DEBUGRUNTIME_2_p"] = addDefine("");
+
+ if (cfg["DEBUG_RUNTIME_LIBS"] == "0")
+ po["____DEBUGRUNTIME_2_p"] = addDefine("");
+
+ if (cfg["DEBUG_RUNTIME_LIBS"] == "1")
+ po["____DEBUGRUNTIME_2_p"] = addDefine("_DEBUG");
+
+ if (cfg["BUILD"] == "debug" && cfg["DEBUG_RUNTIME_LIBS"] == "default")
+ po["____DEBUGRUNTIME_2_p_1"] = addResDefine("_DEBUG");
+
+ if (cfg["BUILD"] == "release" && cfg["DEBUG_RUNTIME_LIBS"] == "default")
+ po["____DEBUGRUNTIME_2_p_1"] = addResDefine("");
+
+ if (cfg["DEBUG_RUNTIME_LIBS"] == "0")
+ po["____DEBUGRUNTIME_2_p_1"] = addResDefine("");
+
+ if (cfg["DEBUG_RUNTIME_LIBS"] == "1")
+ po["____DEBUGRUNTIME_2_p_1"] = addResDefine("_DEBUG");
+
+ if (cfg["BUILD"] == "debug" && cfg["DEBUG_RUNTIME_LIBS"] == "default")
+ po["__DEBUGRUNTIME_3"] = "d";
+
+ if (cfg["BUILD"] == "release" && cfg["DEBUG_RUNTIME_LIBS"] == "default")
+ po["__DEBUGRUNTIME_3"] = "";
+
+ if (cfg["DEBUG_RUNTIME_LIBS"] == "0")
+ po["__DEBUGRUNTIME_3"] = "";
+
+ if (cfg["DEBUG_RUNTIME_LIBS"] == "1")
+ po["__DEBUGRUNTIME_3"] = "d";
+ */
+ //----------------------------------------------------
+
+ if (cfg["BUILD"] == "debug")
+ po["__OPTIMIZEFLAG_4"] = addFlag("-o+none");//2
+
+ if (cfg["BUILD"] == "release")
+ po["__OPTIMIZEFLAG_4"] = addFlag("-o");//2
+ /*
+ if (cfg["USE_THREADS"] == "0")
+ po["__THREADSFLAG_7"] = "L";
+
+ if (cfg["USE_THREADS"] == "1")
+ po["__THREADSFLAG_7"] = "T";
+ */
+ if (cfg["RUNTIME_LIBS"] == "dynamic")
+ po["__RUNTIME_LIBS_8"] = "-ND";//5 // TODO: addFlag?
+
+ if (cfg["RUNTIME_LIBS"] == "static")
+ po["__RUNTIME_LIBS_8"] = "";//5
+
+ //----------------------------------------------------
+
+ if (cfg["USE_RTTI"] == "0")
+ po["__RTTIFLAG_9"] = addFlag("");//6
+
+ if (cfg["USE_RTTI"] == "1")
+ po["__RTTIFLAG_9"] = addFlag("-Ar");//6
+
+ if (cfg["USE_EXCEPTIONS"] == "0")
+ po["__EXCEPTIONSFLAG_10"] = addFlag("");//7
+
+ if (cfg["USE_EXCEPTIONS"] == "1")
+ po["__EXCEPTIONSFLAG_10"] = addFlag("-Ae");//7
+
+ //----------------------------------------------------
+ /*
+ if (cfg["BUILD"] == "debug" && cfg["DEBUG_RUNTIME_LIBS"] == "0")
+ po["__NO_VC_CRTDBG_p"] = addDefine("__NO_VC_CRTDBG__");
+
+ if (cfg["BUILD"] == "release" && cfg["DEBUG_FLAG"] == "1")
+ po["__NO_VC_CRTDBG_p"] = addDefine("__NO_VC_CRTDBG__");
+
+ if (cfg["BUILD"] == "debug" && cfg["DEBUG_RUNTIME_LIBS"] == "0")
+ po["__NO_VC_CRTDBG_p_1"] = addResDefine("__NO_VC_CRTDBG__");
+
+ if (cfg["BUILD"] == "release" && cfg["DEBUG_FLAG"] == "1")
+ po["__NO_VC_CRTDBG_p_1"] = addResDefine("__NO_VC_CRTDBG__");
+ */
+ if (cfg["WXUNIV"] == "1")
+ po["__WXUNIV_DEFINE_p"] = addDefine("__WXUNIVERSAL__");
+ /*
+ if (cfg["WXUNIV"] == "1")
+ po["__WXUNIV_DEFINE_p_1"] = addResDefine("__WXUNIVERSAL__");
+ */
+ if (cfg["BUILD"] == "debug" && cfg["DEBUG_FLAG"] == "default")
+ po["__DEBUG_DEFINE_p"] = addDefine("__WXDEBUG__");
+
+ if (cfg["DEBUG_FLAG"] == "1")
+ po["__DEBUG_DEFINE_p"] = addDefine("__WXDEBUG__");
+ /*
+ if (cfg["BUILD"] == "debug" && cfg["DEBUG_FLAG"] == "default")
+ po["__DEBUG_DEFINE_p_1"] = addResDefine("__WXDEBUG__");
+
+ if (cfg["DEBUG_FLAG"] == "1")
+ po["__DEBUG_DEFINE_p_1"] = addResDefine("__WXDEBUG__");
+ */
+ if (cfg["USE_EXCEPTIONS"] == "0")
+ po["__EXCEPTIONS_DEFINE_p"] = addDefine("wxNO_EXCEPTIONS");
+ /*
+ if (cfg["USE_EXCEPTIONS"] == "0")
+ po["__EXCEPTIONS_DEFINE_p_1"] = addResDefine("wxNO_EXCEPTIONS");
+ */
+ if (cfg["USE_RTTI"] == "0")
+ po["__RTTI_DEFINE_p"] = addDefine("wxNO_RTTI");
+ /*
+ if (cfg["USE_RTTI"] == "0")
+ po["__RTTI_DEFINE_p_1"] = addResDefine("wxNO_RTTI");
+ */
+ if (cfg["USE_THREADS"] == "0")
+ po["__THREAD_DEFINE_p"] = addDefine("wxNO_THREADS");
+ /*
+ if (cfg["USE_THREADS"] == "0")
+ po["__THREAD_DEFINE_p_1"] = addResDefine("wxNO_THREADS");
+ */
+ if (cfg["UNICODE"] == "1")
+ po["__UNICODE_DEFINE_p"] = addDefine("_UNICODE");
+ /*
+ if (cfg["UNICODE"] == "1")
+ po["__UNICODE_DEFINE_p_1"] = addResDefine("_UNICODE");
+ */
+ if (cfg["MSLU"] == "1")
+ po["__MSLU_DEFINE_p"] = addDefine("wxUSE_UNICODE_MSLU=1");
+ /*
+ if (cfg["MSLU"] == "1")
+ po["__MSLU_DEFINE_p_1"] = addResDefine("wxUSE_UNICODE_MSLU=1");
+ */
+ if (cfg["USE_GDIPLUS"] == "1")
+ po["__GFXCTX_DEFINE_p"] = addDefine("wxUSE_GRAPHICS_CONTEXT=1");
+ /*
+ if (cfg["USE_GDIPLUS"] == "1")
+ po["__GFXCTX_DEFINE_p_1"] = addResDefine("wxUSE_GRAPHICS_CONTEXT=1");
+ */
+ if (cfg["SHARED"] == "1")
+ po["__DLLFLAG_p"] = addDefine("WXUSINGDLL");
+ /*
+ if (cfg["SHARED"] == "1")
+ po["__DLLFLAG_p_1"] = addResDefine("WXUSINGDLL");
+ */
+ process_3(po, cl, cfg);
+
+
+ // ### Variables, Part 2: ###
+ po["LIBDIRNAME"] = po["prefix"] + "\\lib\\" + getName() + "_" + po["LIBTYPE_SUFFIX"] + cfg["CFG"];
+
+ po["SETUPHDIR"] = po["LIBDIRNAME"] + "\\" + po["PORTNAME"] + po["WXUNIVNAME"];
+ po["SETUPHDIR"] += po["WXUNICODEFLAG"] + po["WXDEBUGFLAG"];
+
+ po["cflags"] = easyMode(po["__DEBUGINFO_0"]) + easyMode(po["__OPTIMIZEFLAG_4"]);
+ po["cflags"] += po["__RUNTIME_LIBS_8"] + " " + addDefine("_WIN32_WINNT=0x0400");
+ po["cflags"] += addDefine("__WXMSW__") + po["__WXUNIV_DEFINE_p"];
+ po["cflags"] += po["__DEBUG_DEFINE_p"] + po["__EXCEPTIONS_DEFINE_p"] + po["__RTTI_DEFINE_p"];
+ po["cflags"] += po["__THREAD_DEFINE_p"] + po["__UNICODE_DEFINE_p"] + po["__MSLU_DEFINE_p"];
+ po["cflags"] += po["__GFXCTX_DEFINE_p"];
+ po["cflags"] += addIncludeDir(po["SETUPHDIR"]) + addIncludeDir(po["prefix"] + "\\include") + easyMode(addFlag("-w-")) + easyMode(addIncludeDir(".")) + po["__DLLFLAG_p"] + easyMode(addFlag("-WA"));
+ po["cflags"] += easyMode(addIncludeDir(po["prefix"] + "\\samples")) + easyMode(addDefine("NOPCH")) + po["__RTTIFLAG_9"] + po["__EXCEPTIONSFLAG_10"];
+ po["cflags"] += cfg["CPPFLAGS"] + " " + cfg["CXXFLAGS"] + " ";
+
+
+
+ po["libs"] = easyMode(addFlag("/NOLOGO")) + easyMode(addFlag("/SILENT"));
+ po["libs"] += easyMode(addFlag("/NOI")) + easyMode(addFlag("/DELEXECUTABLE"));
+ po["libs"] += easyMode(addFlag("/EXETYPE:NT"));
+ po["libs"] += cfg["LDFLAGS"] + " ";
+ po["libs"] += easyMode(po["__DEBUGINFO_1"]);
+ po["libs"] += addLinkerDir(po["LIBDIRNAME"] + "\\");
+ po["libs"] += easyMode(addFlag("/su:windows:4.0"));
+ po["libs"] += getAllLibs(po);
+
+ po["rcflags"] = addResDefine("_WIN32_WINNT=0x0400") + addResDefine("__WXMSW__");
+ po["rcflags"] += po["__WXUNIV_DEFINE_p"] + po["__DEBUG_DEFINE_p"] + po["__EXCEPTIONS_DEFINE_p"];
+ po["rcflags"] += po["__RTTI_DEFINE_p"] + po["__THREAD_DEFINE_p"] + po["__UNICODE_DEFINE_p"];
+ po["rcflags"] += po["__MSLU_DEFINE_p"] + po["__GFXCTX_DEFINE_p"] + addResIncludeDir(po["SETUPHDIR"]);
+ po["rcflags"] += addResIncludeDir(po["prefix"] + "\\include") + easyMode(addResIncludeDir("."));
+ po["rcflags"] += po["__DLLFLAG_p"];
+ po["rcflags"] += easyMode(addResIncludeDir(po["prefix"] + "\\samples"));
+ po["rcflags"] += easyMode(addFlag("-32")) + easyMode(addFlag("-v-"));
+
+
+ po["release"] = cfg["WXVER_MAJOR"] + "." + cfg["WXVER_MINOR"];
+ po["version"] = cfg["WXVER_MAJOR"] + "." + cfg["WXVER_MINOR"] + "." + cfg["WXVER_RELEASE"];
+ po["basename"] = "wx" + po["PORTNAME"] + po["WXUNIVNAME"] + po["WX_RELEASE_NODOT"];
+ po["basename"] += po["WXUNICODEFLAG"] + po["WXDEBUGFLAG"] + cfg["WX_LIB_FLAVOUR"];
+ po["cc"] = m_programs.cc;
+ po["cxx"] = m_programs.cxx;
+ po["ld"] = m_programs.ld;
+
+ getVariablesValues(po, cl, cfg);
+ }
+
+};
+
+// -------------------------------------------------------------------------------------------------
+
+/// Visual Studio compiler
+class CompilerVC : public Compiler
+{
+public:
+ CompilerVC() : Compiler("vc")
+ {
+ m_programs.cc = "cl";
+ m_programs.cxx = "cl";
+ m_programs.ld = "link";
+ m_programs.lib = "link";
+ m_programs.windres = "rc";
+
+ m_switches.includeDirs = "/I";
+ m_switches.resIncludeDirs = "--include-dir"; ////////////
+ m_switches.libDirs = "/LIBPATH:";
+ m_switches.linkLibs = "";
+ m_switches.libPrefix = "";
+ m_switches.libExtension = "lib";
+ m_switches.defines = "/D";
+ m_switches.resDefines = "/d";
+ m_switches.genericSwitch = "/";
+ m_switches.forceCompilerUseQuotes = false;
+ m_switches.forceLinkerUseQuotes = false;
+ m_switches.linkerNeedsLibPrefix = false;
+ m_switches.linkerNeedsLibExtension = true;
+ }
+
+ void process(Options& po, const CmdLineOptions& cl)
+ {
+ /// Searchs for '<prefix>\build\msw\config.*' first
+ std::string cfg_first = po["prefix"] + "\\build\\msw\\config." + getName();
+
+ /// config.* options
+ BuildFileOptions cfg(cfg_first);
+
+ /// build.cfg options
+ cfg.parse(po["wxcfgfile"]);
+
+
+ // ### Variables: ###
+ po["WX_RELEASE_NODOT"] = cfg["WXVER_MAJOR"] + cfg["WXVER_MINOR"];
+ if (po["WX_RELEASE_NODOT"].empty())
+ po["WX_RELEASE_NODOT"] = "26";
+
+ // ### Conditionally set variables: ###
+ if (cfg["USE_GUI"] == "0")
+ po["PORTNAME"] = "base";
+
+ if (cfg["USE_GUI"] == "1")
+ po["PORTNAME"] = "msw";
+
+ if (cfg["BUILD"] == "debug" && cfg["DEBUG_FLAG"] == "default")
+ po["WXDEBUGFLAG"] = "d";
+
+ if (cfg["DEBUG_FLAG"] == "1")
+ po["WXDEBUGFLAG"] = "d";
+
+ if (cfg["UNICODE"] == "1")
+ po["WXUNICODEFLAG"] = "u";
+
+ if (cfg["WXUNIV"] == "1")
+ po["WXUNIVNAME"] = "univ";
+
+ if (cfg["SHARED"] == "1")
+ po["WXDLLFLAG"] = "dll";
+
+ if (cfg["SHARED"] == "0")
+ po["LIBTYPE_SUFFIX"] = "lib";
+
+ if (cfg["SHARED"] == "1")
+ po["LIBTYPE_SUFFIX"] = "dll";
+
+ if (cfg["MONOLITHIC"] == "0")
+ po["EXTRALIBS_FOR_BASE"] = "";
+
+ if (cfg["MONOLITHIC"] == "1")
+ po["EXTRALIBS_FOR_BASE"] = "";
+
+ if (cfg["TARGET_CPU"] == "amd64")
+ po["DIR_SUFFIX_CPU"] = "_amd64";
+
+ if (cfg["TARGET_CPU"] == "ia64")
+ po["DIR_SUFFIX_CPU"] = "_ia64";
+
+ // TODO: TARGET_CPU uses $(CPU), so it will be ignored unless explicitely specified
+ if (cfg["TARGET_CPU"] == "$(CPU)")
+ po["LINK_TARGET_CPU"] = "";
+
+ if (cfg["TARGET_CPU"] == "amd64")
+ po["LINK_TARGET_CPU"] = addFlag("/MACHINE:AMD64");
+
+ if (cfg["TARGET_CPU"] == "ia64")
+ po["LINK_TARGET_CPU"] = addFlag("/MACHINE:IA64");
+
+ //----------------------------------------------------
+
+ if (cfg["BUILD"] == "debug" && cfg["DEBUG_INFO"] == "default")
+ po["__DEBUGINFO_0"] = addFlag("/Zi");
+
+ if (cfg["BUILD"] == "release" && cfg["DEBUG_INFO"] == "default")
+ po["__DEBUGINFO_0"] = addFlag("");
+
+ if (cfg["DEBUG_INFO"] == "0")
+ po["__DEBUGINFO_0"] = addFlag("");
+
+ if (cfg["DEBUG_INFO"] == "1")
+ po["__DEBUGINFO_0"] = addFlag("/Zi");
+
+ if (cfg["BUILD"] == "debug" && cfg["DEBUG_INFO"] == "default")
+ po["__DEBUGINFO_1"] = addFlag("/DEBUG");
+
+ if (cfg["BUILD"] == "release" && cfg["DEBUG_INFO"] == "default")
+ po["__DEBUGINFO_1"] = addFlag("");
+
+ if (cfg["DEBUG_INFO"] == "0")
+ po["__DEBUGINFO_1"] = addFlag("");
+
+ if (cfg["DEBUG_INFO"] == "1")
+ po["__DEBUGINFO_1"] = addFlag("/DEBUG");
+
+ if (cfg["BUILD"] == "debug" && cfg["DEBUG_RUNTIME_LIBS"] == "default")
+ po["____DEBUGRUNTIME_2_p"] = addDefine("_DEBUG");
+
+ if (cfg["BUILD"] == "release" && cfg["DEBUG_RUNTIME_LIBS"] == "default")
+ po["____DEBUGRUNTIME_2_p"] = addDefine("");
+
+ if (cfg["DEBUG_RUNTIME_LIBS"] == "0")
+ po["____DEBUGRUNTIME_2_p"] = addDefine("");
+
+ if (cfg["DEBUG_RUNTIME_LIBS"] == "1")
+ po["____DEBUGRUNTIME_2_p"] = addDefine("_DEBUG");
+
+ if (cfg["BUILD"] == "debug" && cfg["DEBUG_RUNTIME_LIBS"] == "default")
+ po["____DEBUGRUNTIME_2_p_1"] = addResDefine("_DEBUG");