LinuxQuestions.org
Visit the LQ Articles and Editorials section
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices

View Poll Results: Do you understand autotools?
Can hack all the config files and write my own macros. 5 20.00%
Use it regularly in projects but haven't the foggest how it works. 8 32.00%
I tried once but couldn't figure it out. 6 24.00%
Haven't even tried it yet. 3 12.00%
What's autotools? 3 12.00%
Voters: 25. You may not vote on this poll

Reply
 
Search this Thread
Old 03-09-2012, 01:32 PM   #1
hydraMax
Member
 
Registered: Jul 2010
Location: Skynet
Distribution: Debian + Emacs
Posts: 467
Blog Entries: 60

Rep: Reputation: 51
Do you understand how autotools works?


Just curious. Poll should be attached.
 
Old 03-10-2012, 10:01 PM   #2
jhwilliams
Senior Member
 
Registered: Apr 2007
Location: Portland, OR
Distribution: Debian, Android, LFS
Posts: 1,168

Rep: Reputation: 206Reputation: 206Reputation: 206
Those three who "can hack all the config files and write [their] own macros" are either boisterously optimistic -- or should share their secrets! Autotools is scary.
 
Old 03-11-2012, 09:06 AM   #3
GazL
Senior Member
 
Registered: May 2008
Posts: 3,328

Rep: Reputation: 884Reputation: 884Reputation: 884Reputation: 884Reputation: 884Reputation: 884Reputation: 884
I tried to read up on it once, but before I got to a point where I could actually use it I came to the conclusion that "the cure was worse than the disease". Makefiles may have their limitations, but at least they're understandable (for the most part).
 
Old 03-11-2012, 11:36 AM   #4
hydraMax
Member
 
Registered: Jul 2010
Location: Skynet
Distribution: Debian + Emacs
Posts: 467
Blog Entries: 60

Original Poster
Rep: Reputation: 51
Quote:
Originally Posted by GazL View Post
I tried to read up on it once, but before I got to a point where I could actually use it I came to the conclusion that "the cure was worse than the disease". Makefiles may have their limitations, but at least they're understandable (for the most part).
In theory, at least, if you skip over using Automake, then you are basically just writing a normal Makefile (the Makefile.in), but with a bunch of free variables (directory locations, etc.) to work with given to you by the configure script. Or anyway that's the impression I got from documentation.
 
Old 03-12-2012, 10:50 PM   #5
ntubski
Senior Member
 
Registered: Nov 2005
Distribution: Debian
Posts: 2,396

Rep: Reputation: 814Reputation: 814Reputation: 814Reputation: 814Reputation: 814Reputation: 814Reputation: 814
Quote:
Originally Posted by jhwilliams View Post
Those three who "can hack all the config files and write [their] own macros" are either boisterously optimistic -- or should share their secrets! Autotools is scary.
The "secrets" are all in the manual.
 
Old 03-13-2012, 04:37 AM   #6
NevemTeve
Senior Member
 
Registered: Oct 2011
Location: Budapest
Distribution: Debian/GNU/Linux, AIX
Posts: 1,618

Rep: Reputation: 484Reputation: 484Reputation: 484Reputation: 484Reputation: 484
They are way above the human understanding... (at least my understanding)

Random note: as a hobby, I compile open source software on AIX, it's quite common that I have to hack configure scripts (not that I actually understand them), for example:
Code:
find . -name configure -o -name config.rpath |\
while read FILE; do
    sed_repl 's|hardcode_direct=.*$|hardcode_direct=no|
              s|hardcode_libdir_flag_spec=.*$|hardcode_libdir_flag_spec=|' "$FILE"
done

Last edited by NevemTeve; 03-13-2012 at 04:38 AM.
 
Old 03-15-2012, 06:04 AM   #7
KenJackson
Member
 
Registered: Jul 2006
Location: Maryland, USA
Distribution: Fedora, Arch
Posts: 572

Rep: Reputation: 64
There really needs to be a choice between 1 and 2. "haven't the foggest" does NOT describe me. I read through portions of the scripts to see what's going on. I've even improved my bash scripting skill be seeing the tricks they use. Though it's still very daunting.

Quote:
Originally Posted by NevemTeve View Post
... as a hobby, I compile open source software on AIX, ...
AIX? Grief! Do you have a hulking IBM mainframe in your basement?
 
Old 03-15-2012, 06:09 AM   #8
Markus Franke
LQ Newbie
 
Registered: Nov 2010
Distribution: Ubuntu 11.04
Posts: 13

Rep: Reputation: 2
I once stumbled on the following overview how all files are connected with each other and I found it really helpful.

http://www.adp-gmbh.ch/misc/tools/co...iles_used.html
 
1 members found this post helpful.
Old 03-18-2012, 09:51 PM   #9
ta0kira
Senior Member
 
Registered: Sep 2004
Distribution: FreeBSD 9.1, Kubuntu 12.10
Posts: 3,078

Rep: Reputation: Disabled
Quote:
Originally Posted by KenJackson View Post
There really needs to be a choice between 1 and 2. "haven't the foggest" does NOT describe me.
I agree. They are no worse than manually maintaining a large makefile.

I think a lot of people forget that the main purpose of autotools is to offload the work involved in allowing for a multitude of targets within the build system. The majority of what autotools does is customize makefiles to account for what's on the system you're compiling on. And, aside from what's inherently required for the build (e.g. compiler, linker, headers,) it really only needs a bourne shell and GNU make.
Kevin Barry
 
Old 03-19-2012, 08:48 AM   #10
firstfire
Member
 
Registered: Mar 2006
Location: Ekaterinburg, Russia
Distribution: Debian, Ubuntu
Posts: 620

