views:

248

answers:

3

I just want to develop a C app in linux with the auto(make/conf/...) stuff automatically generated. I tried generating it with ede and anjuta, but it doesn't seem to generate Makefile.am. So, I tried running automake, and it says "ltmain.sh" isn't found. Is there some easy to generate the basic build files for linux C/C++ apps. What is the standard practice? Do most people write these files themselves?

A: 

I'd consider not using autoconf and automake at all -- their complexity outweighs their benefit, particularly if you're targeting only Linux.

Note that "git", for example, doesn't use them at all; instead it simply has a moderately-complex (but comprehensible) Makefile.

offby1
This does not answer the question and is thus a completely irrelevant opinion on a different topic.
mathepic
git certainly does use autoconf. And the Makefile in git is far less comprehensible than the equivalent Makefile.am would be.
William Pursell
A: 

EDE can work with your Automake files in two different ways. If you write your own automake files, it will read them, and tweak them via the UI.

If you prefer, you can have EDE do the whole thing for you. First, create your first C file, then when it is on disk, do:

M-x ede-new RET Automake RET

then from the project/project options menu, add a target, like "program".

If you fill in your C file, you can then choose Project->Build->build currentproject from the menu, and it will create and setup everything needed for Automake to do it's thing, in addition to running all the misc automake commands needed.

Lastly, there is a 'run' option somewhere to run your program.

Eric
+1  A: 

Generating a really trivial set of autotool files is pretty easy. Here's a (really basic) example. After you run these, you should get a copy of ltmain.sh in the directory, and you'll be all set to run the configure script:


$ mkdir sample
$ cd sample
$ echo 'int main( void ) { return 0; }' > foo.c
$ echo 'bin_PROGRAMS = foo' > Makefile.am
$ autoscan
$ mv configure.scan configure.ac
$ # edit configure.ac, add AM_INIT_AUTOMAKE([foreign])
$ # and LT_INIT, set project name and bug-report-address
$ autoreconf -ivf

Note that in this example, libtool really isn't necessary since the example is just building a simple app. But you asked about ltmain.sh, and that's a libtool thing so LT_INIT is needed to address that portion of the question. If you want to build a library, change bin_PROGRAMS to lib_LTLIBRARIES.

William Pursell