【发布时间】:2016-11-29 16:32:09
【问题描述】:
我正在尝试将这个 project 交叉编译到 MinGW。
该项目使用 autotools 作为构建系统,并依赖于libcurl、CUnit、Jansson 和一些 gnulib 模块。
我已经为x86_64-w64-mingw32 编译并安装在/home/user/mingw64 下的所有依赖项
我跑:
$ gnulib-tool --update
$ autoreconf -fi
$ CURL_CFLAGS="-I/home/user/mingw64/usr/local/include" \
CURL_LIBS="-L/home/user/mingw64/usr/local/lib -lcurl" \
JANSSON_CFLAGS="-I/home/user/mingw64/usr/local/include" \
JANSSON_LIBS="-L/home/user/mingw64/usr/local/lib -ljansson" \
CUNIT_CFLAGS="-I/home/user/mingw64/usr/local/include" \
CUNIT_LIBS="-L/home/user/mingw64/usr/local/lib -lcunit" \
./configure --host=x86_64-w64-mingw32
$ make
我得到这个错误:
make all-recursive
make[1]: Entering directory '/home/user/projects/shill'
Making all in po
make[2]: Entering directory '/home/user/projects/shill/po'
make[2]: Nothing to be done for 'all'.
make[2]: Leaving directory '/home/user/projects/shill/po'
Making all in lib
make[2]: Entering directory '/home/user/projects/shill/lib'
make[2]: *** No rule to make target 'lib/errno.h', needed by 'all'. Stop.
make[2]: Leaving directory '/home/user/projects/shill/lib'
Makefile:1897: recipe for target 'all-recursive' failed
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory '/home/user/projects/shill'
Makefile:1429: recipe for target 'all' failed
make: *** [all] Error 2
errno.h 是 gnulib 模块的一部分。所以我认为问题出在Makefile.am中的这一部分:
# Find gnulib headers.
ACLOCAL_AMFLAGS = -I m4
AM_CPPFLAGS = \
-DLOCALEDIR='"$(localedir)"' \
-Ilib -I$(top_srcdir)/lib \
-Isrc -I$(top_srcdir)/src \
但我想不出解决方案。我完全按照gnulib manual 中描述的说明进行操作。
【问题讨论】:
-
在某些 Makefile 中有一行像
all: ... lib/errno.h ...(或在变量替换后扩展为该行)是您的问题的直接原因。 -
@RossRidge 所有
Makefiles 都是由自动工具自动生成的,所以即使我能找到错误并修复它,它也不起作用。Makefiles 将重新生成并覆盖修复。 -
所以通过修改源来修复它。
-
那是我做不到的,你能帮忙吗?会很好:D
-
gnulib 构建了吗? (你在某处有 libgnu.a 吗?在某处有 errno.h?是 -> 包含路径问题。否 -> 构建依赖问题。
标签: c cross-compiling autotools gnulib