Autoconf 和多个不同版本的二进制文件
我在自己的源代码树中有两个类似的应用程序,我正在使用自动工具来构建它们。在每个应用程序的configure.ac中,我有:AC_INIT(appname, appversion)
由于代码库相似并且共享一些代码,我想将它们合并到 1 个源代码树,但我需要每个应用程序的应用程序名称和应用程序版本不同,这可以使用自动工具来实现吗?
我在应用程序中使用PACKAGE_NAME, PACKAGE_VERSION
。
我当前的源结构如下所示:
./configure.ac
./src/Makefile.am
./src/*.cpp
./src/include/*.h
谢谢。
I have two similar applications in their own source trees and I am using autotools to build them. In each application's configure.ac I have:AC_INIT(appname, appversion)
Since the code base is similar and is sharing some code, I'd like to merge them to 1 source tree but I need to have the appname and appversion distinct for each application, can this be achieved using autotools?
I am using PACKAGE_NAME, PACKAGE_VERSION
in the application.
My current source structure looks like this:
./configure.ac
./src/Makefile.am
./src/*.cpp
./src/include/*.h
Thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
在configure.ac中,您可以这样做:
这些版本独立于PACKAGE_VERSION,但在您的.c文件中
你可以简单地将它们连接起来:
In configure.ac, you could do:
These versions are independent of PACKAGE_VERSION, but in your .c files
you can simply concatenate them: