如何创建一个配置脚本? [英] how do i create a configure script?

查看:123
本文介绍了如何创建一个配置脚本?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这听起来像是一个非常通用的问题,但在这里不用。

This may sound like a very generic question but here goes.

我有一个要求,创建我的应用程序配置脚本,这种配置的结果将是一个生成的makefile文件(基本配置,制作,安装制作)。我的问题是我在哪里可以在建设开始?有一个例子,我可以遵循?

I have a requirement to create a configure script for my application, the result of this configure would be a generated makefile (basic configure,make ,make install). My question is where do i start in building this? Is there an example i can follow?

推荐答案

要创建标准配置脚本,你需要GNU autoconf的。
您可能需要GNU的automake和libtool了。

To create the standard "configure" script you need GNU autoconf. You may need GNU automake and libtool too.

有万吨文档和HOWTO的。
谷歌这样的事情的autoconf automake的HOWTO。
良好的文档是在官方手册页:

There are tons of documentation and howtos. Google for something like "autoconf automake howto". The good documentation is in the official manual pages:


  • 的Autoconf http://www.gnu.org/software/autoconf/

  • 的Automake :<一href=\"http://www.gnu.org/software/automake/automake.html\">http://www.gnu.org/software/automake/automake.html

  • Libtool程序:<一href=\"http://www.gnu.org/software/libtool/libtool.html\">http://www.gnu.org/software/libtool/libtool.html

  • Autoconf: http://www.gnu.org/software/autoconf/
  • Automake: http://www.gnu.org/software/automake/automake.html
  • Libtool: http://www.gnu.org/software/libtool/libtool.html

的Autoconf将创建配置脚本从configure.ac文件开始。
在Makefile.am文件将指导如何通过配置字符串创建你的Makefile的automake。需要libtool来简化处理库在你的code。

Autoconf will create your configure script starting from the "configure.ac" file. The "Makefile.am" file will instruct automake on how to create your makefile by the configure string. Libtool is needed to simplify libraries handling around your code.

您可以开始创建手工一个configure.ac文件或您可以使用自动扫描助手,可以帮助你创造的东西半自动适合你。

You can start creating a configure.ac file by hand or you may use the "autoscan" helper that may help you to create something semi-automatic for you.

然后,当你准备好了,这个人会做的魔力:

Then, when you are ready, this one will do the magic:

autoreconf -i

这篇关于如何创建一个配置脚本?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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