mirror of
https://github.com/fltk/fltk.git
synced 2025-12-06 10:12:13 +08:00
Remove 'configure' from README's and sources (partially)
More to come...
This commit is contained in:
@@ -2,14 +2,15 @@ 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).
|
||||
patch versions, for instance all 1.4.x versions (x = patch version).
|
||||
|
||||
This basically means that a program compiled and linked with FLTK 1.3.0
|
||||
can run with a FLTK shared library (fltk.dll, fltk.so.1.3.x) of a later
|
||||
FLTK version 1.3.x, but not with a shared library of FLTK 1.4.0 or later.
|
||||
This basically means that a program compiled and linked with FLTK 1.4.0
|
||||
can run with a FLTK shared library (fltk.dll, fltk.so.1.4.x) of a later
|
||||
FLTK version 1.4.x, but not with a shared library of FLTK 1.5.0 or later.
|
||||
|
||||
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.
|
||||
wrapped in so-called ABI guards in the library code, using a preprocessor
|
||||
macro. Since FLTK 1.4.0 the macro name is FL_ABI_VERSION:
|
||||
|
||||
#if FL_ABI_VERSION >= 10401
|
||||
... new, ABI breaking code ...
|
||||
@@ -17,10 +18,7 @@ wrapped in so-called ABI guards in the library code, e.g.
|
||||
... old, ABI preserving code ...
|
||||
#endif
|
||||
|
||||
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.
|
||||
|
||||
This documentation is written for FLTK 1.4.x, but it applies to all later
|
||||
This documentation was 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.
|
||||
@@ -35,78 +33,45 @@ defined as a number representing the ABI version in the form
|
||||
#define FL_ABI_VERSION 1xxyy
|
||||
|
||||
where xx and yy are the minor and patch versions, resp. with leading zeroes,
|
||||
and '1' is the major version number.
|
||||
and '1' is the major version number. CMake generates the file FL/fl_config.h
|
||||
in the build folder given the version you select (see below).
|
||||
|
||||
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.
|
||||
10401 for FLTK 1.4.1 to enable the ABI features of FLTK 1.4.1 and all
|
||||
previous versions. See CHANGES.txt.
|
||||
For instance, the default ABI version for all FLTK 1.4.x versions is 10400
|
||||
(the binary version of FLTK 1.4.0) but you can select another version,
|
||||
e.g. 10401 for FLTK 1.4.1 to enable the ABI features of FLTK 1.4.1 and all
|
||||
previous versions. The same applies to all higher FLTK versions.
|
||||
|
||||
|
||||
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
|
||||
The default ABI version is always the lowest version (e.g. 10400). All
|
||||
following examples are written for FLTK 1.4.1, hence we use "10401" for
|
||||
the version number.
|
||||
|
||||
|
||||
(1) Traditional configure + make (Unix, Linux, MinGW, MSYS, etc.)
|
||||
-----------------------------------------------------------------
|
||||
How to select the ABI version with CMake
|
||||
----------------------------------------
|
||||
|
||||
Run
|
||||
make clean
|
||||
./configure --with-abiversion=10401
|
||||
make
|
||||
Use CMake to build the Makefile's and run 'make' or use any other CMake
|
||||
generator of your choice. To select the ABI version use one of the CMake
|
||||
configuration tools (cmake-gui or ccmake), or run CMake with these or
|
||||
similar commands:
|
||||
|
||||
This will generate FL/fl_config.h and build FLTK as usual.
|
||||
cd /path/to/fltk
|
||||
cmake . -B build [-G <GENERATOR>] -D FLTK_ABI_VERSION:STRING=10401
|
||||
|
||||
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'.
|
||||
|
||||
(2) CMake + make
|
||||
----------------
|
||||
|
||||
FLTK versions 1.4.0 and later contain full CMake support.
|
||||
|
||||
Use CMake to build the Makefile's and run 'make'. To configure the
|
||||
ABI version, use ccmake, cmake-gui, or run cmake with the following
|
||||
command:
|
||||
|
||||
cmake -D FLTK_ABI_VERSION:STRING=10401 /path/to/fltk
|
||||
The optional part '[-G <GENERATOR>]' can be used to select a particular
|
||||
build tool that is not the default for the build platform, for instance
|
||||
'-G Ninja'. Further CMake options can be appended.
|
||||
|
||||
Then execute
|
||||
|
||||
make
|
||||
cmake --build build
|
||||
|
||||
You can define FLTK_ABI_VERSION to the required version number using
|
||||
one of the graphical CMake tools.
|
||||
or the selected build tool (-G <GENERATOR>), e.g. `make`.
|
||||
|
||||
For more information on how to use CMake with FLTK see README.CMake.txt.
|
||||
|
||||
|
||||
(3) CMake + IDE Projects: Visual C++, Xcode, other IDE's
|
||||
--------------------------------------------------------
|
||||
|
||||
FLTK versions 1.4.0 and later contain full CMake support.
|
||||
|
||||
IDE project files are no longer included in the FLTK source distribution.
|
||||
You need to install CMake to generate the IDE files.
|
||||
|
||||
Use CMake to generate the IDE project files of your choice. Currently
|
||||
the FLTK team uses some Visual C++ (Visual Studio) versions and Xcode
|
||||
for testing FLTK. Other IDE's may work as well but are not tested.
|
||||
|
||||
For more informations on how to install and use CMake see README.CMake.txt.
|
||||
|
||||
Use CMake option `-D FLTK_ABI_VERSION:STRING=10401` on the command line
|
||||
or set FLTK_ABI_VERSION with one of the CMake GUI programs.
|
||||
|
||||
Then start the build process in the IDE solution of your choice. This
|
||||
will run the build with the defined ABI version.
|
||||
|
||||
|
||||
General Note on CMake:
|
||||
----------------------
|
||||
General Note on CMake
|
||||
---------------------
|
||||
|
||||
CMake generates FL/fl_config.h in the build tree. You may run
|
||||
'make install' to install the FLTK library including all headers in
|
||||
@@ -115,5 +80,3 @@ General Note on CMake:
|
||||
|
||||
The FLTK team recommends to use the FLTK library directly from the
|
||||
build folder. See README.CMake.txt for more information.
|
||||
|
||||
Possible exception: Visual Studio IDE builds (Windows).
|
||||
|
||||
@@ -2,26 +2,14 @@ lib/README.txt
|
||||
--------------
|
||||
|
||||
This README file is a placeholder for FLTK library files on your system
|
||||
if FLTK is built using 'configure' and 'make'.
|
||||
if FLTK is built "in-tree", i.e. if the build folder is the same as the
|
||||
source folder.
|
||||
|
||||
*** This is strongly discouraged! ***
|
||||
|
||||
Building FLTK with CMake
|
||||
Building FLTK "out-of tree"
|
||||
|
||||
If FLTK is built using CMake all static and shared libraries are created
|
||||
in the 'lib' subdirectory of the build tree. We strongly recommend to
|
||||
build with CMake outside the source tree ("out-of-tree") as described
|
||||
in README.CMake.txt in the root folder of the FLTK distribution.
|
||||
|
||||
If FLTK is built out-of-tree as recommended this folder will not be touched.
|
||||
|
||||
|
||||
Building FLTK with configure + make
|
||||
|
||||
Under UNIX/Linux and other systems that support 'configure' and 'make'
|
||||
(e.g. MinGW, MSYS) a single set of library files will be built, with
|
||||
or without debug information depending on the options you provided to
|
||||
the configure script.
|
||||
|
||||
The FLTK build system based on configure does not support out-of-tree
|
||||
builds, hence the static libraries will be built in this 'lib' folder
|
||||
and the shared libraries (if enabled) can be found in the 'src' folder.
|
||||
|
||||
@@ -188,12 +188,6 @@ sed -e '1,$s/@FLTK_VERSION@/'$version'/' \
|
||||
echo Writing git revision file...
|
||||
echo "$GIT_REVISION" > fltk_git_rev.dat
|
||||
|
||||
echo Creating configure script...
|
||||
autoconf -f
|
||||
|
||||
echo Cleaning developer files...
|
||||
rm -rf OpenGL autom4te* bc5 config forms glut images packages themes
|
||||
|
||||
cd ..
|
||||
|
||||
if test $# != 0 -a "x$1" != "xsnapshot"; then
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
//
|
||||
// Special Cairo support for the Fast Light Tool Kit (FLTK).
|
||||
//
|
||||
// Copyright 1998-2024 by Bill Spitzak and others.
|
||||
// Copyright 1998-2025 by Bill Spitzak and others.
|
||||
//
|
||||
// This library is free software. Distribution and use rights are outlined in
|
||||
// the file "COPYING" which should have been included with this file. If this
|
||||
@@ -16,11 +16,11 @@
|
||||
|
||||
// This file implements the FLTK Cairo Window support (since 1.3.x):
|
||||
//
|
||||
// - ./configure --enable-cairo and/or --enable-cairoext
|
||||
// - cmake -D FLTK_OPTION_CAIRO_WINDOW and/or -D FLTK_OPTION_CAIRO_EXT
|
||||
// - cmake -D FLTK_OPTION_CAIRO_WINDOW or
|
||||
// - cmake -D FLTK_OPTION_CAIRO_EXT
|
||||
//
|
||||
// Preprocessor macro FLTK_HAVE_CAIRO is defined for both options.
|
||||
// Preprocessor macro FLTK_HAVE_CAIRO_EXT is defined only for "cairoext".
|
||||
// Preprocessor macro FLTK_HAVE_CAIRO_EXT is defined only for "CAIRO_EXT".
|
||||
// Both macros are defined in 'FL/fl_config.h'.
|
||||
|
||||
#include <FL/Fl.H> // includes <FL/fl_config.h>
|
||||
@@ -70,8 +70,7 @@ void Fl_Cairo_State::autolink(bool b) {
|
||||
autolink_ = b;
|
||||
#else
|
||||
Fl::fatal("In Fl::autolink(bool): Cairo autolink() feature is only "
|
||||
"available with CMake FLTK_OPTION_CAIRO_EXT "
|
||||
"or the enable-cairoext configure option.\n"
|
||||
"available with CMake FLTK_OPTION_CAIRO_EXT.\n"
|
||||
"Quitting now.");
|
||||
#endif
|
||||
}
|
||||
@@ -92,7 +91,7 @@ void Fl_Cairo_State::autolink(bool b) {
|
||||
Also, after this call, Fl::cairo_cc() is adequately updated with this
|
||||
Cairo context.
|
||||
|
||||
\note Only available when configure has the --enable-cairo option
|
||||
\note Only available when CMake option '-D FLTK_OPTION_CAIRO_WINDOW' is set.
|
||||
|
||||
\return The valid cairo_t *cairo context associated to this window.
|
||||
\retval NULL if \a wi is NULL or maybe with GL windows under Wayland
|
||||
@@ -168,8 +167,7 @@ static cairo_surface_t *cairo_create_surface(void *gc, int W, int H) {
|
||||
Creates a Cairo context from a \a gc only, gets its window size or
|
||||
offscreen size if fl_window is null.
|
||||
|
||||
\note Only available if CMake FLTK_OPTION_CAIRO_WINDOW is enabled
|
||||
or configure has the --enable-cairo option.
|
||||
\note Only available if CMake FLTK_OPTION_CAIRO_WINDOW is enabled.
|
||||
*/
|
||||
cairo_t *Fl::cairo_make_current(void *gc) {
|
||||
int W = 0, H = 0;
|
||||
@@ -211,8 +209,7 @@ cairo_t *Fl::cairo_make_current(void *gc) {
|
||||
/**
|
||||
Creates a Cairo context from a \p gc and the given size.
|
||||
|
||||
\note Only available if CMake FLTK_OPTION_CAIRO_WINDOW is enabled
|
||||
or configure has the --enable-cairo option.
|
||||
\note Only available if CMake FLTK_OPTION_CAIRO_WINDOW is enabled.
|
||||
*/
|
||||
cairo_t *Fl::cairo_make_current(void *gc, int W, int H) {
|
||||
if (gc == Fl::cairo_state_.gc() &&
|
||||
@@ -241,7 +238,7 @@ cairo_t *Fl::cairo_make_current(void *gc, int W, int H) {
|
||||
return c;
|
||||
}
|
||||
|
||||
// Silence compiler warning if none of the Cairo options has been configured
|
||||
// Silence compiler warning if none of the Cairo options has been selected
|
||||
|
||||
#else
|
||||
FL_EXPORT int fltk_cairo_dummy() {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
//
|
||||
// Cairo drawing test program for the Fast Light Tool Kit (FLTK).
|
||||
//
|
||||
// Copyright 1998-2023 by Bill Spitzak and others.
|
||||
// Copyright 1998-2025 by Bill Spitzak and others.
|
||||
//
|
||||
// This library is free software. Distribution and use rights are outlined in
|
||||
// the file "COPYING" which should have been included with this file. If this
|
||||
@@ -26,8 +26,8 @@
|
||||
|
||||
#define DEF_WIDTH 0.03
|
||||
|
||||
// This demo program can be used in 3 modes. All 3 modes require configure
|
||||
// option --enable-cairo or CMake FLTK_OPTION_CAIRO_WINDOW.
|
||||
// This demo program can be used in 3 modes. All 3 modes require CMake
|
||||
// option FLTK_OPTION_CAIRO_WINDOW.
|
||||
//
|
||||
// 1) using class Fl_Cairo_Window useful when all the content of a window
|
||||
// is drawn with Cairo.
|
||||
@@ -38,9 +38,9 @@
|
||||
// This is achieved setting #define USE_FL_CAIRO_WINDOW 0 below
|
||||
// or
|
||||
// 3) showing how to use "cairo extended use".
|
||||
// This is achieved when FLTK was built with one more option
|
||||
// (configure --enable-cairoext or CMake FLTK_OPTION_CAIRO_EXT)
|
||||
// which defines the preprocessor variable FLTK_HAVE_CAIROEXT.
|
||||
// This is achieved when FLTK was built with one more CMake option
|
||||
// (FLTK_OPTION_CAIRO_EXT) which defines the preprocessor variable
|
||||
// FLTK_HAVE_CAIROEXT.
|
||||
// If Fl::cairo_autolink_context(true); is called at the beginning
|
||||
// of main(), any overridden draw() function gets access to an adequate
|
||||
// Cairo context with Fl::cairo_cc() without having to call
|
||||
@@ -211,8 +211,8 @@ int main(int argc, char **argv) {
|
||||
int main(int argc, char **argv) {
|
||||
fl_message_title("This program needs a Cairo enabled FLTK library");
|
||||
fl_message(
|
||||
"Please configure FLTK with Cairo enabled (--enable-cairo or --enable-cairoext)\n"
|
||||
"or one of the CMake options FLTK_OPTION_CAIRO_WINDOW or FLTK_OPTION_CAIRO_EXT, respectively.");
|
||||
"Please configure FLTK with Cairo enabled, i.e. use one of the\n"
|
||||
"CMake options FLTK_OPTION_CAIRO_WINDOW or FLTK_OPTION_CAIRO_EXT.");
|
||||
return 0;
|
||||
}
|
||||
#endif // (FLTK_HAVE_CAIRO)
|
||||
|
||||
Reference in New Issue
Block a user