OCaml Forge
SCM

Detail: [#1178] update lablgtk2 build system

Patches: Browse | Download .csv | Monitor

[#1178] update lablgtk2 build system

Date:
2012-06-27 14:42
Priority:
3
State:
Open
Submitted by:
William R (william)
Assigned to:
Nobody (None)
Resolution:
Awaiting Response
Version:
None
Component:
None
 
Summary:
update lablgtk2 build system

Detailed description
Hello,
this is maybe a desperate mail, because I saw that the last submited patches are 1 year old!

As I needed to port my app using lablgtk2 to windows, I integrated it in the MXE framework (set of patches and make commands to cross-compile hundreds of packages). So now I am able to cross-compile it from linux to windows,

- I had to modify the configure.in file, but, as I saw the file was quite old, with old autoconf syntax sometimes, I updated everything in a configure.ac file.
- Many commands were related to ocaml, and are part of ocaml-autoconf, so I removed all ocaml related commands and used the ones from ocaml-autoconf (file ocaml.m4). I guess that ocaml-autoconf originates from this project though ;-)
- I added a more conventional Makefile.am, that is recognised by configure.ac
- a "autoreconf -fi" prepares the configure script. options have same syntax.
- the META file does not contain support for lablgl, so I updated the META file from the debian one.

With this, it is now "easy" to cross-compile lablgtk2.

To apply the patch :
cd lablgtk-2.14.2
patch -p1 < {/path/to/lablgtk2-1-fixes.patch}

Best regards,
William

Followup

Message
Date: 2012-09-14 21:09
Sender: William R

hello,
here is an update to the patch.
- configure.in split in configure.ac & ocaml.m4 (use autoreconf -fi to use it)
- several src/Makefile patches since last 2.16.0 update

For your information, here are the compile commands :
autoreconf -fi
./configure --host $(TARGET) --build "`config.guess`" --prefix $(PREFIX)/$(TARGET)
$(MAKE) -C '$(1)/src' -j '$(JOBS)' lablgtkopt
$(MAKE) -C '$(1)/src' -j 1 install

Regards,
William
Date: 2012-08-10 09:37
Sender: Adrien Nader

It's not really something I would personnaly like to do. The next release is really close and then we can try switching to this almost immediately.
Date: 2012-08-10 09:05
Sender: William R

ok, thanks.
For your information, you can keep for a while both systems : configure.in and configure.ac.
To use configure.in do as usual ; to use configure.ac do "autoreconf -fi".
William
Date: 2012-08-09 18:49
Sender: Adrien Nader

Hi,

As an update (this has been a bit long to come, sorry about that).

The next lablgtk2 release, which is will be released very soon, will feature several improvements to the build system. Among them, an expanded META file, installing with ocamlfind, and several updates.

Changing the configure.in file is not something that will happen for this release however. The reason is quite simple: there's already enough changes to warrant a new release (both for the build stuff and the overall API) and changing the build system more could break some targets which are usually less tested.

This means that while the next release will _not_ feature such changes, it's something that will be looked into for the next one. Lablgtk is a pretty widespread library and that means extra care has to be taken in order not to break it for systems which we don't use daily.
Date: 2012-07-23 21:23
Sender: William R

The reasons are from different kinds.

- the META file does not contain support for lablgl, so I updated the META file from the debian one. Without this, ocamlfind does not recognise the lablgl package. If I let the modification locally, on each system (debian, godi), there will be a different ocamlfind package name given for lablgl, and thus it makes it more complicated to handle portable Makefiles. So I prefere to give it upstream.

- 1) I wanted to cross-compile lablgtk2, but the configure script was not suitable for it straight. In the same time, the last ocaml-autoconf macros (in ocaml.m4 file) were suitable for cross-compilation.
2) Many commands were related to ocaml, and were part of ocaml-autoconf
So, to perform two actions in one (being able to cross-compile, and make the configure script cleaner), I tried to reuse the ocaml.m4 file as is, and removed every all ocaml related commands and used the ones from ocaml-autoconf (file ocaml.m4). I guess that ocaml-autoconf originates from this project though

- Doing, this, I started to modify the configure.in file, but, as I saw the file was quite old, with old autoconf syntax sometimes, I updated everything in a configure.ac file. There are few modifications related to this point, only to make things clearer

- I added a more conventional Makefile.am, that is recognised by configure.ac. Just because I found it cleaner. Also, I was used to call "autoreconf -fi" to prepare everything, but without Makefile.am it was not available.


" Also, as far as I understand, you've kept src/Makefile as is? "
yes, no problem with it.
Date: 2012-07-23 14:15
Sender: Adrien Nader

Hi,

Which bugs did you encounter with the system currently used? It seems most of the changes come from already-known sources but you haven't said why you had to change it? Was the issue only that you couldn't cross-compile? Also, as far as I understand, you've kept src/Makefile as is?
Date: 2012-07-08 06:49
Sender: Jacques Garrigue

Can anybody with some experience in GNU configuration tools look into this?
I must admit that I never really went past the configure.in stage, but if it makes autoconfiguration more robust (and maintainable) this is a good thing.

Changes:

Field Old Value Date By
File Added193: ocaml-lablgtk2-1-fixes.patch2012-09-14 21:09william
File Added182: ocaml-lablgtk2-1-fixes.patch2012-06-27 14:42william