什么是ltmain.sh,为什么automake会说它丢失了?什么是好的自动(make/conf/etc)生成器? [英] What is ltmain.sh, and why does automake say it is missing? What is a good auto (make/conf/etc) generator?

查看:143
本文介绍了什么是ltmain.sh,为什么automake会说它丢失了?什么是好的自动(make/conf/etc)生成器?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我只想用自动生成的auto(make/conf/...)东西在Linux中开发一个C应用程序.我尝试用ede和anjuta生成它,但似乎没有生成Makefile.am.因此,我尝试运行automake,并说未找到"ltmain.sh".是否有一些易于生成的Linux C/C ++应用程序基本构建文件.什么是标准做法?大多数人都自己写这些文件吗?

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?

推荐答案

生成一组非常简单的自动工具文件非常容易.这是一个(非常基本的)示例.运行这些文件后,您应该在目录中获得ltmain.sh的副本,并且已全部准备好运行configure脚本:

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

请注意,在此示例中,实际上不需要libtool,因为 该示例只是构建一个简单的应用程序.但是你问过 ltmain.sh,这是一个libtool的东西,因此需要LT_INIT 解决问题的那一部分.如果你想建造 一个库,将bin_PROGRAMS更改为lib_LTLIBRARIES.

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.

这篇关于什么是ltmain.sh,为什么automake会说它丢失了?什么是好的自动(make/conf/etc)生成器?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