Slashdot Mirror


Alternatives to Autoconf?

Despairing Developer queries: "Once autoconf was a great way to make widely portable programs. But now when you have to spend more time sorting out incompatibilities between autoconf versions, breaking battles between autoconf compatibility wrappers and configure.in compatibility functions that tries to outsmart each other, and on top of that see the list of dependencies increase (it's not that fun to compile perl on unicos) and performance diving rapidly, what is your escape plan? Is there a drop in replacement for autoconf? Is there something else out there that is as portable as autoconf to use instead?"

34 of 108 comments (clear)

  1. QMake by rufus0815 · · Score: 3, Interesting

    QMake (from Trolltech) is a possible replacement, though not free (according to the FSF)!

    1. Re:QMake by blackcoot · · Score: 2, Informative

      not entirely sure why this got marked as a troll, but i guess that's what the meta-mod system is for. two things: firstly, it's available under some crazy dual license scheme which allows you the option of accepting either the QPL or the GPL (see here). secondly, i don't think that qmake comes even close to covering the ground auto(conf|make) does. i guess the closest relation is to automake, except crippled. as far as i know, it doesn't have any of the detection / configuration stuff that autoconf does. of course, it's been a while since i last used it, so that may have changed in newer versions.

    2. Re:QMake by rufus0815 · · Score: 3, Interesting

      AFAIK it still hasn't got a lot of features that automake has (specially the detection / configuration stuff - as you said correctly).
      Never the less, it's easy for beginners, and it's cross-plattform!
      So for posix developers it might be unsufficient - for Windoze developers (M$VC) it would be a great improvement (the way M$VC handles the project settings is horrific)!

  2. mod article up! by blackcoot · · Score: 5, Insightful

    i wish there was a way to moderate articles up, because you've hit on one of my major (*major*) pet psychotic hatreds regarding developing software. auto(conf|make) sucks badly. it's bearable if you're developing from scratch (not depending on other libraries) or require that your bundled versions of libraries be used. but when your software depends on, say, 123098123871237 other packages (i.e. you're writing for gnome or kde), you're boned.

    unfortunately, there are no reasonable replacements that i know of, which is probably a testament to the nastiness inherent in solving this problem. a pity, really -- auto(conf|make) and company are a really good idea (in theory). unfortunately, there seems to be some really bad crack smoke involved in designing these tools. first (and probably foremost) in my mind is why isn't there a database of some sort which would at least allow the option of keeping track of which versions of what applications have been configured how and installed where.

    1. Re:mod article up! by noselasd · · Score: 5, Informative

      Try pkg-config --list-all
      pkg-config provides you with compiler/linker/preprocessor flags for
      compiling a program that uses various libraries.
      Now, if only all libraries provided a .pc file..

    2. Re:mod article up! by Crayon+Kid · · Score: 2, Interesting

      Which brings me to another issue: why isn't the output from 'configure --help' available in machine-readable form? Say, XML? This would help a lot with the creation of graphical configuration tools for source packages. AFAIK there are a couple of helper apps out there that do this, but they have to go through horrible hoops parsing the output from 'configure --help'.

      --
      i ate crayons when i was a kid and now i have two braincells and the blue ones taste nicer
    3. Re:mod article up! by Chris+Z.+Wintrowski · · Score: 2, Funny
      ...This would help a lot with the creation of graphical configuration tools for source packages. ...


      How is a graphical configuration tool going to help anything? You want to pile another layer of crap onto an already burdened autoconf just so you can play with your mouse? What the hell is wrong with you? Don't be such a pussy: type './configure --help', figure out the options on the command line, and stop recommending open source programmers waste their time developing mere gimmicks. Do you work for Microsoft or something?

      --
      - Chris Z. Wintrowski -
      [ Site ]
  3. Two suggestions: by warrax_666 · · Score: 2, Informative

    These are both sort of combined configuration and build systems (which is the way it should be IMHO). Scons requires Python (>=1.5.2, IIRC), so it is as "only" as portable as Python itself (which is to say "very") while cmake doesn't require anything except a C++ compiler. The actual "language" in Scons is just regular python while cmake uses a hideous custom language.
    --
    HAND.
    1. Re:Two suggestions: by jrumney · · Score: 3, Insightful

      Using a Ruby based configuration makes sense if your project uses Ruby anyway, just as using Ant makes sense for Java projects, but for building standalone C/C++ projects non-standard build tools are just another dependancy that will ensure that noone will bother to use your project because you set the barriers too high. The benefit of autoconf/automake is that only the developers need to use it. End users run a pre-built configure script, which runs in /bin/sh.

  4. problem inevitable by fraccy · · Score: 5, Insightful

    I feel your pain, but this isn't just autoconf. Its a general theme of the way we compute. Version nightmares. I think the problem is unavoidable because of the way we currently compute: 1) Competition and the enormous diversity today will always leads to heterogenous systems, no matter how good their intentions initially 2) The semantics of software and its environment are not embedded in the data, which of course means when a version changes, something somewhere breaks, and someone somewhere has to fix it Theres only two solutions, either by decreasing diversity through standardisation (oh heck the version of that keeps changing too), or real autonomic computing operating at a higher level of abstraction. Roll on autonomic computing, real self-configuring and self-adapting systems. Until then, we can only attempt to minimise the problems, and can only ever solve them in a limited scope for a limited period of time.

  5. Two awful suggestions by sofar · · Score: 4, Informative


    they may be a drop in replacement for developers, but for packagers and people trying to track changes and new versions, both cmake and scons (blender!) are horrible. They cost us (A group of 10 people working on a distro) enormous amount of extra time (blender's upgrade to .33 took me a whole day to figure out, whereas before it only takes me 20 minutes to fully test a new blender version).

    all in all autoconf maybe a problem for developers, but for packagers it is still *by* *far* the best.

  6. You have been 's CONNED by sofar · · Score: 4, Interesting

    SCons isn't the solution either. SCons relies way too heavily on python and doesn't make better distribution tarballs. Most developers using SCons rooll out horrible tarballs that cannot even detect the proper Python version! (blender!!!).

    SCons makes you lazy, do the work, then your application builds BETTER on MORE platforms with autoconf

  7. Try PMK, for example by wsapplegate · · Score: 5, Informative

    You can find it at pmk.sourceforge.net

    Or else, you can have a look at A-A-P, by nobody else than Bram Moolenaar, the author of the One True Editor, a.k.a. ViM :-)

    There is also Package-framework, by Tom Lord, the author of the infamous Arch SCM.

    I was about to mention SCons, too, but other people already did (it always pay to check other comments just before posting, especially on /. :-)

    To sum it up : there is no shortage of alternatives to the incredibly hairy Autoconf/Automake nightmare. The problem is, people are still using them for the very same reason they use CVS instead of Arch/Subversion, or Sendmail instead of Postfix/Exim : because they're considered ``standard'' tools, and people feel more comfortable with software they know to be used by plenty of other people (millions of programmers can't all be wrong. Can they ?). I really hope they'll stop making this kind of mistakes soon, so I won't need to curse them everytime I have to debug some Autoconf breakage...

    --
    Xenu brings order!
    1. Re:Try PMK, for example by cgreuter · · Score: 2, Insightful

      I took a quick look at pmk a while back. I got as far as this FAQ entry:

      7. Why not supporting cygwin?

      Because cygwin is not handling executable files as it should. It is absurd to have to take care about a trailing'.exe' under a Unix-like environment.

      Absurd it may be, but Windows is the most popular platform out there and refusing to support it because it's too icky is just plain dumb. They've refused to make pmk useful enough to actually be valuable to me, so I haven't bothered using it for anything.

  8. Mod parent up! by sofar · · Score: 4, Interesting

    pkg-config singlehandedly is creating a sea of calm in autoconf land while still keeping the strength of autoconf. Take Xfce4 for instance. Within a relatively short timeframe this small group (4-5 devs) have written an entire framework that compiles on tens of platforms by using PKG_CONFIG extensively together with autoconf

    1. Re:Mod parent up! by Jahf · · Score: 2, Insightful

      Maybe, but I often find as a user when trying to compile a package that has a .pc pkg-config file requirement for another package that that other package often forgets to leave it's .pc file around.

      For instance, when compiling Evo from fresh source on a version of SuSE awhile back, I installed the various -devel RPMs that were required and yet those -devel RPMs left out their .pc files, meaning that even though I had the development libraries, Evo couldn't find them.

      Not saying pkg-config may not be useful, but it needs to be standardized on like autoconf used to be before it becomes truly useful to the power user.

      Personally, I don't care which is used (pkg-config or a fixed autoconf) so long as it works well with others and is consistent.

      --
      It is more productive to voice thoughtful opinions (reply) than to judge (moderate) others.
    2. Re:Mod parent up! by sofar · · Score: 2, Informative


      well that's actually your distro's fault. And yes binary distro's suck at providing headers and other -config and .pc stuff you need.

      source distro's like Lunar-linux provide a wonderful rich platform with all of these -dev stuff installed by default and the way the developer has meant it. These source distros are excellent for developers.

    3. Re:Mod parent up! by irix · · Score: 2, Informative

      As somone who works on an open-source project that requires evolution-devel to compile, let me say that I am well aware of that problem. When GNOME went over to pkgconfig, many distros took a while to build their -devel packages with the .pc files.

      That being said, I agree with the parent post - pkgconfig goes a long way toward solving problems with automake and autoconf. Everything in GNOME now uses it, so setting up the build environment for anything that depends on GNOME libraries is much, much easier. Hopefully other projects that provide libraries will follow in GNOME's footsteps.

      --

      Do you even know anything about perl? -- AC Replying to Tom Christiansen post.
    4. Re:Mod parent up! by KewlPC · · Score: 2, Interesting

      Until a project decides not to put it's .pc files in the standard place. For instance, when installing Clanlib on my Gentoo system (using Portage, no less), the .pc files didn't get put in /usr/lib/pkgconfig (which is where pkg-config expects them to be on Gentoo).

      Instead they got put in /usr/lib/clanlib-0.7.7, and when I tried to build a program that used pkg-config to find clanlib, the build broke. If I were a Linux newbie, I'd probably have just given up rather than try to find the .pc files that I knew were installed.

      I really don't want to get into some kind of PKG_CONFIG=$PKG_CONFIG:/some/directory:/some/other /directory:/yet/another/directory mess.

    5. Re:Mod parent up! by elFarto+the+2nd · · Score: 2, Interesting

      This is the one thing that bugs me about pkgconfig. I mean how hard can it be to add a --install option, allowing pkgconfig to choose where to place the .pc file.

      Maybe I'll go make a patch...

      Regards
      elFarto
  9. Solution to the Problem by aminorex · · Score: 2, Interesting

    > Is there something else out there that is as
    > portable as autoconf to use instead?

    Yeah. It's called GNU Make.

    Seriously, if you write your makefiles and your
    code in a responsibly portable manner, there's
    absolutely no reason for autoconf or automake.
    And it's not hard. I've done it repeatedly.
    The auto* tools are an antipattern virus.

    --
    -I like my women like I like my tea: green-
    1. Re:Solution to the Problem by grubba · · Score: 5, Insightful

      So how do you portably detect which taste of system calls you have on the OS without autoconf, and without an explicit database OS <=> feature?

      eg:

      • Is your getservbyname_r OSF/1- or Solaris-style?
      • Does your getspnam_r take 4 or 5 arguments?
      • Does your struct hostent have the field h_addr_list?
      • Are you on a Linux system with a broken <shed.h>?

      All of the above are easily detectable with autoconf.

      I however agree with you that there's absolutely no need for automake.

    2. Re:Solution to the Problem by aminorex · · Score: 2, Informative

      That's what ifdef is for.

      But more importantly, if you're writing application
      code using a system call layer, you've already lost
      the game.

      --
      -I like my women like I like my tea: green-
    3. Re:Solution to the Problem by Anonymous Coward · · Score: 3, Informative

      I had to anonymous answer you so I could mod parent up.

      Of course thats what ifdef is for, but ifdef isn't dangling its always:

      #ifdef SOMETHING

      and where do you think the SOMETHING comes from for cases like:

      * Is your getservbyname_r OSF/1- or Solaris-style?
      * Does your getspnam_r take 4 or 5 arguments?
      * Does your struct hostent have the field h_addr_list?
      *Are you on a Linux system with a broken ?

      I'll tell you; auto-conf doe some checks, possibly test-compiles, basically discovers the local landscape and sets a LOAD OF PREPROCESSOR SYMBOLS (OK, and custom makefiles blah blah, what do you think holds the #def's anyway) and then compiles the code full of #IFDEF's

      Sam

  10. Well,if you've got to build software for Crays ... by Anonymous Coward · · Score: 3, Interesting

    Chances are the other packages people here are talking about haven't ever been built on a cray, too. A Cray is not exactly common-place.

    Usually, the simplest way to deal with broken scripts/automake/autoconf tests, is to use a better shell. Take the bash, tcsh, or whichever shell works on Unicos, and run your autoconf tests throught that. If you think you've found a problem in autoconf itself, run the regression test suite and submit a bug report.

    A quick google search over the autoconf mailing list archive shows that there were 0 posts on Unicos in the last two years. So chances are, that any bugs in autoconf itself in the last two years have not been tested, or that it has no bugs on Unicos ;) I'd think that the autoconf developers would appreciate a good bug report, just like any other project would.

    If your problem is autoconf's performance, then a) use a faster shell, b) use --cache-file, c) use ccache to run those myriads of little C tests faster. Or fix the tests in question.

    A classic on slow platforms is the maximum shell length test. That one comes from libtool, not from autoconf. It's been vastly improved in libtool 1.5.6, for example. If your upstream doesn't use a recent version of libtool, convince them to do so. :)

  11. I have a replacement by Chemisor · · Score: 4, Interesting

    I was pretty fed up with autoconf myself, and wrote a little C app to emulate it. Initial ./configure time dropped to a second and reconfigure is instantaneous. I would recommend it for your simpler projects: bsconf.c and bsconf.h, the latter being the configuration file.

  12. Hate to say it, but ... by Russ+Steffen · · Score: 4, Insightful

    ... Those who do not understand autoconf are doomed to reinvent it. Poorly.

  13. Translation (was Re:Ant) by happyfrogcow · · Score: 3, Funny

    What kind of ${CRAP} are you writing that need ${YOURLANGSUCKS} anyway?

    ${MYLANGROXORS}

    ${FSCKYOU}

  14. Autotools are a nightmare by spitzak · · Score: 2

    Case in point: I wanted to compile cairo on my Mandrake 9.1 system. I couldn't until I edited the autoconf file to remove "new commands" and added phony files to make pkgconfig happy. Then it compiled just fine and worked. I tried to compile the demos and was completely frustrated and eventually hand-wrote a trivial makefile and they all compiled just fine and worked (except for the GTK one...). I am now trying to compile the "Glitz" OpenGL backend, and I am running into the same troubles: I can't prove it yet, but I strongly suspect it will compile just fine on my machine, if I can just get around the mysteries and complaints of autoconf/automake/pkgconfig, probably by wasting a great deal of time and divining the basic, and probably simple, Makefile that would compile it.

    The incredibly frustrating, and dare I say stupid thing is that the only thing I need to "update" on my machine is the damn autoconf tools! I actually have all the libraries and headers these things need. That is completely backwards! In fact due to autoconf they have pretty much said "this only compiles on the very newest experimental Linux system". Well in that case, you have eliminated the need for "autoconf" and you could send out Makefiles that work only on a new Linux system. That would probably be easier for somebody like me to edit and get working on an older system.

    When you do try to fix this, you run into the horrifyingly bad syntax and rules of M4 and GMake. Supposedly this is because they want to be back-compatable and run on older systems. But they lie when they freely add new "autoconf" commands so that the newest version is needed. Why not scrap the whole thing and try a modern syntax?

    My proposed solution: make ONE compiled program that does "configure" and "make" and "make depend" (and "install" and "uninstall" and "clean" and "dist" and all the other special-cased targets...). This program can use the existing automake/conf stuff so it can be compiled for multiple platforms. The program then reads one file, in editable text (no XML, and it should be trivial to add/remove a source file by adding/deleting a line). This file should be parsed in a procedural way, with "if" and "for" statements and functions (ie it is perl or something) and the result should be the dependencies tree and it can then run the programs (the result is extremely static and has actual filenames and commands, not templates or "rules"). Make it really easy to add and remove switches to the compiler. Make it save user answers to questions in a file so it can provide those answers again, and make a gui program that provides panels and checkboxes to change those user answers. Make it automatically check for dependencies in any C style source files by looking for "#include" without running the compiler, and save the results in a binary database with date stamps so it can run this instantly as needed. Any package dependenciies should be checked with "if" statements in the file, the program would have enough commands to do typical file system things like look for files or grep a file for something, and it is then trivial to write a file that checks for something in multiple places by using "if-else" statements.

  15. Write portable code. by V.+Mole · · Score: 3, Interesting
    It's really not that hard. The autotools are crutch for people who can't be bothered to actually learn the C language and library, or the difference between POSIX and what their current environment provides. Go read #ifdef Considered Harmful (PDF) by Henry Spencer, about the right way to deal with portability problems, and notice that the whole approach of autoconf is wrong.

    "checking for stdlib.h..." indeed. If you don't have an ISO-C environment, you're so screwed that there's nothing autoconf can do to save you: you don't know how the language works, so whether or not you're missing a few library functions isn't going to make any difference.

    I once worked on a fairly large process control system, of which less than 1% was portability code. It ran on Solaris, AIX, HP-UX (this was pre-Linux). It also ran on VMS and WinNT. Most of the portability issues dealt with the entirely different models for process management and memory-mapped files, not with pipsqueek stuff like autoconf.

    It's real simple: you read the docs. You determine what the standard actually requires, not what your development system happens to do. And you program to that, then test.

    As for the autotools proclaimed ability to port to systems you weren't planning for, that's so much BS. If the system is sufficiently different that ANSI C and POSIX aren't sufficient, then you're going to have to update your code anyway.

    Replacing autoconf with some other crutch isn't going to help. Just ditch it entirely.

    1. Re:Write portable code. by Rob+Riggs · · Score: 2, Insightful
      The autotools are crutch for people who can't be bothered to actually learn the C language and library, or the difference between POSIX and what their current environment provides.

      Yours is a rather myopic and provincial view of the problem, IMHO. The autotools are a necessary evil when one has more dependencies than just ISO C. What versions of libraries are installed? What odd bugs must I work around? Where are the headers for package foo located on this system? What compiler options should I pass?

      It's real simple: you read the docs. You determine what the standard actually requires, not what your development system happens to do. And you program to that, then test.

      What do the standards say about which version of libjpeg is installed and where its headers are? What about the version of Gnome? What if I want to support both Gnome and KDE if they are available? How do I determine that with Make?

      I don't think you fully grasp the problems that the autotools actually do solve for developers.

      --
      the growth in cynicism and rebellion has not been without cause
  16. Re:more general question by grubba · · Score: 2, Informative

    autoconf has two purposes:

    • Retargeting the installation and configuring options (eg --prefix, --with-*).
    • Detection of the build environment (eg compiler, system calls, etc).

    Converting from a plain Makefile to configure.in+Makefile.in is straightforward if your Makefile already uses variables for binaries and directories.

    The main reason to use autoconf is the second point above; when you write code that uses system calls (eg read(2), write(2)) and not libc calls (eg fread(3C), fwrite(3C)), that differ between operating systems (eg BSD vs SysV vs POSIX), and need to detect which taste you have.

    To answer your questions: autoconf is something I hook in when:

    • the project is starting to get large,
    • when I've been bit by operating system incompatibilities,
    • or if I intend to release the code.
  17. I propose... by k4_pacific · · Score: 2, Funny

    A new program: autoconfconf

    I am struck by the recursive nature of the situation.

    --
    Unknown host pong.
  18. Re:how about java? by tradervik · · Score: 2, Interesting

    Indeed. We develop server-side code on Windows (2k and XP), and deploy on Linux, Windows, and Solaris. With three major products representing millions of lines of code developed over a period of approximately 6 years, we have never had a single instance of platform incompatibility.