FLTK logo

STR #3161

FLTK matrix user chat room
(using Element browser app)   FLTK gitter user chat room   GitHub FLTK Project   FLTK News RSS Feed  
  FLTK Apps      FLTK Library      Forums      Links     Login 
 Home  |  Articles & FAQs  |  Bugs & Features  |  Documentation  |  Download  |  Screenshots  ]
 

Return to Bugs & Features | Roadmap 1.3 | SVN ⇄ GIT ]

STR #3161

Application:FLTK Library
Status:1 - Closed w/Resolution
Priority:1 - Request for Enhancement, e.g. asking for a feature
Scope:3 - Applies to all machines and operating systems
Subsystem:Config Files
Summary:FLTK_ABI_VERSION
Version:1.3-feature
Created By:szukw000
Assigned To:AlbrechtS
Fix Version:1.3.4 (SVN: v10854)
Update Notification:

Receive EMails Don't Receive EMails

Trouble Report Files:


Name/Time/Date Filename/Size  
 
#1 szukw000
20:40 Nov 26, 2014
ABI.dif
3k
 
     

Trouble Report Comments:


Name/Time/Date Text  
 
#1 szukw000
12:55 Nov 24, 2014
Using 'fltk-1.3.x-r10454' I found that the 'FLTK_ABI_VERSION'
must be uncommented manually in 'FL/Enumeration.H' if using
CMAKE.

That is bad.

I propose the following change:

cmake -DFLTK_HAS_ABI_VERSION:string="10303"

If this argument exists, the result is:

ABI_VERSION ==> 10303

If not, the result is:

ABI_VERSION ==>

For CONFIGURE the ABI_VERSION can be given:

flags=CXXFLAGS='-DFLTK_ABI_VERSION=10303'

do_configure:
    $(flags) \
    ./configure \

The 'MESSAGE()' line below should be removed after the test.

winfried

--- CMakeLists.txt.orig 2014-11-19 03:51:57.680499592 +0000
+++ CMakeLists.txt  2014-11-24 19:45:14.990209737 +0000
@@ -24,6 +24,10 @@
 project(FLTK)
 cmake_minimum_required(VERSION 2.6)

+MESSAGE(STATUS "ABI_VERSION ==> ${FLTK_HAS_ABI_VERSION}")
+if(FLTK_HAS_ABI_VERSION EQUAL 10303)
+ add_definitions(-DFLTK_ABI_VERSION=10303)
+endif()
 #######################################################################
 # define some macros
 #######################################################################
 
 
#2 AlbrechtS
06:32 Nov 25, 2014
Thanks for your proposal. My opinion is also that the ABI option should be configurable somehow.

However, for both ways (autoconf and CMake) and for all the IDE build files we need a better (more secure) way than your proposal. I also thought of adding a similar way to enable an arbitrary ABI level, but there's an issue that lets me hesitate:

The problem with just setting a compiler option (i.e. using a preprocessor #define) is that the library and all applications MUST be compiled and built with the same ABI level. If you build the library with a define like you used in your configure example, you may use 'fltk-config --cxxflags' or make sure that you alway use the same CXXFLAGS, and you'll be fine. However, not everybody uses it this way, and if you compile your application w/o the correct flags, this will result in an incompatible ABI, no matter if you link static or shared. :-(

So I decided not to change this behavior for now. I'm thinking about a better way to do this consistently, but until then you will have to edit FL/Enumerations.H or use a workaround like you proposed (but then it's your own responsibility).

The full solution would also need a way to retrieve the ABI version at runtime like Fl::version() does.
 
 
#3 szukw000
11:16 Nov 25, 2014
fltk-1.3.x-r10470/src/Fl_Window_Shape.cxx, line 314:

 \version 1.3.3 (and requires compilation with -DFLTK_ABI_VERSION = 10303)

fltk-1.3.x-r10470//documentation/fltk.pdf, November 25, 2014

Version
    1.3.3 (and requires compilation with -DFLTK_ABI_VERSION = 10303)

szukw000: fltk-config --cxxflags
-I/usr/local/fltk13/include -I/usr/include/freetype2 -DFLTK_ABI_VERSION=10303 -fvisibility-inlines-hidden -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_THREAD_SAFE -D_REENTRANT

winfried
 
 
#4 szukw000
04:51 Nov 26, 2014
Here is another proposal to solve the problem.
winfried
------------------------------------------------
--- fltk-1.3.x-r10470/CMakeLists.txt.orig   2014-11-26 11:58:03.902970703 +0000
+++ fltk-1.3.x-r10470/CMakeLists.txt    2014-11-26 12:26:53.966960765 +0000
@@ -24,6 +24,9 @@
 project(FLTK)
 cmake_minimum_required(VERSION 2.6)

+if(FLTK_HAS_ABI_VERSION EQUAL 10303)
+ set(FLTK_ABI_VERSION 10303)
+endif()
 #######################################################################
 # define some macros
 #######################################################################
@@ -49,6 +52,12 @@
 #######################################################################
 include(CMake/export.cmake)

+configure_file(
+ ${FLTK_SOURCE_DIR}/fltk-configh.cmake.in
+ ${FLTK_SOURCE_DIR}/FL/fltk-config.h
+ @ONLY
+ )
+
 #######################################################################
 # build examples - these have to be after fluid is built/imported
 #######################################################################
--- fltk-1.3.x-r10470/fltk-configh.in.orig  2014-11-26 13:14:34.200025207 +0000
+++ fltk-1.3.x-r10470/fltk-configh.in   2014-11-26 11:42:09.819976184 +0000
@@ -0,0 +1 @@
+#undef FLTK_ABI_VERSION
--- fltk-1.3.x-r10470/fltk-configh.cmake.in.orig    2014-11-26 13:14:23.495024154 +0000
+++ fltk-1.3.x-r10470/fltk-configh.cmake.in 2014-11-26 11:50:36.277973275 +0000
@@ -0,0 +1 @@
+#cmakedefine FLTK_ABI_VERSION @FLTK_ABI_VERSION@
--- fltk-1.3.x-r10470/Makefile.orig 2014-11-26 12:13:42.896965309 +0000
+++ fltk-1.3.x-r10470/Makefile  2014-11-26 12:14:29.800965040 +0000
@@ -69,7 +69,7 @@
    $(RM) config.h config.log config.status
    $(RM) fltk-config fltk.list makeinclude
    $(RM) fltk.spec
-   $(RM) FL/Makefile
+   $(RM) FL/Makefile FL/fltk-config.h
    $(RM) documentation/*.$(CAT1EXT)
    $(RM) documentation/*.$(CAT3EXT)
    $(RM) documentation/*.$(CAT6EXT)
--- fltk-1.3.x-r10470/configure.in.orig 2014-11-26 11:32:44.042979434 +0000
+++ fltk-1.3.x-r10470/configure.in  2014-11-26 11:39:42.673977029 +0000
@@ -168,6 +168,12 @@
 AC_SUBST(IMGLIBBASENAME)
 AC_SUBST(CAIROLIBBASENAME)

+AC_ARG_WITH(abiversion,
+[  --with-abiversion=[10303]    Build with FLTK_ABI_VERSION])
+if test "$with_abiversion" = "10303" ; then
+ AC_DEFINE_UNQUOTED(FLTK_ABI_VERSION, [10303], [define to FLTK_ABI_VERSION])
+fi
+
 dnl Handle compile-time options...
 AC_ARG_ENABLE(debug, [  --enable-debug          turn on debugging [[default=no]]])
 if test x$enable_debug = xyes; then
@@ -1449,6 +1455,7 @@

 dnl Write all of the files...
 AC_CONFIG_HEADER(config.h:configh.in)
+AC_CONFIG_HEADER(FL/fltk-config.h:fltk-configh.in)
 AC_OUTPUT(makeinclude fltk.list fltk-config fltk.spec FL/Makefile)

 dnl Make sure the fltk-config script is executable...
--- fltk-1.3.x-r10470/FL/Enumerations.H.orig    2014-11-26 11:44:20.127975435 +0000
+++ fltk-1.3.x-r10470/FL/Enumerations.H 2014-11-26 11:44:46.183975286 +0000
@@ -27,7 +27,7 @@
  * in the current patch release of FLTK. ** Use for static builds only! **
  * For more info on this macro, see: http://fltk.org/cmp.php#FLTK_ABI_VERSION
  */
-//#define FLTK_ABI_VERSION 10303
+#include "fltk-config.h"

 #  include "Fl_Export.H"
 #  include "fl_types.h"
 
 
#5 AlbrechtS
05:57 Nov 26, 2014
Thanks for this new patch - it looks almost like I imagined how it should be. I wouldn't use a fixed ABI version though but let the user give one, e.g. 10302 if s/he wants that particular ABI version.

The reasoning for this is that once you use one ABI version in your software you may want to have exactly the same ABI even after an upgrade of FLTK so you can replace shared libraries you might have distributed to users/customers without hassle.

Even if the final update may not be exactly as posted by you I can pick the essentials - this helps very much. Thanks again for your help.

PS: if you post patches, please upload the patches (menu: Post File) as normal, uncompressed files (e.g. fltk-config.patch) rather than inline so they can be downloaded easier. TIA
 
 
#6 AlbrechtS
06:03 Nov 26, 2014
Regarding comment #3: thanks for the heads-up.

You're right, this should be documented differently. Once we add the configure option we should also fix the docs.
 
 
#7 szukw000
20:39 Nov 26, 2014
Final solution:

configure --with-abiversion=10303

cmake -DFLTK_HAS_ABI_VERSION:string="10303"

See the resp. patch for fltk-1.3.x-r10470.

winfried
 
 
#8 AlbrechtS
01:56 Nov 27, 2014
Thank you very much for the revised patch.

We will consider this for the next release.
 
 
#9 AlbrechtS
12:35 Jul 12, 2015
Fixed in Subversion repository.

Thanks for the patch again. I used it as a first step, but then I changed many things. The final solution is now (as of svn r 10786):

 (1) configure --with-abiversion=10303

 (2) cmake -DOPTION_ABI_VERSION:string="10303"

The CMake option can be changed interactively with CMake GUI's as well.

IDE builds need to change the provided file

  /path/to/fltk/ide/<IDE-NAME>/FL/abi-version.h

and _must_ install this file after building the FLTK libs into the include/FL directory *if* FLTK is installed in a (system) directory.
See README.MSWindows.txt.

Currently tested with configure and CMake under Linux only. More tests to come.

@Everybody: Please help testing if you can, particularly with OS X with or w/o Xcode. TIA.
 
 
#10 greg.ercolano
23:59 Aug 19, 2015
Regarding abi_version.h, a few suggs:

  o If possible, please remove copyright/GPL stuff.. so not needed here.

  o Comment that refers to "10x0y for FLTK ABI version 1.x.y",
    Perhaps 1xxyy is more correct; we may one day have 1.1.10 or 1.10.1
 
 
#11 AlbrechtS
02:10 Aug 22, 2015
Hi Greg, thanks for your comments.

Yes, I agree that 1xxyy is the better choice - I'll change that.

But why should we remove the copyright/GPL stuff? We have it in other generated files (config.h, fltk-config, makeinclude), so I thought it would be okay. I don't see a problem to remove it, but I'd like to know a reason. TIA.
 
 
#12 AlbrechtS
12:35 Jul 15, 2016
Closing now.

Version "1xxyy" instead of "10x0y" has been changed (r11803, r11804).
 
 
#13 greg.ercolano
11:29 Jul 22, 2016
Comment #11: a few reasons to remove the copyright markers:

   o Less visual noise
   o Easier to view with 'more'

It's just easier to read to see what the current value is set to,
and if it's set at all.

Also, a file dedicated to just one macro definition shouldn't need
the protection of a copyright banner; nothing there's worth copyrighting.
 
 
#14 AlbrechtS
11:53 Jul 29, 2016
Fixed in Subversion repository.

Copyright markers removed as requested by Greg.

svn r11853: branch-1.3
svn r11854: branch-1.3-porting
 
     

Return to Bugs & Features ]

 
 

Comments are owned by the poster. All other content is copyright 1998-2024 by Bill Spitzak and others. This project is hosted by The FLTK Team. Please report site problems to 'erco@seriss.com'.