2016-02-02 05:59:32 +03:00
|
|
|
Configuration of the ABI version for the Fast Light Toolkit (FLTK)
|
|
|
|
------------------------------------------------------------------
|
|
|
|
|
|
|
|
FLTK preserves the application binary interface (ABI) throughout
|
|
|
|
patch versions, for instance all 1.3.x versions (x = patch version).
|
|
|
|
|
|
|
|
This basically means that a program compiled and linked with FLTK 1.3.0
|
2016-07-09 21:47:06 +03:00
|
|
|
can run with a FLTK shared library (fltk.dll, fltk.so.1.3.x) of a later
|
2016-11-19 04:20:53 +03:00
|
|
|
FLTK version 1.3.x, but not with a shared library of FLTK 1.4.0 or later.
|
2016-02-02 05:59:32 +03:00
|
|
|
|
|
|
|
Since FLTK 1.3.1 the FLTK team began to introduce ABI-breaking features
|
|
|
|
wrapped in so-called ABI guards in the library code, e.g.
|
|
|
|
|
2016-11-19 04:20:53 +03:00
|
|
|
#if FL_ABI_VERSION >= 10401
|
2020-07-01 19:03:10 +03:00
|
|
|
... new, ABI breaking code ...
|
2016-11-19 04:20:53 +03:00
|
|
|
#else
|
2020-07-01 19:03:10 +03:00
|
|
|
... old, ABI preserving code ...
|
2016-11-19 04:20:53 +03:00
|
|
|
#endif
|
2016-02-02 05:59:32 +03:00
|
|
|
|
2020-07-01 19:03:10 +03:00
|
|
|
Note: In FLTK 1.3.x this preprocessor macro was named FLTK_ABI_VERSION.
|
|
|
|
In FLTK 1.4.0 FLTK_ABI_VERSION was renamed to FL_ABI_VERSION.
|
2016-11-19 04:20:53 +03:00
|
|
|
|
|
|
|
This documentation is written for FLTK 1.4.x, but it applies to all later
|
|
|
|
versions as well. Replace the version numbers given here with the version
|
|
|
|
numbers of the version you are using. FLTK version 1.4.1 was chosen as an
|
|
|
|
example only. As of this writing, FLTK 1.4.1 does not yet exist.
|
2016-02-02 05:59:32 +03:00
|
|
|
|
|
|
|
|
|
|
|
How to define the FLTK ABI version
|
|
|
|
----------------------------------
|
|
|
|
|
|
|
|
To define the ABI version the preprocessor macro FL_ABI_VERSION must be
|
|
|
|
defined as a number representing the ABI version in the form
|
|
|
|
|
2016-11-19 04:20:53 +03:00
|
|
|
#define FL_ABI_VERSION 1xxyy
|
2016-02-02 05:59:32 +03:00
|
|
|
|
|
|
|
where xx and yy are the minor and patch versions, resp. with leading zeroes,
|
|
|
|
and '1' is the major version number.
|
|
|
|
|
2016-02-02 06:22:46 +03:00
|
|
|
The default ABI version for all FLTK 1.4.x versions is 10400 (the binary
|
|
|
|
version of FLTK 1.4.0), but you can configure another version, e.g.
|
2016-11-19 04:20:53 +03:00
|
|
|
10401 for FLTK 1.4.1 to enable the ABI features of FLTK 1.4.1 and all
|
2016-02-02 05:59:32 +03:00
|
|
|
previous versions. See CHANGES file.
|
|
|
|
|
|
|
|
|
2016-02-02 06:22:46 +03:00
|
|
|
Depending on how you build FLTK, there are two different ways to configure
|
|
|
|
the ABI version. The default is always the lowest version (e.g. 10400). All
|
2016-11-19 04:20:53 +03:00
|
|
|
following examples are written for FLTK 1.4.1, hence we use "10401" for
|
2016-02-02 05:59:32 +03:00
|
|
|
the version number.
|
|
|
|
|
|
|
|
|
|
|
|
(1) Traditional configure + make (Unix, Linux, MinGW etc.)
|
|
|
|
----------------------------------------------------------
|
|
|
|
|
2016-11-19 04:20:53 +03:00
|
|
|
Run
|
2020-07-01 19:03:10 +03:00
|
|
|
make clean
|
|
|
|
./configure --with-abiversion=10401
|
|
|
|
make
|
2016-02-02 05:59:32 +03:00
|
|
|
|
2016-11-19 04:20:53 +03:00
|
|
|
This will generate FL/abi-version.h and build FLTK as usual.
|
2016-02-02 05:59:32 +03:00
|
|
|
|
2019-01-19 19:20:05 +03:00
|
|
|
Note: you should always make sure that you compile everything from
|
|
|
|
scratch if you change the ABI version or any other configuration
|
|
|
|
options, e.g. with `make clean'.
|
2016-02-02 05:59:32 +03:00
|
|
|
|
|
|
|
(2) CMake + make
|
|
|
|
----------------
|
|
|
|
|
2016-11-19 04:20:53 +03:00
|
|
|
FLTK versions 1.4.0 and later contain full CMake support.
|
2016-02-02 05:59:32 +03:00
|
|
|
|
2016-11-19 04:20:53 +03:00
|
|
|
Use CMake to build the Makefile's and run 'make'. To configure the
|
2017-07-05 20:15:16 +03:00
|
|
|
ABI version, use ccmake, cmake-gui, or run cmake with the following
|
2016-11-19 04:20:53 +03:00
|
|
|
command:
|
2016-02-02 05:59:32 +03:00
|
|
|
|
2020-07-01 19:03:10 +03:00
|
|
|
cmake -D OPTION_ABI_VERSION:STRING=10401 /path/to/fltk
|
2017-07-05 20:15:16 +03:00
|
|
|
|
|
|
|
Then execute
|
|
|
|
|
2020-07-01 19:03:10 +03:00
|
|
|
make
|
2016-02-02 05:59:32 +03:00
|
|
|
|
2016-11-19 04:20:53 +03:00
|
|
|
You can define OPTION_ABI_VERSION to the required version number using
|
|
|
|
one of the graphical CMake tools.
|
2016-02-02 05:59:32 +03:00
|
|
|
|
2016-11-19 04:20:53 +03:00
|
|
|
For more information on how to use CMake with FLTK see README.CMake.txt.
|
2016-02-02 05:59:32 +03:00
|
|
|
|
|
|
|
|
2016-02-02 06:22:46 +03:00
|
|
|
(3) CMake + IDE Projects: Visual C++, Xcode, other IDE's
|
|
|
|
--------------------------------------------------------
|
2016-02-02 05:59:32 +03:00
|
|
|
|
2016-11-19 04:20:53 +03:00
|
|
|
FLTK versions 1.4.0 and later contain full CMake support.
|
2016-02-02 05:59:32 +03:00
|
|
|
|
2016-11-19 04:20:53 +03:00
|
|
|
IDE project files are no longer included in the FLTK source distribution.
|
|
|
|
You need to install CMake to generate the IDE files.
|
2016-02-02 05:59:32 +03:00
|
|
|
|
2016-11-19 04:20:53 +03:00
|
|
|
Use CMake to generate the IDE project files of your choice. Currently
|
|
|
|
the FLTK team uses some Visual C++ (Visual Studio) versions and Xcode.
|
|
|
|
Other IDE's may work as well (not yet tested).
|
2016-02-02 05:59:32 +03:00
|
|
|
|
2016-11-19 04:20:53 +03:00
|
|
|
For more informations on how to install and use CMake see ...
|
|
|
|
... *FIXME* [Add documentation how to use CMake with FLTK].
|
2016-02-02 06:22:46 +03:00
|
|
|
|
|
|
|
|
2016-11-19 04:20:53 +03:00
|
|
|
Use CMake option OPTION_ABI_VERSION:STRING=10401 with the command line
|
2017-07-05 20:15:16 +03:00
|
|
|
or set OPTION_ABI_VERSION with one of the CMake GUI programs.
|
2016-02-02 05:59:32 +03:00
|
|
|
|
2016-11-19 04:20:53 +03:00
|
|
|
Then start the build process in the IDE solution of your choice. This
|
|
|
|
will run the build with the defined ABI version.
|
2016-02-02 05:59:32 +03:00
|
|
|
|
|
|
|
|
2016-02-02 06:22:46 +03:00
|
|
|
General note on CMake:
|
|
|
|
----------------------
|
2016-02-02 05:59:32 +03:00
|
|
|
|
2016-11-19 04:20:53 +03:00
|
|
|
CMake generates FL/abi-version.h in the build tree. You may run
|
|
|
|
'make install' to install the FLTK library including all headers in
|
|
|
|
the chosen installation directory, although this is not necessary.
|
|
|
|
|
|
|
|
The FLTK team recommends to use the FLTK library directly from the
|
|
|
|
build folder. See README.CMake.txt for more information.
|
2016-02-02 05:59:32 +03:00
|
|
|
|
2016-11-19 04:20:53 +03:00
|
|
|
Possible exception: Visual Studio IDE builds (Windows).
|
2016-02-02 06:22:46 +03:00
|
|
|
|
2016-11-19 04:20:53 +03:00
|
|
|
... to be continued ...
|