执行bootstrap时大量warning: but option ‘subdir-objects’ is disabled
据说是autoconf版本问题,把下面的代码保存到rtems源码根目录并执行即可
感谢作者bh_binghu,转自https://blog.csdn.net/bh_binghu/article/details/80132632
# !/usr/bin/env python
# -*- coding: utf-8 -*-
""" This Script add "subdir-objects" option for configure.ac file """
import os
import os.path
def add_subdir_objectsfilename):
""" find AM_INIT_AUTOMAKE line and add option
arg: configure.ac full path
"""
fd = openfilename, 'r')
lines = fd.readlines)
fd.close)
find = False
dst_index = 0
dst_line = ''
for index, line in enumeratelines):
if line.find"AM_INIT_AUTOMAKE") >= 0:
find = True
dst_index = index
dst_line = line
break
if find:
add_option = "subdir-objects"
options_start = dst_line.find'[')
options_end = dst_line.find']')
if options_end > options_start > 0:
options = dst_line[options_start+1:options_end].split' ')
add_count = options.countadd_option)
if add_count == 0:
options.appendadd_option)
elif add_count == 1:
return False
elif add_count > 1:
while add_count > 1:
options.removeadd_option)
add_count -= 1
new_line = "AM_INIT_AUTOMAKE[%s])
" % ' '.joinoptions)
print new_line
lines[dst_index] = new_line
fd = openfilename, 'w')
fd.writelineslines)
fd.close)
return True
def main):
""" main function, no arg
"""
dst_dir = './'
for root, dirs, files in os.walkdst_dir):
if "configure.ac" in files:
fullname = os.path.joinroot, "configure.ac")
if add_subdir_objectsfullname):
print fullname
pass
if __name__ == '__main__':
main)
autoconf automake aclocal的版本问题
刚开始因为一些问题,我的makefile显示是由automake 1.15版本生成的,而不是rtems官方的1.12版本
导致最终编译的时候提示start.o有问题编译失败。
说明rtems编译依赖auto系列的版本