LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 11-30-2010, 01:42 PM   #1
sree_ec
Member
 
Registered: Sep 2010
Location: world
Distribution: Ubuntu 12.04LTS
Posts: 76

Rep: Reputation: 5
Smile Good tutorial to configure script and libtool


Hi All,

I am searching for good tutorials for Automake, configure and libtool.
Please share some.
I am familiar with makefiles but needs a fresh start in the above mentioned topics..

Regards
 
Old 11-30-2010, 05:12 PM   #2
alan_ri
Senior Member
 
Registered: Dec 2007
Location: Croatia
Distribution: Debian GNU/Linux
Posts: 1,733
Blog Entries: 5

Rep: Reputation: 127Reputation: 127
Automake, Configure script(1), Configure script(2), Libtool.
 
Old 11-30-2010, 05:40 PM   #3
ntubski
Senior Member
 
Registered: Nov 2005
Distribution: Debian, Arch
Posts: 3,780

Rep: Reputation: 2081Reputation: 2081Reputation: 2081Reputation: 2081Reputation: 2081Reputation: 2081Reputation: 2081Reputation: 2081Reputation: 2081Reputation: 2081Reputation: 2081
This appears to be out of date (eg it uses the obsolete version of AC_INIT).
 
1 members found this post helpful.
Old 11-30-2010, 06:26 PM   #4
alan_ri
Senior Member
 
Registered: Dec 2007
Location: Croatia
Distribution: Debian GNU/Linux
Posts: 1,733
Blog Entries: 5

Rep: Reputation: 127Reputation: 127
I'll add few more links and so to what I'd say is important too, considering what is related to what OP had in mind:

Autoconf, GNU coding standards, from which I'll quote this;

Quote:
Each GNU distribution should come with a shell script named configure. This script is given arguments which describe the kind of machine and system you want to compile the program for. The configure script must record the configuration options so that they affect compilation.

The description here is the specification of the interface for the configure script in GNU packages. Many packages implement it using GNU Autoconf (see Introduction in Autoconf) and/or GNU Automake (see Introduction in Automake), but you do not have to use these tools. You can implement it any way you like; for instance, by making configure be a wrapper around a completely different configuration system.

Another way for the configure script to operate is to make a link from a standard name such as ‘config.h’ to the proper configuration file for the chosen system. If you use this technique, the distribution should not contain a file named ‘config.h’. This is so that people won’t be able to build the program without configuring it first.

Another thing that configure can do is to edit the Makefile. If you do this, the distribution should not contain a file named ‘Makefile’. Instead, it should include a file ‘Makefile.in’ which contains the input used for editing. Once again, this is so that people won’t be able to build the program without configuring it first.

If configure does write the ‘Makefile’, then ‘Makefile’ should have a target named ‘Makefile’ which causes configure to be rerun, setting up the same configuration that was set up last time. The files that configure reads should be listed as dependencies of ‘Makefile’.

All the files which are output from the configure script should have comments at the beginning explaining that they were generated automatically using configure. This is so that users won’t think of trying to edit them by hand.

The configure script should write a file named ‘config.status’ which describes which configuration options were specified when the program was last configured. This file should be a shell script which, if run, will recreate the same configuration.

The configure script should accept an option of the form ‘--srcdir=dirname’ to specify the directory where sources are found (if it is not the current directory). This makes it possible to build the program in a separate directory, so that the actual source directory is not modified.

If the user does not specify ‘--srcdir’, then configure should check both ‘.’ and ‘..’ to see if it can find the sources. If it finds the sources in one of these places, it should use them from there. Otherwise, it should report that it cannot find the sources, and should exit with nonzero status.

Usually the easy way to support ‘--srcdir’ is by editing a definition of VPATH into the Makefile. Some rules may need to refer explicitly to the specified source directory. To make this possible, configure can add to the Makefile a variable named srcdir whose value is precisely the specified directory.

In addition, the ‘configure’ script should take options corresponding to most of the standard directory variables (see Directory Variables). Here is the list:

--prefix --exec-prefix --bindir --sbindir --libexecdir --sysconfdir
--sharedstatedir --localstatedir --libdir --includedir --oldincludedir
--datarootdir --datadir --infodir --localedir --mandir --docdir
--htmldir --dvidir --pdfdir --psdir

The configure script should also take an argument which specifies the type of system to build the program for. This argument should look like this:

cpu-company-system

For example, an Athlon-based GNU/Linux system might be ‘i686-pc-linux-gnu’.

The configure script needs to be able to decode all plausible alternatives for how to describe a machine. Thus, ‘athlon-pc-gnu/linux’ would be a valid alias. There is a shell script called ‘config.sub’ that you can use as a subroutine to validate system types and canonicalize aliases.

