Author Topic: [patch] Autotools cleanup  (Read 1734 times)

0 Members and 1 Guest are viewing this topic.

[patch] Autotools cleanup
Hey all. I found this project through the BTRL game, and wanted to get it working better on Linux, but ran in to some problems along the way. Here's some progress I made.

The patch cleans up a lot of the Autotools stuff. The patch is against the fs2_open_3_6_9 branch, but it should patch against HEAD as best as I can tell.
  • remove acinclude.h: it only had obsolete or useless things that aclocal should put in aclocal.m4 for you when you run autoreconf.
  • configure.ac: update to Autoconf 2.61, fix some quoting, update deprecated macros.
  • code/Makefile.am: add missing files for wxfred2 (it compiles and runs, but doesn't seem to do much).
  • use *_CPPFLAGS for include paths (CPP==C Pre-Processor, not C++), and CXXFLAGS and CFLAGS for compiler flags.
    • A lot more could be done along these lines to use AC_SUBST's correctly in Makefile.am's
  • Add Makefile.am's for cfilearchiver and cfileextractor

There's actually a lot more I could do to bring this up to snuff, but I think this is enough for now.

btw, I am only just becoming familiar with CVS, so I hope the patch is generated correctly. I'm more of a fan of SVN (or pretty much anything other than CVS).

Now maybe I can start looking at actual code..  :)

[attachment deleted by ninja]

 

Offline taylor

  • Super SCP/Linux Guru
  • Moderator
  • 212
    • http://www.icculus.org/~taylor
Re: [patch] Autotools cleanup
Thanks!  I've give this a closer look next week and try and get the changes in.

A few comments though:
  • acinclude.m4 is there for a reason: some systems have required it in the past, and having it there reduces the support issues
  • Is autoconf 2.61 actually required?  I'd rather stick to the lowest required version rather than bumping it without a specific reason
  • The top-level Makefile.am already includes the ability to build cfilearchiver and cfileextractor.  Those tools also have no requirement on libcode.a.

 
Re: [patch] Autotools cleanup
  • everything in acinclude.m4 was something that aclocal should find from the dependency libraries and put in aclocal.m4. If people are having trouble, then they either need to install the dependency libraries development tools, or use a 'make distcheck' tarball that has an appropriately generated aclocal.m4 and configure script. Maybe setting up a daily CVS tarball could avoid some of the support problems.
  • Autoconf-2.54 is old enough that gentoo doesn't have ebuilds for it any more, so I can't really test this. I suspect 2.54 could be new enough.
  • ah, well, the layout of the tree is non-standard enough that I missed the "tools" target in the top-level Makefile.am. 99% of top-level Makefile.am's have only SUBDIRS in them, so I'm not sure I ever even looked in there. I assumed they depended on libcode because they are in the code directory. Which brings up a completely separate point about using paths in Makefile.am's at all, and keeping your library code in separate places from your binary code.. I was going to leave such things for a later (series of) patches. Anyway, I'll take those parts out for now.

new version attached.

[attachment deleted by ninja]

 

Offline taylor

  • Super SCP/Linux Guru
  • Moderator
  • 212
    • http://www.icculus.org/~taylor
Re: [patch] Autotools cleanup
everything in acinclude.m4 was something that aclocal should find from the dependency libraries and put in aclocal.m4. If people are having trouble, then they either need to install the dependency libraries development tools, or use a 'make distcheck' tarball that has an appropriately generated aclocal.m4 and configure script. Maybe setting up a daily CVS tarball could avoid some of the support problems.
I agree in principle, but having it there doesn't really hurt us, and does help out a minority of users who we would have to deal with, support wise.

I have thought about daily tarballs, but the code really doesn't change that much unless we are building up for a release.  Perhaps monthly, or something, but I just haven't been able to bring myself to see about getting that done.  I guess I need to figure out demand for such a thing and that might better motivate me to do something about it. :)

