This document describes how to build wxStEdit using gcc, mingw, Microsoft
Visual Studio, and a variety of other compilers. Please see the section 
appropriate for your compiler to learn how to build the wxStEdit library
and sample executable.

You must have a working copy of a development library of wxWidgets before
proceding. This means that you have either shared (.so in Linux, .dll in MSW)
or static (.a in Linux, .lib in MSW) libraries and the headers for them.

NOTE: You must always use the same ANSI/Unicode settings to build wxStEdit
as your development build of wxWidgets.

MSW NOTE: You must always use the same Debug/Release settings to build 
wxStEdit as your development build of wxWidgets. Otherwise you will have
strange linking errors/warnings about using /NODEFAULTLIB:MSVCRT(D).lib

=============================================================================
= GCC/GMake compatible Makefiles using the wx-config script (Linux, Mingw)
=============================================================================

Requirements: GCC, GMake, and wx-config script from a wxWidgets devel library
Platforms   : Unix, Cygwin, or using Mingw in MSW
Build Types : Identical settings as your wxWidgets lib since all settings
              are taken from the wx-config script in your path

These Makefiles are easy to understand, use, customize on the command line, 
or modify. The wx-config script should have been generated by a successful 
wxWidgets build or is provided in the devel wxWidgets library package that 
you should be able to install from your Linux distributer.

Please test that your wx-config script is in your path by running:
$ wx-config --help
$ wx-config --prefix  # this will tell you what wxWidgets it uses

These are the Makefiles: (read them to see the available targets)

Makefile.wx-config       # The 'all' target calls the two Makefiles below
src/Makefile             # Builds static/shared libwxcode_gtk2ud_stedit-X.Y.a
                         # and .so libs in the lib/ directory.
/samples/stedit/Makefile # Build the sample editor linking to above libs in the
                         # samples/stedit/ directory

Run these Makefiles in the directory where they exist.                
                         
You can override where the wx-config script is located, if it is not in your
path or you wish to use an alternate wxWidgets build, by running:

$ make -f Makefile.wx-config WXCONFIG=/path/to/wxWidgets/.../wx-config

=============================================================================
= Bakefile generated build files (for all compilers and OSes)
=============================================================================

Requirements: Compilers MSVC, BCC, Watcom, or GCC
Platforms   : MSW, Unix, Cygwin, or using Mingw in MSW
Build Types : The project files have a variety of pre-made configurations. 
              The Makefile options allow you to specify one to match your 
              wxWidgets build

These build files are generated by the wxstedit.bkl file by Bakefile. They are
compatible with most wxWidgets library builds and support the widest variety 
of compilers. They target wxWidgets 2.8.

The files created by Bakefile are in the build/ directory:
    ../Makefile.in      # Makefile for configure script
    autoconf_inc.m4     # m4 file for aclocal used to generate configure script
    GNUmakefile         # make -f GNUMakefile (for Unix systems)
    makefile.bcc        # Borland C++ compiler
    makefile.gcc        # make -f makefile.gcc (for mingw on MSW)
    makefile.vc         # nmake -f makefile.vc (for Visual Studio nmake.exe)
    makefile.wat        # Watcom makefile
    wxstedit_vc2003.sln             # Visual Studio 2003 solution
    wxstedit_vc2003_stedit.vcproj   
    wxstedit_vc2003_wxstedit.vcproj 
    wxstedit_vc2005.sln             # Visual Studio 2005 solution
    wxstedit_vc2005_stedit.vcproj
    wxstedit_vc2005_wxstedit.vcproj
    wxstedit_vc2008.sln             # Visual Studio 2008 solution
    wxstedit_vc2008_stedit.vcproj
    wxstedit_vc2008_wxstedit.vcproj
    wxstedit_vc6.dsw                # Visual Studio 6 workspace
    wxstedit_vc6_stedit.dsp
    wxstedit_vc6_wxstedit.dsp

-----------------------------------------------------------------------------

The GNUMakefile and the makefile.bcc/gcc/vc/wat files have their options at the
top. Please view the file to understand how to configure these Makefiles to
match your build of wxWidgets. 
For example: 
    $ nmake -f makefile.vc WX_SHARED=0 WX_UNICODE=0 WX_DEBUG=0 SHARED=0
Builds a static stedit lib and links to a static, ANSI, release wxWidgets lib.