Rep: Reputation: 362Reputation: 362Reputation: 362Reputation: 362
Quote:
Originally Posted by ta0kira View Post
I agree. They are no worse than manually maintaining a large makefile.

I think a lot of people forget that the main purpose of autotools is to offload the work involved in allowing for a multitude of targets within the build system. The majority of what autotools does is customize makefiles to account for what's on the system you're compiling on. And, aside from what's inherently required for the build (e.g. compiler, linker, headers,) it really only needs a bourne shell and GNU make.
Kevin Barry
..., `sed' and `awk'
 
Old 03-19-2012, 08:57 AM   #11
orgcandman
Member
 
Registered: May 2002
Location: dracut MA
Distribution: Ubuntu; PNE-LE; LFS (no book)
Posts: 594

Rep: Reputation: 102Reputation: 102
and m4, and libtool.

The actual autotools API is pretty straight-forward, and writing an auto tools check macro in m4 is not terribly difficult.

The question is - do you really need such a hammer?
 
Old 03-19-2012, 02:30 PM   #12
gnashley
Amigo developer
 
Registered: Dec 2003
Location: Germany
Distribution: Slackware
Posts: 4,750

Rep: Reputation: 462Reputation: 462Reputation: 462Reputation: 462Reputation: 462
the configure scripts do *not* need m4, libtool, perl, autoconf or automake. Only when *generating* autotools files are these needed.
 
Old 03-19-2012, 04:02 PM   #13
orgcandman
Member
 
Registered: May 2002
Location: dracut MA
Distribution: Ubuntu; PNE-LE; LFS (no book)
Posts: 594

Rep: Reputation: 102Reputation: 102
Quote:
Originally Posted by gnashley View Post
the configure scripts do *not* need m4, libtool, perl, autoconf or automake. Only when *generating* autotools files are these needed.
This is true, but I was talking about autotools, not just configure scripts. I was responding to tak0ira's comment about "The majority of what autotools does is customize makefiles to account for what's on the system you're compiling on. And, aside from what's inherently required for the build (e.g. compiler, linker, headers,) it really only needs a bourne shell and GNU make." Autotools is more than the configure script, and requires autom4te, libtool, sed/awk, autoconf, aclocal, automake, gnu-make, pkg-config to name (I think) the majority. Each of these has their own dependencies.

I've had configure scripts included with projects FAIL TO EXECUTE for a variety of reasons, requiring that I rerun autoreconf -i to regenerate a configure script. OR there's always the case where the project doesn't include a ./configure (gaim's CVS repository about 10 years back was this way). The advantage of autotools has less to do with the configure script itself as it has to do with the massive infrastructure used to generate that script. In those cases, you MUST have the full autotools environment or you can't even TRY to hack together a makefile that will work.
 
Old 03-19-2012, 04:15 PM   #14
ta0kira
Senior Member
 
Registered: Sep 2004
Distribution: FreeBSD 9.1, Kubuntu 12.10
Posts: 3,078

Rep: Reputation: Disabled
Quote:
Originally Posted by orgcandman View Post
This is true, but I was talking about autotools, not just configure scripts. I was responding to tak0ira's comment about "The majority of what autotools does is customize makefiles to account for what's on the system you're compiling on. And, aside from what's inherently required for the build (e.g. compiler, linker, headers,) it really only needs a bourne shell and GNU make." Autotools is more than the configure script, and requires autom4te, libtool, sed/awk, autoconf, aclocal, automake, gnu-make, pkg-config to name (I think) the majority. Each of these has their own dependencies.

I've had configure scripts included with projects FAIL TO EXECUTE for a variety of reasons, requiring that I rerun autoreconf -i to regenerate a configure script. OR there's always the case where the project doesn't include a ./configure (gaim's CVS repository about 10 years back was this way). The advantage of autotools has less to do with the configure script itself as it has to do with the massive infrastructure used to generate that script. In those cases, you MUST have the full autotools environment or you can't even TRY to hack together a makefile that will work.
Certainly the developer needs those things, but if you make dist then the package will include configure, etc. and auto* won't need to be run again for it to work. If you're building from a repo and not from an archive intended for distribution, that's entirely different from what I was talking about in my previous post. And you've essentially just expressed a tautology: If the project uses autotools then you might need autotools installed to work on the project. You could say the same thing about flex/bison: If I write a parser and don't put the generated sources in the repo then of course you'll have to generate them, but that's not the fault of the tools.
Kevin Barry
 
Old 03-20-2012, 02:26 AM   #15
theNbomr
LQ 5k Club
 
Registered: Aug 2005
Distribution: OpenSuse, Fedora, Redhat, Debian
Posts: 5,395
Blog Entries: 2

Rep: Reputation: 903Reputation: 903Reputation: 903Reputation: 903Reputation: 903Reputation: 903Reputation: 903Reputation: 903
I'd put it in the category of 'I really should learn this, now that I've seen what it does.' Kind of like emacs or Eclipse.
--- rod.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Help me understand how cryptsetup works and confirm it can't be used with GParted... xtiansimon Linux - Software 2 07-20-2011 03:51 PM
[SOLVED] understand how traffic control tc works ano Linux - Kernel 2 01-18-2011 05:55 AM
Newbie,ppc64: a problem with portage, trying to understand how gentoo works NoWone Gentoo 1 12-28-2009 05:50 PM
Does anyone understand why the audio works, but will not come through my TV? maestro52 Fedora 1 12-15-2009 07:00 PM
autotools sergio21 Programming 1 01-16-2007 01:53 AM


All times are GMT -5. The time now is 04:13 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration