Allegro.cc - Online Community

Allegro.cc Forums » Allegro Development » Allegro headers part II

This thread is locked; no one can reply to it. rss feed Print
 1   2   3 
Allegro headers part II
Evert
Member #794
November 2000
avatar

Quote:

Who should I send patches to?

Either to the mailinglist (check the Allegro website for instructions, you need to subscribe), or Allegro's sourceforge tracker (probably the best option).

Quote:

The autotools setup for 4.2 branch (almost) absolutelly requires renaming *.s ASM files to *.S It should be accepted since it is a really, really pure internal thing and if all the filenames in makefiles and file lists are renamed as well, nobody will notice, right?

Hmm. It seems a lot of hassle for something that may never see the light of (release) day (no offence).
I'd recommend you provide patches for 4.3 and (possibly?) 4.9, but before working on 4.9 it's worthwhile to check if we really want a third build system (alongside SCons and CMake). Keeping two of them in sync is already a hassle, I'm not sure that providing a third will make things better - especially not if it needs changes to the layout of the filesystem (as you now and then seem to insist it does). Personally I'm not convinced it's worth the effort.

EDIT: I should point out, at least some of the developers (Peter, me, Elias?) get the development forum posts as e-mails as well, so in that sense you could already post the patch here and people should pick it up. Should, because for me all your posts seem to end up in my spambox.

Matěj Týč
Member #9,863
June 2008
avatar

Quote:

...all your posts seem to end up in my spambox.

Still in no offence mode, right? ;)

I attach the autofiles patch. Then the demo patch (it adds a possibility to define datafile location during compilation and it is backward compatible).

It will not work due to asm files that need to be renamed. I already have a script that can generate the patch that svn renames those files and changes according filenames inside files at once. Nothing to worry about even more if you are not planning to release another 4.2 release.

I will generate the patch after you apply the autofiles one since the Makefile.ams need some renaming as well..

And finally, there is no allegro_unsharable library now and it seems to work well... Again no issue to 4.3+

Comments are always welcomed, of course!

---------------------------------------------------
Mind is like space, it is open, clear and unlimited. -- Ole Nydahl

Evert
Member #794
November 2000
avatar

Quote:

Still in no offence mode, right?

Dead serious. I only saw this one because I checked here in between runs.

Quote:

I will generate the patch after you apply the autofiles one since the Makefile.ams need some renaming as well..

Any patch applied to SVN should leave the tree in a working state.
Also, just to make sure, the Windows (and DOS) builds are unaffected, right? What about OS X?

Quote:

And finally, there is no allegro_unsharable library now and it seems to work well...

Did you test that on different architectures (32 and 64 bit)? Also when compiling with a magic main? On Linux and *BSD?

Peter Wang
Member #23
April 2000

Just so we're clear, I will not accept any patch using automake.

Even more so if it uses libtool.

Matěj Týč
Member #9,863
June 2008
avatar

Thank you for your reply,

Quote:

Any patch applied to SVN should leave the tree in a working state.
Also, just to make sure, the Windows (and DOS) builds are unaffected, right? What about OS X?

Existing things will remain untouched if you apply the patches I have sent. Even the old autotools support is not affected. The old configure.in and aclocal.m4 stay where they were. (only the new thing wouldn't work with ASM enabled)
And I don't have any clue about OSX, what was the current mean how to compile it? Could somebody post a typical build log?

Isn't the requirement of "always having working copy really working" little bit exaggerated? On the other hand, I can work little bit more on those patches so that they are more mature and comply with the requirement. Therefore I suggest not to apply them now. Applying the rename patch first looks smarter anyway.

The rename patch will (or at least really really should :-) leave everything in the same working state since only the filenames and records in all files are going to be changed.

Quote:

Did you test that on different architectures (32 and 64 bit)?


Not yet, good point, I will try that tomorrow. I have to admit that I don't exactly know what tests should my autotools support pass. I have posted a dist archive here few posts earlier for people to test, but as I can see, guys here don't enjoy watching execution of configure scripts as much as I do...

Quote:

Also when compiling with a magic main? On Linux and *BSD?

I have tested it on 32bit Linux and Wine. AFAIK, the old autotools support did not support BSD and the new one supports mingw and Linux at this moment. What does 'compiling with a magic main' actually mean? I have used that magic main macro on Windows as well... Or is it something else?

---------------------------------------------------
Mind is like space, it is open, clear and unlimited. -- Ole Nydahl

Evert
Member #794
November 2000
avatar

Quote:

Existing things will remain untouched if you apply the patches I have sent. Even the old autotools support is not affected. The old configure.in and aclocal.m4 stay where they were. (only the new thing wouldn't work with ASM enabled)
And I don't have any clue about OSX, what was the current mean how to compile it? Could somebody post a typical build log?

If existing builds are unaffected, so too will be OS X.

Quote:

Isn't the requirement of "always having working copy really working" little bit exaggerated?

No. No single commit should break the trunk. Of course it still happens now and then by accident.
If you like, that's what you get for providing a patch for a deadlocked feature-frozen branch. Do take note of Peter's post if you haven't already.

Quote:

On the other hand, I can work little bit more on those patches so that they are more mature and comply with the requirement. Therefore I suggest not to apply them now.

Fine.

Quote:

I have to admit that I don't exactly know what tests should my autotools support pass.

It should build the library in a state that is ABI compatible with other 4.2 libraries. From what I recall, there are subtle differences between 32 bit and 64 bit AMD/Intel architectures. Not needing allegro-unsharable is nice, but make sure you really don't need it anywhere, ever.

Quote:

AFAIK, the old autotools support did not support BSD

Since when?

Quote:

What does 'compiling with a magic main' actually mean? I have used that magic main macro on Windows as well... Or is it something else?

It means you have a magic main, or in other words, END_OF_MAIN() actually does something. This is always the case on Windows and OS X, and it may be the case on *NIX.

Matěj Týč
Member #9,863
June 2008
avatar

Quote:

Just so we're clear, I will not accept any patch using automake....
Even more so if it uses libtool.

Could you please explain why? ??? Automake and libtool evolved quite much recently, so they are probably different from the old ones that you know...

---------------------------------------------------
Mind is like space, it is open, clear and unlimited. -- Ole Nydahl

Peter Wang
Member #23
April 2000

Perhaps. But I have enough bad experiences, especially with libtool which puts things in hidden directories and wants total control of your command line. When it breaks (and it does break) it's not easy to recover because it's not transparent. Not to mention, libtool is extremely slow. Automake is not necessary. Makefiles are easy to understand, automake just adds another layer of autogenerated crud that gets in the way whenever you want to make a change or do something unusual.

Further, it's a maintenance issue. When you lose interest (and you will), who will maintain this? Everybody knows make, and we can manage autoconf well enough (not expertly, but well enough).

It's just not on to require developers to work with build tools they despise. The primary build system for Allegro 5 will be CMake. Too bad if you don't like it. It's just a build system. End users deal with the build system roughly once per release. Developers have to deal with it every time they touch the code. Therefore, developer opinions win.

Matěj Týč
Member #9,863
June 2008
avatar

Well, I hope that you are open for a discussion or to a possible change of opinion.
Let me react to your post:

Quote:

libtool puts things in hidden directories

This is true. But who cares. This is libtool's business. The libtool's 'supervising' of the compilation is also something that you don't have to worry about.

Libtool means goodbye to AM_PATH_ALLEGRO and the only cross-platform goodbye to allegro-config. I think that getting rid of those two is worth something.

Quote:

libtool is extremely slow

It seems to be slow, but it is bash behind libtool that makes things slow :D OK, nobody cares whose fault it is. But it is really not a big issue for Allegro.

Quote:

Makefiles are easy to understand, ...
we can manage autoconf...

Makefiles.ams are even easier to understand, really. I have found autoconf to be much more complex and hard to use right than automake (the automake manual has half size). Once you tame autoconf, automake is like a gift for the effort.
The main allegro Makefile.am has three pages and it works for Unixes and for Windows. If you look at it and imagine some comments, it does not seem to be so hard to maintain (I attach it to this post. Editor that can do syntax highlighting is strongly advised ;D ). If the autotools get accepted, I will write a complete documentation of the build system to the wiki.

Quote:

The primary build system for Allegro 5 will be CMake.

I would like to be able to cross compile with allegro. I can't see any better mean how to achieve this than autotools.

I suggest that you keep your favourite build system as the main one and that you accept the autotoos one if it works and don't to worry about it.

---------------------------------------------------
Mind is like space, it is open, clear and unlimited. -- Ole Nydahl

Evert
Member #794
November 2000
avatar

Quote:

the only cross-platform goodbye to allegro-config.

allegro-config is used on *nix ad OS X (technically a UNIX too, but we'll make the distinction anyway) - in other words, everywhere except Windows and DOS. Your build system isn't that general. Besides,

Quote:

I think that getting rid of those two is worth something.

I don't see the point. Really. What's your problem with allegro-config anyway?
I don't have an opinion on AM_PATH_ALLEGRO, since I'm only half sure of what it is and what it'd be useful for.

Quote:

I would like to be able to cross compile with allegro. I can't see any better mean how to achieve this than autotools.

Err... CMake?
I think Peter does this to test the Windows port through Wine.

Quote:

I suggest that you keep your favourite build system as the main one and that you accept the autotoos one if it works and don't to worry about it.

That's the point he was trying to make: if it works now there is no guarantee it'll stay that way. Right now, whenever I make a change to the CMake build system, someone has to fix the SCons system to make sure they're still compatible. That's already a hassle. Can you really see someone taking on a third build system? What's stopping us from having a dozen others as well?

Matěj Týč
Member #9,863
June 2008
avatar

Quote:

- in other words, everywhere except Windows and DOS. Your build system isn't that general.

autotools build system is able to work on unixes, OSX and Windows (MSYS). It is certainly more general than allegro-config

Quote:

Err... CMake?
I think Peter does this to test the Windows port through Wine.

By "cross-compile with allegro" means that you have a program on Linux that uses allegro and you want to cross compile the program's, let's say, Windows version (= this is something else than cross-compiling allegro itself)
When one uses autotools, it is like ./configure --host i486-ming32 && make
The current solution involving allegro-config fails. pkg-config solution would also fail, by the way. Libtool can do that well.

Autotools are a standard on unixes and any cross-platform-and-unix library should provide some support for them to make the above possible for its users. This is the reason why it makes sense to have autotools build system supported. The current support of autotools is not transparent and does not allow cross compilation. I don't know what is the advantage of having both scons and cmake though...

---------------------------------------------------
Mind is like space, it is open, clear and unlimited. -- Ole Nydahl

Elias
Member #358
May 2000

Quote:

By "cross-compile with allegro" means that you have a program on Linux that uses allegro and you want to cross compile its, let's say, Windows version.

That's what everyone means, it works with Allegro 4.3.x makefiles as well as cmake in 4.9.x.

--
"Either help out or stop whining" - Evert

Evert
Member #794
November 2000
avatar

Quote:

autotools build system is able to work on unixes, OSX and Windows (MSYS).

I thought you said your build system didn't work on OS X?

Quote:

It is certainly more general than allegro-config

allegro-config isn't a build system. It's a custom shell script that spits out compiler options on your current platform. It's as general as anyone wants it to be. That didn't answer my question though.

Quote:

By "cross-compile with allegro" means that you have a program on Linux that uses allegro and you want to cross compile its, let's say, Windows version.

Of course that's what it means, what did you think I meant?

Quote:

Autotools are a standard on unixes

Yes. But for how much longer?
It won't go away, but the question is whether it'll be there as a legacy tool chain to support older applications or whether it'll be widely used by new applications.

Quote:

any cross-platform-and-unix library should provide some support for them to make the above possible for its users. This is the reason why it makes sense to have autotools build system supported.

There's two things that need to be kept separate here for clarity: offering support for other packages that use autotools to work with Allegro and being able to compile Allegro itself through autotools. One does not imply the other.
The first I think everyone can agree on (or made to agree on) is desirable; I have no idea how hard this is to do though, but maybe you can comment on that (giving a precise indication of what's needed). My understanding is that this is what allegro.m4 is for. The second one obviously not everyone can agree on.

Personally, I like being able to do "./configure && make && sudo make install" more than doing "mkdir Build; cd Build; cmake .. && make && sudo make install" for a number of reasons, one of them being I'm not as familiar with CMake and have trouble finding what I need if things don't work as they should. However, it does seem easy to get into. At the end of the day it doesn't matter much either way, because it's just a build system. The important thing is it works and is maintainable.

Quote:

The current support of autotools is not transparent and does not allow cross compilation.

The cross compilation instructions in the manual don't work? This is a real question, I know they worked years ago when I last tried it.

Quote:

I don't know what is the advantage of having both scons and cmake though...

Pretty much the same as having both CMake and autotools, I'd imagine. ;)

MiquelFire
Member #3,110
January 2003
avatar

Please note, not everyone using Allegro on Windows will want to install MSYS. Outside of cross-compiling, autotools and Windows don't mix. Also, you need to deal with the MSVC users as well. You going to tell them to install MSYS just to make a VC project file? And these people may be the types who don't even know what a command prompt is.

CMake seems to be the best tool for handling generating the make/project files on Windows from what I seen (there's qmake as well which is for Trolltect's QT BTW, it works nicely as well).

---
Febreze (and other air fresheners actually) is just below perfumes/colognes, and that's just below dead skunks in terms of smells that offend my nose.
MiquelFire.red
If anyone is of the opinion that there is no systemic racism in America, they're either blind, stupid, or racist too. ~Edgar Reynaldo

Evert
Member #794
November 2000
avatar

Quote:

Please note, not everyone using Allegro on Windows will want to install MSYS. Outside of cross-compiling, autotools and Windows don't mix. Also, you need to deal with the MSVC users as well. You going to tell them to install MSYS just to make a VC project file? And these people may be the types who don't even know what a command prompt is.

Well, that's another thing, but I don't think Matěj is suggesting that Windows users be forced to use autotools, just that they'd have the option.

Matěj Týč
Member #9,863
June 2008
avatar

Quote:

What's your problem with allegro-config anyway?

I hope that this is your question that I have lost :-)
allegro-config is not an elegant solution today. For instance, if you have multiple allegros installed, it is of no use AFAIK.
1. pkg-config can do the same in much more elegant way
2. libtool can do more than that in an even more elegant way.

Elias said:

That's what everyone means, it works with Allegro 4.3.x makefiles as well as cmake in 4.9.x.

I am sorry, but I don't understand. I can't see what allegro makefiles have to do with cross-compiling my program. Basically, the problem is: What should I tell to the linker?

Quote:

I thought you said your build system didn't work on OS X?

It does not work now, but it has a good potential to work there.

Quote:

There's two things that need to be kept separate here for clarity: offering support for other packages that use autotools to work with Allegro and being able to compile Allegro itself through autotools. One does not imply the other.

You are right. One transition is significantly easier than the other one, though ;)

Quote:

The cross compilation instructions in the manual don't work?

I haven't found any specific cross-compiling instructions in allegro42 manual so far. I have found mingw instructions that mention cross-compilation, but no mention of autotools support there.

Quote:

Pretty much the same as having both CMake and autotools, I'd imagine.

Well, maybe from your point of view. But distribution packagers will have much easier job with autotools. And you can also do 'make distcheck' that does the package without unnecessary files + lots of tests for you...

The main question for me is whether automake + libtool can make it into the repository. I think that those tools should be given a chance on 4.2 and 4.3 branches. Then all of you can come and see whether it bites or not or whether it is really not maintainable. :)

2MiquelFire: Don't worry now, it will come in the second wave :D (joke)

---------------------------------------------------
Mind is like space, it is open, clear and unlimited. -- Ole Nydahl

Elias
Member #358
May 2000

Quote:

I am sorry, but I don't understand. I can't see what allegro makefiles have to do with cross-compiling my program. Basically, the problem is: What should I tell to the linker?

Well, true, we don't support any autotools-specific way to crosscompile your own games using Allegro, I didn't even know that was possible (and we don't even use autotools right now to cross-compile Allegro itself). (And who would use autotools to compile their game anyway? :P)

--
"Either help out or stop whining" - Evert

Matěj Týč
Member #9,863
June 2008
avatar

Quote:

And who would use autotools to compile their game anyway? :P

Come on, I would use autotools even for hello world!
But there are another projects that may benefit from that. Don't forget that adding autotools support for projects using allegro is really trivial since they usually depend ONLY on allegro!
Anyway, take a look here: http://garden.sourceforge.net/
Providing some bulletproof autotools support would allow making binary releases or packages for all sorts of platforms with an absolutelly minimal effort.

---------------------------------------------------
Mind is like space, it is open, clear and unlimited. -- Ole Nydahl

SiegeLord
Member #7,827
October 2006
avatar

Can't wait until an equally committed person comes along advocating Ant/Jam/QMake/Cook/others, so that Allegro will have not one, not two, but every single build system there is. ::)

CMake can cross-compile. CMake can make packages. Why not implement these features in CMake instead of adding a completely new build system for the very purpose of adding those features?

"For in much wisdom is much grief: and he that increases knowledge increases sorrow."-Ecclesiastes 1:18
[SiegeLord's Abode][Codes]:[DAllegro5]:[RustAllegro]

Thomas Fjellstrom
Member #476
June 2000
avatar

Quote:

Come on, I would use autotools even for hello world!

I hope thats a joke. Autotools adds nearly a megabyte of overhead to any project its added to.

Quote:

Why not implement these features in CMake instead of adding a completely new build system for the very purpose of adding those features?

The only feature the Cmake build setup doesn't have yet is proper cross compiling, but I don't think its that hard to setup, just tell it to make mingw make files, and set CC to the mingw cross compiler. If that doesn't work, it probably only needs a little bit of work.

The one thing that I would like to see added to allegro is pkg-config support. That would give us instant support of more than one OpenSource IDE. Allegro would show up as a library in a list in the IDE that people can choose from, and it'd all "just work"&tm;

--
Thomas Fjellstrom - [website] - [email] - [Allegro Wiki] - [Allegro TODO]
"If you can't think of a better solution, don't try to make a better solution." -- weapon_S
"The less evidence we have for what we believe is certain, the more violently we defend beliefs against those who don't agree" -- https://twitter.com/neiltyson/status/592870205409353730

Peter Wang
Member #23
April 2000

Quote:

The only feature the Cmake build setup doesn't have yet is proper cross compiling, but I don't think its that hard to setup, just tell it to make mingw make files, and set CC to the mingw cross compiler. If that doesn't work, it probably only needs a little bit of work.

The cross compiler support is there, but just requires one long-ish option to activate:

cmake -DCMAKE_TOOLCHAIN_FILE=cmake/Toolchain-mingw.cmake .

I'd integrate it better into the CMake build, but as far as I know, there are no standards for cross compilers. We have to know where the root of the cross compile environment is, e.g. "/usr/local/cross-tools", and the name of the C and C++ compilers, e.g. "i386-mingw-gcc". And of course the target system, e.g. "Windows". I could make them all options, but it's probably easier just to edit the Toolchain-mingw.cmake file.

EDIT: actually, that would be too late. You really have to pass that on the command line.

SiegeLord
Member #7,827
October 2006
avatar

Quote:

The one thing that I would like to see added to allegro is pkg-config support.

Here's how taglib does it (it's some KDE library). If we need more dependencies we can find paths to them via CMake functions for that I'd imagine.

configure_file(${CMAKE_CURRENT_SOURCE_DIR}/taglib_c.pc.cmake ${CMAKE_CURRENT_BINARY_DIR}/taglib_c.pc )

#Later...

INSTALL( FILES  ${CMAKE_CURRENT_BINARY_DIR}/taglib_c.pc DESTINATION ${LIB_INSTALL_DIR}/pkgconfig)

Where taglib_c.pc.cmake contains:

prefix=${CMAKE_INSTALL_PREFIX}
exec_prefix=${CMAKE_INSTALL_PREFIX}
libdir=${LIB_INSTALL_DIR}
includedir=${INCLUDE_INSTALL_DIR}


Name: TagLib C Bindings
Description: Audio meta-data library (C bindings)
Requires: taglib
Version: ${TAGLIB_LIB_MAJOR_VERSION}.${TAGLIB_LIB_MINOR_VERSION}.${TAGLIB_LIB_PATCH_VERSION}
Libs: -L${LIB_INSTALL_DIR} -ltag_c
Cflags: -I=${INCLUDE_INSTALL_DIR}/taglib

"For in much wisdom is much grief: and he that increases knowledge increases sorrow."-Ecclesiastes 1:18
[SiegeLord's Abode][Codes]:[DAllegro5]:[RustAllegro]

Peter Wang
Member #23
April 2000

How would you choose profiling or debug libraries? More .pc files?

SiegeLord
Member #7,827
October 2006
avatar

I'd imagine so, yes. I can't seem to find an example of such a library that has these different versions to confirm that though.

"For in much wisdom is much grief: and he that increases knowledge increases sorrow."-Ecclesiastes 1:18
[SiegeLord's Abode][Codes]:[DAllegro5]:[RustAllegro]

 1   2   3 


Go to: