什么是 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?

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

问题描述

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

解决方案

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

<前>$ mkdir 示例$ cd 样品$ echo 'int main( void ) { return 0;}' > foo.c$ echo 'bin_PROGRAMS = foo' > Makefile.am$自动扫描$ mv configure.scan configure.ac$ # 编辑configure.ac,添加AM_INIT_AUTOMAKE([foreign])$#和LT_INIT,设置项目名称和bug-report-address$ autoreconf -ivf

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

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?

解决方案

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.

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

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