Quote
Autoconf-2.54 is old enough that gentoo doesn't have ebuilds for it any more, so I can't really test this. I suspect 2.54 could be new enough.
I had tested with earlier autoconf versions previously, so at least at one point it did work.  Supporting older distros (and we do have to deal with a few of those every now and then) and trying to work with GCC based tool-chains under Windows is why we were trying to keep the build requirements as low as possible.

Quote
ah, well, the layout of the tree is non-standard enough that I missed the "tools" target in the top-level Makefile.am. 99% of top-level Makefile.am's have only SUBDIRS in them, so I'm not sure I ever even looked in there. I assumed they depended on libcode because they are in the code directory. Which brings up a completely separate point about using paths in Makefile.am's at all, and keeping your library code in separate places from your binary code.. I was going to leave such things for a later (series of) patches. Anyway, I'll take those parts out for now.[/li][/list]
Yeah, the source tree is really setup for MSVC, not what us Linux users work with.  Xcode on OS X handles the current tree setup pretty well too, but that still doesn't make it any easier for automake.

 
Re: [patch] Autotools cleanup
everything in acinclude.m4 was something that aclocal should find from the dependency libraries and put in aclocal.m4. If people are having trouble, then they either need to install the dependency libraries development tools, or use a 'make distcheck' tarball that has an appropriately generated aclocal.m4 and configure script. Maybe setting up a daily CVS tarball could avoid some of the support problems.
I agree in principle, but having it there doesn't really hurt us, and does help out a minority of users who we would have to deal with, support wise.
Except when those upstream libraries change their macros, and we don't get the benefit. Also, it can be confusing to know which macro is being used if you keep your own copy but aclocal also grabs one. It took me a significant amount of time to figure that out. I urge you to stick to your principles on this one, not to simply "do what's easy". Can you perhaps point out an old thread or bug that has an example where not having the macros was an issue? another easy way to deal with those users is to say, if you can't figure it out, use a tarball, or a binary. I think this is reasonable. Not everybody needs to use the bleeding edge.
Quote
I have thought about daily tarballs, but the code really doesn't change that much unless we are building up for a release.  Perhaps monthly, or something, but I just haven't been able to bring myself to see about getting that done.  I guess I need to figure out demand for such a thing and that might better motivate me to do something about it. :)
daily snapshots shouldn't be hard to set up in a cron job, assuming make distcheck is working correctly (I haven't tried it, but it looks like the Makefile.am's have mostly been maintained correctly). Of course, no tarball should be generated if nothing changed. the script should update a working copy, check if anything changed, call make distcheck, and move the resulting tarball. maybe something like this:
Code: [Select]
cd $CVSDIR
if test -n "$(cvs up 2>/dev/null | grep '^[PU]')"; then
  make distcheck
  mv $PACKAGE.tar.gz $DOWNLOADSDIR/$PACKAGE-$(date +%Y%m%d).tar.gz
fi
    Quote
    Quote
    ah, well, the layout of the tree is non-standard enough that I missed the "tools" target in the top-level Makefile.am. 99% of top-level Makefile.am's have only SUBDIRS in them, so I'm not sure I ever even looked in there. I assumed they depended on libcode because they are in the code directory. Which brings up a completely separate point about using paths in Makefile.am's at all, and keeping your library code in separate places from your binary code.. I was going to leave such things for a later (series of) patches. Anyway, I'll take those parts out for now.[/li][/list]
    Yeah, the source tree is really setup for MSVC, not what us Linux users work with.  Xcode on OS X handles the current tree setup pretty well too, but that still doesn't make it any easier for automake.
    I think any of these tools can deal with a sane source code layout. it's not so much conforming to what automake wants (automake can pretty much deal with anything anyway--it already is, afterall), but to what is logical. Also, maybe you don't need to maintain project files for 5 IDEs. One for each platform seems more reasonable to me. But, I suppose you don't want to leave some developers out in the cold.