The configure script should also take the option ‘--build=buildtype’, which should be equivalent to a plain buildtype argument. For example, ‘configure --build=i686-pc-linux-gnu’ is equivalent to ‘configure i686-pc-linux-gnu’. When the build type is not specified by an option or argument, the configure script should normally guess it using the shell script ‘config.guess’.

Other options are permitted to specify in more detail the software or hardware present on the machine, to include or exclude optional parts of the package, or to adjust the name of some tools or arguments to them:

‘--enable-feature[=parameter]’

Configure the package to build and install an optional user-level facility called feature. This allows users to choose which optional features to include. Giving an optional parameter of ‘no’ should omit feature, if it is built by default.

No ‘--enable’ option should ever cause one feature to replace another. No ‘--enable’ option should ever substitute one useful behavior for another useful behavior. The only proper use for ‘--enable’ is for questions of whether to build part of the program or exclude it.
‘--with-package’

The package package will be installed, so configure this package to work with package.

Possible values of package include ‘gnu-as’ (or ‘gas’), ‘gnu-ld’, ‘gnu-libc’, ‘gdb’, ‘x’, and ‘x-toolkit’.

Do not use a ‘--with’ option to specify the file name to use to find certain files. That is outside the scope of what ‘--with’ options are for.
‘variable=value’

Set the value of the variable variable to value. This is used to override the default values of commands or arguments in the build process. For example, the user could issue ‘configure CFLAGS=-g CXXFLAGS=-g’ to build with debugging information and without the default optimization.

Specifying variables as arguments to configure, like this:

./configure CC=gcc

is preferable to setting them in environment variables:

CC=gcc ./configure

as it helps to recreate the same configuration later with ‘config.status’. However, both methods should be supported.

All configure scripts should accept all of the “detail” options and the variable settings, whether or not they make any difference to the particular package at hand. In particular, they should accept any option that starts with ‘--with-’ or ‘--enable-’. This is so users will be able to configure an entire GNU source tree at once with a single set of options.

You will note that the categories ‘--with-’ and ‘--enable-’ are narrow: they do not provide a place for any sort of option you might think of. That is deliberate. We want to limit the possible configuration options in GNU software. We do not want GNU programs to have idiosyncratic configuration options.

Packages that perform part of the compilation process may support cross-compilation. In such a case, the host and target machines for the program may be different.

The configure script should normally treat the specified type of system as both the host and the target, thus producing a program which works for the same type of machine that it runs on.

To compile a program to run on a host type that differs from the build type, use the configure option ‘--host=hosttype’, where hosttype uses the same syntax as buildtype. The host type normally defaults to the build type.

To configure a cross-compiler, cross-assembler, or what have you, you should specify a target different from the host, using the configure option ‘--target=targettype’. The syntax for targettype is the same as for the host type. So the command would look like this:

./configure --host=hosttype --target=targettype

The target type normally defaults to the host type. Programs for which cross-operation is not meaningful need not accept the ‘--target’ option, because configuring an entire operating system for cross-operation is not a meaningful operation.

Some programs have ways of configuring themselves automatically. If your program is set up to do this, your configure script can simply ignore most of its arguments.
And of course, let's not forget:
Code:
./configure --help
 
1 members found this post helpful.
Old 11-30-2010, 10:50 PM   #5
sree_ec
Member
 
Registered: Sep 2010
Location: world
Distribution: Ubuntu 12.04LTS
Posts: 76

Original Poster
Rep: Reputation: 5
thanks to all who replied.. I am closing this..

Cheers,
 
Old 12-31-2014, 02:36 PM   #6
debguy
Member
 
Registered: Oct 2014
Location: U.S.A.
Distribution: mixed, mostly debian slackare today
Posts: 207

Rep: Reputation: 19
Try this !

autoproj is a script that starts an autotools project from scratch from a simple source code directory, does everthing from running autotools, to making .so, to making distro.tar.gz in one command. you can read the script and see what's involved

see this article

http://www.linuxquestions.org/questi...ibtool-928529/

also note ^^^ comment about use IDE making autool projects automatically
 
  


Reply



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
Good music tutorial aquaboot Linux - Software 1 10-10-2010 03:55 PM
LXer: The good and the bad with Autotools, Autoconf, Automake and Libtool for open so LXer Syndicated Linux News 0 05-09-2008 09:12 PM
looking for very good tutorial cintaputih Programming 1 02-12-2005 06:19 AM
Anyone have good Posfix how-to or tutorial? unhappyStar Linux - Networking 2 08-15-2004 02:17 AM
Any good tutorial for sendmail? Swift&Smart Linux - Software 4 03-31-2003 12:44 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 11:33 AM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration