我试图编译一些OpenWRT包A和B,其中B依赖于A中的一些头文件。
这些软件包使用automake,当我编译A时,它将其头文件复制到import tkinter as TK
class MyApp(TK.Frame):
def __init__(self, master):
super().__init__(master) # initialize the 'TK.Frame'
# configure the root Frame (i.e. 'self')
self.master = master # just for reference later
self.master.grid_rowconfigure(0, weight = 1)
self.master.grid_columnconfigure(0, weight = 1)
self.grid(column = 0, row = 0, sticky = 'nsew')
self.grid_rowconfigure(0, weight = 1)
self.grid_columnconfigure(0, weight = 1) # columns will split space
self.grid_columnconfigure(1, weight = 1) # columns will split space
# configure internal left Frame
self.left_frame = TK.Frame(self, borderwidth = 2, relief = TK.SUNKEN)
self.left_frame.grid_rowconfigure(0, weight = 1) # rows will split space
self.left_frame.grid_rowconfigure(1, weight = 1) # rows will split space
self.left_frame.grid_columnconfigure(0, weight = 1)
self.left_frame.grid(column = 0, row = 0, sticky = 'nsew')
self.left_box0 = TK.Listbox(self.left_frame, borderwidth = 0)
self.left_box0.grid(column = 0, row = 0, sticky = 'nsew')
self.left_box1 = TK.Listbox(self.left_frame, borderwidth = 0)
self.left_box1.grid(column = 0, row = 1, sticky = 'nsew')
# configure internal right Frame
self.right_frame = TK.Frame(self, borderwidth = 2, relief = TK.SUNKEN)
self.right_frame.grid_rowconfigure(0, weight = 1) # rows will split space
self.right_frame.grid_rowconfigure(1, weight = 1) # rows will split space
self.right_frame.grid_columnconfigure(0, weight = 1)
self.right_frame.grid(column = 1, row = 0, sticky = 'nsew')
self.right_box0 = TK.Listbox(self.right_frame, borderwidth = 0)
self.right_box0.grid(column = 0, row = 0, sticky = 'nsew')
self.right_box1 = TK.Listbox(self.right_frame, borderwidth = 0)
self.right_box1.grid(column = 0, row = 1, sticky = 'nsew')
for i in range(20):
self.left_box0.insert(TK.END, 'test')
self.left_box1.insert(TK.END, 'test')
self.right_box0.insert(TK.END, 'test')
self.right_box1.insert(TK.END, 'test')
if __name__ == '__main__': # get in the habit of doing this
root = TK.Tk()
root.title('My App')
root.geometry('{}x{}'.format(768, 768))
root.resizable(width = False, height = False)
app = MyApp(root)
app.mainloop()
问题是现在我需要在包B中使用它们,当我添加命令build_dir/../package/include/...
时,OpenWRT会在someheaders_HEADERS
中查找它们。
我可以在OpenWRT编译过程的staging_dir/.../usr/include
阶段复制这些文件,但这似乎是一个糟糕的方法。
如何正确解决这个问题?
谢谢!
答案 0 :(得分:1)
我建议以下2件事,
如果您的包A提供了pkg config(.pc)文件,那么您可以在包B中添加以下代码makefile.am
yourapp_CFLAGS = $(pkg-config --cflags <Package-A's .PC file name>)
或者只需在makefile.am中为包B添加以下代码
yourapp_CFLAGS = -I($CURDIR)/../PackageA/include/