Before running the Visual Studio nmake.exe program in a DOS prompt you must 
first run vcvars32.bat which for MSVS2008 is installed by default to this dir.
c:\Program Files\Microsoft Visual Studio 2008\VC\bin\vcvars32.bat

If you get an error about nmake.exe not being found, you need to (re)run
vcvars32.bat.

-----------------------------------------------------------------------------

The Visual Studio projects (*.sln and *.dsw) are fairly straightforward. 
You must set the environment variable WXWIN=c:\path\to\wxWidgets before 
starting MSVS. Then open the .sln or .dsw appropriate for the version of 
MSVS you have and select the desired build type that matches what you have 
already built in the $(WXWIN) dir.

At first glance there is a bewildering array of build types, but rest
assured that once you pick how you want to (or have) build wxWidgets your
choice of how to build wxStEdit is fairly narrow.

If you get an error about a missing setup.h file then you have probably
selected a wxStEdit build configuration that you don't have a matching
wxWidgets build configuration. The wxWidget's setup.h files per configuration
are located in wxWidgets\lib\[vc_lib,vc_dll,etc]\msw\wx\setup.h

The available configurations are all combinations of:

wxWidgets    wxWidgets      wxWidgets       wxWidgets             wxStEdit
[DLL/Static] [ANSI/Unicode] [Debug/Release] [Monolithic/Multilib] [DLL/Static] 

where the "wxWidgets" title above means that the config must match the 
wxWidgets build and the "wxStEdit" title above means that wxStEdit will be 
built as either a DLL or a static lib.

Recommended build settings for wxWidgets 2.8 are:

wxWidgets: [Debug]   --> wxStedit: [Static ANSI Debug   Multilib Static] 
wxWidgets: [Release] --> wxStedit: [Static ANSI Release Multilib Static] 
wxWidgets: [Unicode Debug]   --> wxStedit: [Static Unicode Debug   Multilib Static] 
wxWidgets: [Unicode Release] --> wxStedit: [Static Unicode Release Multilib Static] 

wxWidgets: [DLL Debug]   --> wxStedit: [DLL ANSI Debug   Multilib Static] 
wxWidgets: [DLL Release] --> wxStedit: [DLL ANSI Release Multilib Static] 
wxWidgets: [DLL Unicode Debug]   --> wxStedit: [DLL Unicode Debug   Multilib Static] 
wxWidgets: [DLL Unicode Release] --> wxStedit: [DLL Unicode Release Multilib Static] 

The only way to use the Monolithic wxWidgets libraries with wxStEdit is if you 
have compiled wxWidgets using nmake.exe and 
wxWidget/build/msw/makefile.vc with MONOLITHIC=1
The monolithic build only makes sense for DLL builds since it allows you to 
provide your app with fewer wxWidgets DLLs. A monolithic static build takes
longer to link so there's no reason to use it.

=============================================================================
= Bakefile files used to regenerate the above build files
=============================================================================

Users of the wxStEdit library will NOT normally ever need to regenerate
the build files using Bakefile.

The files for bakefile are:
    Bakefile.bkgen # edit to point to wxstedit.bkl, bakefile_gen reads this
    wxstedit.bkl   # main bakefile 
    configure.ac   # copied from wxCode/build/autoconf and edit version at least
    config.sub     # copied from wxCode/build/autoconf
    config.guess   # copied from wxCode/build/autoconf
    install.sh     # copied from wxCode/build/autoconf
    acregen.sh     # copied from wxCode/build/autoconf

Minimal Bakefile version is 0.2.9.

Rerun bakefile_gen in the stedit/build directory to recreate the make/project 
    files in a Bash or DOS prompt. Note: cygwin shell doesn't work properly.
    e.g. "c:\Program Files\Bakefile\src\bakefile_gen"

To do a full rebuild you need to run bakefile_gen in Linux so you can also
   run acregen.sh.

   To be sure that the correct *.m4 files are used when you run aclocal.
   $acregen.sh "--acdir=/path/to/new/bakefile-x.y.z/share/aclocal"

   NOTE: If you are using the system bakefile then you may simply call the
   acregen.sh script which calls aclocal && autoconf && mv configure ..
   However, it is unlikely that your Linux distribution will have a new enough
   Bakefile so you will probably have to build it yourself.
