Become a fan of Slashdot on Facebook

 



Forgot your password?
typodupeerror
×
User Journal

Journal Dave2 Wickham's Journal: Do YOU know autoconf? 5

Well, do you know autoconf? I sure as hell don't, but my hacked together configure scripts for bloat (CVS )...well...suck :P. I need some better ones, but I don't know how. If anyone does know how, please do!

This discussion has been archived. No new comments can be posted.

Do YOU know autoconf?

Comments Filter:
  • Dave,
    I noticed that bloat claims to be a perl script. I've only ever seen autoconf used for Compiled programs (C/C++) and was wondering what you would use it for in Perl.

    Also, I think CPAN has a comparable configuration process to autoconf that may be a little more PERL friendly.
  • Let me start by saying that I am by no means an expert with using Autoconf. Even so, I do not believe that Autoconf is what you want to use. I believe that autoconf is intended to be used with C/C++ programs.

    From the Autoconf info page:

    The files that `configure' creates are:
    • one or more `Makefile' files, usually one in each subdirectory of the package (*note Makefile Substitutions::);
    • optionally, a C header file, the name of which is configurable containing `#define' directives (*note Configuration Headers::);
    Autoconf's output is the "configure" script which then creates the given files. Most of the configuration steps in an autoconf file involve locating libraries and determining if a given header file contains a given symbol (usually be running the compiler).

    What you're doing is trying to find the location of the various decompression utilities (as well as cat and sed, used to insert the utilities into the bloat script).

    I personally would not try and pre-detect the scripts and wait until bloat is run to locate only the needed decompression script and then complain to the user that the required decompression software is not available. I'd also consider looking into using the file command to determine the compression type. Usually, a simple:

    if (system "gunzip --version") {
    # gunzip is present
    } else {
    # gunzip is missing
    }

    allows you to determine if the command is available. I'd suggest this way for two reasons: one, it removes the need for a configure step, and two, it prevents the user from getting scared when they find that they're missing uncompress and ar. It would allow a user to incrementally install decompression software as they discover a file using a compression technique that heretofore was unknown to them. (Mmm - stupid political-correctness shoehorned onto English - I loves me plural disagreements just to avoid assigning a gender to the user. Moving along...)

    Anyway, I don't think autoconf is useful for what you want to do - it's designed around C/C++ projects. You might be able to shoehorn it into another compiled language, but since its major output is config.h and a set of Makefiles, I'd suggest that it isn't what you want.

    (That and Autoconf is truly a pain to use. Just wait until you throw Automake into the process and you can get headaches for weeks! Plus, if you ever are in a really masochistic mood, you can look at the code they output.)

    • Thanks for the info...
      I think I will assume that the PATH variable is correctly set (as you suggested), and if it isn't, well I may try one of the "standard" locations, and if it isn't there, give the user info on where to get the util.
      Plus, if you ever are in a really masochistic mood, you can look at the code they output.
      I did - I've been mentally scarred for life :(.

      Anyway, I think I'll finish my coursework before I do any more work on bloat... I'm really lagging behind, I hate coursework :(.

1 Mole = 25 Cagey Bees

Working...