由于自己的开发板的根文件系统放在/work/nfs_root/cmt_root/下,所以在之前已经把ImageMagick交叉编译到/work/nfs_root/cmt_root/usr/local下,接下来开始编译libdmtx,在使用
./configure --host=arm-linux的时候
一直遇到de>configure: error: dmtxread/dmtxwrite requires Wand >= 6.2.4这个问题,始终得不到解决,后来看了它的configure文件的内容,de>
if test -n "$MAGICK_LIBS"; then pkg_cv_MAGICK_LIBS="$MAGICK_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && / { ($as_echo "$as_me:$LINENO: /$PKG_CONFIG --exists --print-errors /"Wand >= 6.2.4/"") >&5 ($PKG_CONFIG --exists --print-errors "Wand >= 6.2.4") 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: /$? = $ac_status" >&5 (exit $ac_status); }; then pkg_cv_MAGICK_LIBS=`$PKG_CONFIG --libs "Wand >= 6.2.4" 2>/dev/null` else pkg_failed=yes fi else pkg_failed=untried fi |
虽然不是看得很懂,但是隐约感觉到和PKG_CONFIG有关,于是自己添加了个变量:
./configure --host=arm-linux PKG_CONFIG=/work/nfs_root/cmt_root/usr/local/lib/pkgconfig,结果提示PKG_CONFIG是一个目录,无法执行,于是有参考了网上的这篇文章,把PKG_CONFIG改为PKG_CONFIG_PATH,问题得到解决,可以交叉编译
Some Ubuntu users have reported an issue where the ImageMagick Wand API is missing from the normal pre-built packages. If libdmtx's "./configure" throws the following error, you might be one of the unlucky people who need to install ImageMagick from source.
de>checking for MAGICK... no
configure: error: dmtxread/dmtxwrite requires Wand >= 6.2.4de>
But don't give up hope yet. First make sure the ImageMagick runtime and development packages are installed (ImageMagick, libmagick, ImageMagick-devel, libmagick-dev, or something like that depending on your OS). If that doesn't fix the problem, try finding a file named "Wand.pc" somewhere on your computer, point the PKG_CONFIG_PATH environment variable to that directory, and re-run "./configure".
de>$ export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig/ # Replace with directory that holds Wand.pc
$ ./configurede>
If "./configure" still won't run, you probably need to compile ImageMagick from source.