我想將此project交叉編譯到MinGW。將基於gnulib的項目交叉編譯到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所有的'Makefile's都是由autotools自動生成的,所以即使我能找到錯誤並修復它,也是行不通的。 'Makefile'將被重新生成並覆蓋修復。 –
所以修改源代碼來修復它。 –