我正在尝试交叉编译这个项目到MinGW。
该项目使用自动工具作为构建系统,并依赖于利伯尔、CUnit、詹森和一些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 2errno.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手册中描述的说明。
发布于 2016-12-06 18:08:27
我设法找到了解决这个问题的办法。显然,autotools并不像我想象的那么容易。
gnulib模块,这一次指定了--makefile-name参数。即。
$gnulib工具.-makefile-name=gnulib.mk.configure.ac文件中删除了configure.ac。因此,与其:
dnl将自动生成的文件结果放在这里AC_CONFIG_FILES(Makefile po/Makefile.in lib/Makefile)
现在我有:
dnl将自动生成的文件结果放在这里AC_CONFIG_FILES(Makefile po/Makefile.in)lib中从SUBDIRS中删除了Makefile.am。即。而不是:要下降到的子目录。SUBDIRS = po libI有:要下降到的子目录。SUBDIRS = polib目录中创建了一个名为local.mk的新文件,其内容如下:
包括lib/gnulib.mk #允许"make“在"make”运行之前成功。dist-钩子:$(noinst_LIBRARIES) .PHONY: dist-钩子Makefile.am中。
包括$(top_srcdir)/lib/local.mk就是这样。
https://stackoverflow.com/questions/40870949
复制相似问题