Updating fbbindings

External libraries (GTK, GSL, SDL, Allegro, OpenGL, etc) questions.
Post Reply
LkpPo
Posts: 3
Joined: Jul 11, 2018 20:49
Location: Cuxac-d'Aude, France

Updating fbbindings

Post by LkpPo »

Hello,

I tried to update fbbindings packages with a cygwin 64bits env. and hit a lot of broken things.

Maybe cygwin is not the right build env. for this task.

It seems also that fbfrog have been changed and the makefile rules are not in sync with fbfrog. Some rules are broken, others don't output the same bi files, others output empty bi files.

If someone has commit rights I can send a PR for broken links and minors things for starting.

(Initial post : https://github.com/freebasic/fbc/pull/9 ... -410819645)

Regards,
dkl
Site Admin
Posts: 3235
Joined: Jul 28, 2005 14:45
Location: Germany

Re: Updating fbbindings

Post by dkl »

Hi,

the last time I worked on fbfrog+fbbindings, it was on Linux only, so maybe it is broken for Windows/Cygwin... but I'm sure that can be fixed. So if you've got useful changes, send a pull request, I can review + merge it.

Also I'm not surprised if the download links used in the scripts are dead and need updating, but other than that everything should work. Even the fbfrog version is hard-coded, to make it reproducible, and to avoid breaking due to changes in fbfrog. For example, here's what I just tried:

Code: Select all

cd fbbindings
git checkout raw
make clean
rm -rf inc/IUP
make iup
git gui
And that seems to give almost the same .bi files in inc/IUP/ as before (different copyright years, unfortunately).

For updating IUP specifically, the first step would be to update the IUP_VERSION in the makefile, and then give it a go and check the generated .bi files. The fbfrog invocation command and iup.fbfrog may need adjustment too. Since currently the IUP binding is split up into many .bi files (almost one per .h file), it may be necessary to add/remove -emit commands from the fbfrog invocation command, to adjust to the new IUP version.

Of course that trouble could be avoided by just generating a single iup.bi file only.

If you have any ideas for improvements to the process, they are most definitely welcome, because so far the scripts for invoking fbfrog with all the needed options have turned out to be somewhat of a hack.
LkpPo
Posts: 3
Joined: Jul 11, 2018 20:49
Location: Cuxac-d'Aude, France

Re: Updating fbbindings

Post by LkpPo »

Hi dkl,

Some errors encountered :

Just trying to compile all packages I had to turn off a lot of targets. I took a few note about errors happening for me.

Code: Select all

# inc/allegro.bi is missing
#ALL += allegro
#ALL += allegro4
#ALL += allegro5

# winapi-titles-generated.fbfrog(1): could not open file: 'mingw-w64-disclaimer-pd.tmp'
#ALL += chipmunk

# compilation segfault
#ALL += curl

# http://www.fastcgi.com (broken link)
#ALL += fastcgi

# Arguments too long
#ALL += gsl

# configure.ac:114: error: possibly undefined macro: AC_LIBTOOL_WIN32_DLL
#ALL += jit

# Unsed and source code unavailable
#ALL += spidermonkey

#ALL += x11
#ALL += xcb
fake-configure.bas and getcomment.bas compilation are missing.

Some end of line are not Unix only and that breaks compilation.

Most of bi are empty like this :

Code: Select all

'' FreeBASIC binding for glib-2.44.1
''
'' based on the C header files:
''   GIO - GLib Input, Output and Streaming Library
''
''   Copyright (C) 2006-2007 Red Hat, Inc.
''
''   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 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, see <http://www.gnu.org/licenses/>.
''
''   Author: Alexander Larsson <alexl@redhat.com>
''
'' translated to FreeBASIC by:
''   (C) 2011, 2012 Thomas[ dot ]Freiherr[ at ]gmx[ dot ]net
''   Copyright © 2015 FreeBASIC development team

#pragma once

#inclib "gio-2.0"
Clearly the behavior of fbfrog is not the same with cygwin.

It also looks like fbforg is trying to read all fbfrog files before generation and fails. I had to delete files like winapi-titles-generated.fbfrog at certain stages.

Files like quicklz.fbfrog which have a declareversions option fail also at compilation.

Code: Select all

-declareversions QLZ_COMPRESSION_LEVEL 1 2 3
-selectversion
-case 1 -define QLZ_COMPRESSION_LEVEL 1
-case 2 -define QLZ_COMPRESSION_LEVEL 2
-case 3 -define QLZ_COMPRESSION_LEVEL 3
-endselect

I could install a Debian or an OpenBSD system as a last resort (it's been a while since I have to do it).

I tried to update to IUP 3.25 and have to rewrite all rules, one by bi file, otherwith there are all empty, but for N .h files to one 1 bi file fbfrog always fail. I don't know if I misuse it or if it's broken on cygwin.

Code: Select all

IUP_VERSION := 3.25
IUP_TITLE := iup-$(IUP_VERSION)
iup: tools
	./get.sh $(IUP_TITLE) $(IUP_TITLE)_Sources.tar.gz "http://sourceforge.net/projects/iup/files/$(IUP_VERSION)/Docs%20and%20Sources/$(IUP_TITLE)_Sources.tar.gz/download" createdir
	find extracted/$(IUP_TITLE)/iup/ -type d -exec chmod +x '{}' ';'

	$(GETCOMMENT) --1 extracted/$(IUP_TITLE)/iup/include/iup.h | tail -n+2 | head -n-1 | cut -c2- > iup.tmp

	mkdir -p inc/IUP

	$(FBFROG) iup.fbfrog \
		extracted/$(IUP_TITLE)/iup/include/iup_config.h \
		-o inc/IUP \
		-title $(IUP_TITLE) iup.tmp fbteam.txt

	$(FBFROG) iup.fbfrog \
		extracted/$(IUP_TITLE)/iup/include/iup_mglplot.h \
		-o inc/IUP \
		-title $(IUP_TITLE) iup.tmp fbteam.txt

	$(FBFROG) iup.fbfrog \
		extracted/$(IUP_TITLE)/iup/include/iup_plot.h \
		-o inc/IUP \
		-title $(IUP_TITLE) iup.tmp fbteam.txt

	$(FBFROG) iup.fbfrog \
		extracted/$(IUP_TITLE)/iup/include/iup_varg.h \
		-o inc/IUP \
		-title $(IUP_TITLE) iup.tmp fbteam.txt

	$(FBFROG) iup.fbfrog \
		extracted/$(IUP_TITLE)/iup/include/iupcbs.h \
		-o inc/IUP \
		-title $(IUP_TITLE) iup.tmp fbteam.txt

	$(FBFROG) iup.fbfrog \
		extracted/$(IUP_TITLE)/iup/include/iupcontrols.h \
		-o inc/IUP \
		-title $(IUP_TITLE) iup.tmp fbteam.txt

	$(FBFROG) iup.fbfrog \
		extracted/$(IUP_TITLE)/iup/include/iupdef.h \
		-o inc/IUP \
		-title $(IUP_TITLE) iup.tmp fbteam.txt

	$(FBFROG) iup.fbfrog \
		extracted/$(IUP_TITLE)/iup/include/iupdraw.h \
		-o inc/IUP \
		-title $(IUP_TITLE) iup.tmp fbteam.txt

	$(FBFROG) iup.fbfrog \
		extracted/$(IUP_TITLE)/iup/include/iupdraw_cd.h \
		-o inc/IUP \
		-title $(IUP_TITLE) iup.tmp fbteam.txt

	$(FBFROG) iup.fbfrog \
		extracted/$(IUP_TITLE)/iup/include/iupgl.h \
		-o inc/IUP \
		-title $(IUP_TITLE) iup.tmp fbteam.txt

	$(FBFROG) iup.fbfrog \
		extracted/$(IUP_TITLE)/iup/include/iupglcontrols.h \
		-o inc/IUP \
		-title $(IUP_TITLE) iup.tmp fbteam.txt

	$(FBFROG) iup.fbfrog \
		extracted/$(IUP_TITLE)/iup/include/iupkey.h \
		-o inc/IUP \
		-title $(IUP_TITLE) iup.tmp fbteam.txt

	$(FBFROG) iup.fbfrog \
		extracted/$(IUP_TITLE)/iup/include/iupole.h \
		-o inc/IUP \
		-title $(IUP_TITLE) iup.tmp fbteam.txt

	$(FBFROG) iup.fbfrog \
		extracted/$(IUP_TITLE)/iup/include/iuptuio.h \
		-o inc/IUP \
		-title $(IUP_TITLE) iup.tmp fbteam.txt

	$(FBFROG) iup.fbfrog \
		extracted/$(IUP_TITLE)/iup/include/iupweb.h \
		-o inc/IUP \
		-title $(IUP_TITLE) iup.tmp fbteam.txt

	$(FBFROG) iup.fbfrog \
		-incdir extracted/$(IUP_TITLE)/iup/include \
		-include iupdef.h \
		-include iupkey.h \
		-emit '*/iup.h'              inc/IUP/iup.bi         \
		-inclib iupdef               inc/IUP/iupdef.bi      \
		-inclib iupkey               inc/IUP/iupkey.bi      \
		-iftarget windows                                   \
			-inclib gdi32        inc/IUP/iup.bi              \
			-inclib user32       inc/IUP/iup.bi              \
			-inclib comdlg32     inc/IUP/iup.bi              \
			-inclib comctl32     inc/IUP/iup.bi              \
			-inclib ole32        inc/IUP/iup.bi              \
			-inclib advapi32     inc/IUP/iup.bi              \
			-inclib shell32      inc/IUP/iup.bi              \
			-inclib uuid         inc/IUP/iup.bi              \
		-else                                               \
			-inclib gtk-x11-2.0  inc/IUP/iup.bi              \
			-inclib gdk-x11-2.0  inc/IUP/iup.bi              \
			-inclib pangox-1.0   inc/IUP/iup.bi              \
			-inclib gdk_pixbuf-2.0 inc/IUP/iup.bi            \
			-inclib pango-1.0    inc/IUP/iup.bi              \
			-inclib gobject-2.0  inc/IUP/iup.bi              \
			-inclib gmodule-2.0  inc/IUP/iup.bi              \
			-inclib glib-2.0     inc/IUP/iup.bi              \
		-endif                                              \
		-title $(IUP_TITLE) iup.tmp fbteam.txt

	$(FBFROG) iupim.fbfrog \n
		extracted/$(IUP_TITLE)/iup/include/iupim.h \
		-o inc/IUP \
		-inclib iupim \
		-title $(IUP_TITLE) iup.tmp fbteam.txt

	$(FBFROG) iuplua.fbfrog iupscintilla.fbfrog \
		extracted/$(IUP_TITLE)/iup/include/*.h \
		-emit '*/iup_scintilla.h'    inc/IUP/iup_scintilla.bi    \
		-emit '*/iupluacontrols.h'   inc/IUP/iupluacontrols.bi   \
		-emit '*/iupluaglcontrols.h' inc/IUP/iupluaglcontrols.bi \
		-emit '*/iupluagl.h'         inc/IUP/iupluagl.bi         \
		-emit '*/iuplua.h'           inc/IUP/iuplua.bi           \
		-emit '*/iupluaim.h'         inc/IUP/iupluaim.bi         \
		-emit '*/iuplua_mglplot.h'   inc/IUP/iuplua_mglplot.bi   \
		-emit '*/iupluaole.h'        inc/IUP/iupluaole.bi        \
		-emit '*/iuplua_plot.h'      inc/IUP/iuplua_plot.bi      \
		-emit '*/iupluascripterdlg.h' inc/IUP/iupluascripterdlg.bi \
		-emit '*/iupluatuio.h'       inc/IUP/iupluatuio.bi       \
		-emit '*/iupluaweb.h'        inc/IUP/iupluaweb.bi        \
		-inclib iup_scintilla        inc/IUP/iup_scintilla.bi    \
		-title $(IUP_TITLE) iup.tmp fbteam.txt

	rm *.tmp
Have you considered making one makefile in a subfolder per package? It could save us from strange interactions.

I prepare a PR with some corrections.
dkl
Site Admin
Posts: 3235
Joined: Jul 28, 2005 14:45
Location: Germany

Re: Updating fbbindings

Post by dkl »

Ok, interesting. Crashes are strange, that needs to be debugged.

Some parts are understandable, such as ./configure build system invocation being different on the different target. It's really unfortunate that some packages generate some headers at build-time... this is not handled nicely at all currently in fbbindings.

The empty .bi files might be caused by the -emit options using / path separators to match, it might have to be \ to match for Windows. I think fbfrog can handle that somehow by replacing the path separators..
Have you considered making one makefile in a subfolder per package? It could save us from strange interactions.
Yea, that would be much better.
LkpPo
Posts: 3
Joined: Jul 11, 2018 20:49
Location: Cuxac-d'Aude, France

Re: Updating fbbindings

Post by LkpPo »

dkl wrote:Ok, interesting. Crashes are strange, that needs to be debugged.
I can make a log if you need it.
dkl wrote: Some parts are understandable, such as ./configure build system invocation being different on the different target. It's really unfortunate that some packages generate some headers at build-time... this is not handled nicely at all currently in fbbindings.
Maybe I should install gcc packages for cross compilation so that it works better.

There are a note about that in fbfrog. You intended to make a complete C / C ++ preprocessor I think.
dkl wrote: The empty .bi files might be caused by the -emit options using / path separators to match, it might have to be \ to match for Windows. I think fbfrog can handle that somehow by replacing the path separators..

In cygwin path is like that for example : /cygdrive/c/devel/fbbindings-githb-lkppo
dkl wrote: Have you considered making one makefile in a subfolder per package? It could save us from strange interactions.
Yea, that would be much better.
Ok. I will think about it.
Post Reply