交叉编译cups.docx_第1页
交叉编译cups.docx_第2页
交叉编译cups.docx_第3页
交叉编译cups.docx_第4页
免费预览已结束,剩余1页可下载查看

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

交叉编译cups(ARMLINUX)2010-10-11 17:00:59|分类:Linux操作系统|举报|字号订阅最近研究下如何交叉编译 CUPS,期间碰到很多编译上的问题,google一下,也没有见到详细的关于交叉编译cups的文档。自己根据网上的一些帖子,一点一点的研究编译中出 现的问题,今天终于完成了。这里就说下交叉编译CUPS的过程和当中遇到的问题。一:交叉编译环境 我使用的是gcc-4.1.1,制作交叉编译环境用到了如下的文件:binutils-2.16.1Download URL: gdb-6.5Download URL:gcc-3.3.6Download URL:glibc-2.3.2Download URL:linux-2.6.24Download URL:linux-libc-headers-Download URL:/mmazur/linux-libc-headers/ 使用crosstool-0.43工具进行编译,生成我的交叉编译环境。(从/crosstool下载 crosstool-0.43)二:CUPS版本 cups-1.3.9-source.tar.gzDownload URL:/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 make1: * 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 bina

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论