收藏 分销(赏)

交叉编译cups.docx

上传人:pc****0 文档编号:7195166 上传时间:2024-12-27 格式:DOCX 页数:5 大小:20.41KB 下载积分:10 金币
下载 相关 举报
交叉编译cups.docx_第1页
第1页 / 共5页
交叉编译cups.docx_第2页
第2页 / 共5页


点击查看更多>>
资源描述
交叉编译cups(ARM-LINUX)   2010-10-11 17:00:59|  分类: Linux操作系统|举报|字号 订阅 最近研究下如何交叉编译 CUPS,期间碰到很多编译上的问题,google一下,也没有见到详细的关于交叉编译cups的文档。自己根据网上的一些帖子,一点一点的研究编译中出 现的问题,今天终于完成了。这里就说下交叉编译CUPS的过程和当中遇到的问题。 一:交叉编译环境     我使用的是gcc-4.1.1,制作交叉编译环境用到了如下的文件:     binutils-2.16.1   Download URL: ftp://ftp.gnu.org     gdb-6.5           Download URL: ftp://ftp.gnu.org     gcc-3.3.6         Download URL: ftp://ftp.gnu.org     glibc-2.3.2       Download URL: ftp://ftp.gnu.org     linux-2.6.24      Download URL: http://www.kernel.org     linux-libc-headers-2.6.12.0   Download URL:http://ep09.pld-linux.org/~mmazur/linux-libc-headers/     使用crosstool-0.43工具进行编译,生成我的交叉编译环境。(从 crosstool-0.43) 二:CUPS版本     cups-1.3.9-source.tar.gz     Download URL: http://www.cups.org/software.php 三: 步骤     1、交叉编译工具放置位置        1.1 将交叉编译工具目录(4.1.1,一般而言,交叉编译目录以GCC版本号命名)放置到/usr/local/arm/下面(如果没有arm目录,则新建 之);        1.2 编辑/etc/profile文件,加入/usr/local/arm/4.1.1/bin的路径            pathmunge /usr/local/arm/4.1.1/bin            然后,执行source /etc/profile或者重新启动电脑,使得相关路径添加到PATH中。     2、解压cups到一个目录中(您可以自己指定);     3、cd cups-1.3.9/,进入cups目录;     4、configure,指令如下:        ./configure CC=arm-linux-gnueabihf-gcc CXX=arm-linux-gnueabihf-g++ LD=arm-linux-gnueabihf-ld RANLIB=arm-linux-gnueabihf-ranlib AR=arm-linux-gnueabihf-ar --target=arm-linux --host=arm-linux --build=i686-linux --disable-gnutls --disable-gssapi --disable-dbus --prefix=/        执行完成之后,会生成一个Makedefs文件,这个名称给Makefile使用。头文件和库文件的修改,都在这个文件中进行。Makefile文件在 configure过程中,不会自动生成,它是不变的。        在configure的过程中遇到很多问题。现在说下我解决的方法:        问题1:库连接错误(找不到xxx库)        /usr/local/arm/4.1.1/bin/../lib/gcc/arm-linux/4.1.1/../../../../arm-linux/bin/ld: cannot find -lgnutls        我本想交叉编译gnutls,生成相关的库,但是交叉编译gnutls失败,网上暂时也找不到gnutls交叉编译库的内容,所以这个暂时放在一边。        修改方法:        添加编译选项:--disable-gnutls(含义:使得gnutls选项无效)        在文件Makedefs文件中,SSLLIBS         =       -lgnutls表示需要SSL库支持。        问题2:        In file included from cupsd.h:121,                         from auth.c:57:        cert.h:28: error: expected specifier-qualifier-list before 'krb5_ccache'        In file included from cupsd.h:127,                         from auth.c:57:        job.h:60: error: expected specifier-qualifier-list before 'krb5_ccache'        In file included from auth.c:57:        cupsd.h:164: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'KerberosContext'        auth.c: In function 'cupsdAuthorize':        auth.c:561: error: 'cupsd_cert_t' has no member named 'ccache'        make[1]: *** [auth.o] 错误 1        make: *** [all] 错误 1        这个应该是头文件的问题。这个问题与gssapi有关,暂时没有解决。可以查看Makedefs文件中的        LIBGSSAPI       =       -lgssapi_krb5 -lkrb5 -lk5crypto -lcom_err -lresolv -ldl        改行说明需要gssapi库的支持。        解决方法:--disable-gssapi        问题3:        /usr/local/arm/4.1.1/bin/../lib/gcc/arm-linux/4.1.1/../../../../arm-linux/bin/ld: skipping incompatible /lib/libdbus-1.so when searching for -ldbus-1        /usr/local/arm/4.1.1/bin/../lib/gcc/arm-linux/4.1.1/../../../../arm-linux/bin/ld: cannot find -ldbus-1        与问题一类似。        在Makedefs文件中,CUPSDLIBS       =         -L/lib -ldbus-1表示cups库支持。        解决方法:--disable-dbus        这里对问题的解决,主要是对相关库的连接属性进行修改,后期将对这个库的编译作一个研究,并加入进来,使得CUPS的编译更加完整。实际上,在将cups 移植到开发板的时候,部分功能可以不要,当然相关库也可以不用,使用--disable选项可以取消某些库的使用。     5、make        5.1 修改Makefile文件,将        DIRS    =       cups backend berkeley cgi-bin filter locale man monitor \                        notifier $(PDFTOPS) scheduler systemv test \                        $(PHPDIR) \                        conf data doc $(FONTS) ppd templates        修改为:        DIRS    =       cups backend berkeley cgi-bin filter locale monitor \                        notifier $(PDFTOPS) scheduler systemv test \                        $(PHPDIR) \                        conf data doc $(FONTS) ppd templates 即,去掉man        取消对man文件编译。否则会出现如下的错误:        Compiling mantohtml.c...        Converting man pages to HTML...            cancel.1.gz...        /bin/sh: line 2: ./mantohtml: cannot execute binary file            cups-config.1.gz...        /bin/sh: line 2: ./mantohtml: cannot execute binary file            cupstestdsc.1.gz...        /bin/sh: line 2: ./mantohtml: cannot execute binary file            cupstestppd.1.gz...        /bin/sh: line 2: ./mantohtml: cannot execute binary file            lp.1.gz...        /bin/sh: line 2: ./mantohtml: cannot execute binary file            lpoptions.1.gz...        /bin/sh: line 2: ./mantohtml: cannot execute binary file            lppasswd.1.gz...        /bin/sh: line 2: ./mantohtml: cannot execute binary file            lpq.1.gz...        /bin/sh: line 2: ./mantohtml: cannot execute binary file            lprm.1.gz...        /bin/sh: line 2: ./mantohtml: cannot execute binary file            lpr.1.gz...        /bin/sh: line 2: ./mantohtml: cannot execute binary file            lpstat.1.gz...        /bin/sh: line 2: ./mantohtml: cannot execute binary file        make[1]: *** [html] 错误 126        make: *** [all] 错误 1        做完修改后,make可以正常进行。
展开阅读全文

开通  VIP会员、SVIP会员  优惠大
下载10份以上建议开通VIP会员
下载20份以上建议开通SVIP会员


开通VIP      成为共赢上传

当前位置:首页 > 百科休闲 > 其他

移动网页_全站_页脚广告1

关于我们      便捷服务       自信AI       AI导航        抽奖活动

©2010-2026 宁波自信网络信息技术有限公司  版权所有

客服电话:0574-28810668  投诉电话:18658249818

gongan.png浙公网安备33021202000488号   

icp.png浙ICP备2021020529号-1  |  浙B2-20240490  

关注我们 :微信公众号    抖音    微博    LOFTER 

客服