Find the answer to your Linux question:
Results 1 to 4 of 4
I've been a Windows programmer for some times. I've written some Unix based C++ programs for myself over the years, but basically very simply things with either very simple make ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Mar 2005
    Posts
    38

    configuring and makefiles and such


    I've been a Windows programmer for some times. I've written some Unix based C++ programs for myself over the years, but basically very simply things with either very simple make files or sometimes just building them from the command line by hand.

    Most applications one has to build come with configure and Makefile. configure is executeable and the Makefiles usually have options for installations and such.

    My first question is in regards to configure. It appears that configure collects information specific to the system which I assume is then used to populate constants in a header file which are then used in the app to make decisions about how to deal with different system functionality that may or may not be installed. Since most apps come with a configure script, I take it it's not built into the system. Surely people don't write their own from scratch for each application.

    Is my understanding generally correct? Is there a list somewhere of the data collected? Is configure "configurable" to collect certain information? Any information on this would be helpful.

    My next question is in regards to make files. Are these generally done by hand or are there tools that people generally use for building the make files. If so, what tools?

    Thanks.

    Pete

  2. #2
    Linux Guru techieMoe's Avatar
    Join Date
    Aug 2004
    Location
    Texas
    Posts
    9,496

    Re: configuring and makefiles and such

    Quote Originally Posted by pdavis68
    My next question is in regards to make files. Are these generally done by hand or are there tools that people generally use for building the make files. If so, what tools?

    Thanks.

    Pete
    You *can* create makefiles by hand, and for some small projects (with only a few files) it's actually easier in my opinion. However, there are Makefile generators available, such as automake.
    Registered Linux user #270181
    TechieMoe's Tech Rants

  3. #3
    Linux Guru
    Join Date
    Oct 2001
    Location
    Täby, Sweden
    Posts
    7,578
    What you are interested in is probably the autoconf and automake tools. Autoconf creates the configure script from an M4 input file usually named configure.in or configure.ac. If you look in most package, you'll see configure.in or configure.ac along with them.

    Automake is what create the Makefile.in files from Makefile.am input files. The actual Makefiles are then created by configure from the Makefile.in files.

    Both of these tools are documented in great info in texinfo. See `'info Autoconf' and `info automake' (note that you must have a capital A in autoconf to get its texinfo).

  4. #4
    Linux Guru lakerdonald's Avatar
    Join Date
    Jun 2004
    Location
    St. Petersburg, FL
    Posts
    5,035
    Although Makefile.am files are some time a bit redundant, as dependending on what you are doing, and how complex it is, I've honestly found that it's a hell of a lot easier to just skip the automake step and write the Makefile.in by hand.
    And if you ever are building a project that doesn't need ./configure for anything, you can just skip the Makefile.am/.in step and write a Makefile by hand. It's simple enough, IMHO.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •