What is ltmain.sh, and why does automake say it's missing? What is a good car (make / conf / etc)?

I just want to develop a C application on Linux with an auto file (make / conf / ...) automatically generated. I tried generating it using ede and anjuta, but it does not seem to generate Makefile.am. So, I tried to run automake, and it says that "ltmain.sh" was not found. Are there any easy-to-create basic build files for C / C ++ Linux applications. What is the standard practice? Most people write these files themselves?

+4
source share
3 answers

Creating a truly trivial set of autotool files is quite simple. Here is an example (really basic). After you run them, you should get a copy of ltmain.sh in the directory, and you will be configured 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 libtool is not really needed in this example, because the example is just creating a simple application. But you asked about ltmain.sh, and what is libtool, so LT_INIT is needed to address this part of the question. If you want to build libraries, change bin_PROGRAMS to lib_LTLIBRARIES.

+4
source

EDE can work with your Automake files in two different ways. If you write your automake files, they will read and configure them using the user interface.

If you prefer, you can do EDE all for you. First create your first C file, and then when it is on disk, do:

Mx ede-new RET Automake RET

then, in the project / project options menu, add a goal, such as "program."

If you fill out your C file, you can select Project-> Build-> build currentproject from the menu, and it will create and configure everything that Automake needs to do this, in addition to running all the misc automake required commands.

Finally, there is the “run” option to launch your program.

+1
source

I would not use autoconf and automake at all - their complexity outweighs their benefits, especially if you focus only on Linux.

Note that git, for example, does not use them at all; instead, it simply has a moderately complex (but understandable) Makefile.

-4
source

Source: https://habr.com/ru/post/1309382/


All Articles