我正在尝试将这个项目交叉编译到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手册中描述的指示进行了操作。
all: ... lib/errno.h ...
(或者是在变量替换后扩展得到的那样),这可能是造成问题的直接原因。 - Ross RidgeMakefile
都是由 autotools 自动产生的,因此即使我能找到错误并修复它,也不会起作用。Makefile
将被重新生成并覆盖修复操作。 - Abdelhakim AKODADI