C++ ときどき ごはん、わりとてぃーぶれいく☆

USAGI.NETWORKのなかのひとのブログ。主にC++。

Arch Linux と Canon MP640 (最終的にソース食べるので長いですよ注意・x・)

まだ紙が必要な事もあるし、手作りシールとかポストカートとか作って遊ぶには個人向けのプリンターが手軽な存在だ。私はここ数年は Canon MP640 というインクジェットタイプのプリンターを使っていた。

…いるのだが、実はx86_64のLinux環境へと、このプリンターのドライバー周りのセットアップを行うのは面倒臭いであろうと思い、つい最近まで常時稼働していたWindows Serverにプリンタドライバーをインストールして使っていた。(いろいろゴメンナサイ^w^;)

LH-MAIN /tmp% uname -a                                             
Linux LH-MAIN 3.2.8-1-ARCH #1 SMP PREEMPT Mon Feb 27 21:51:46 CET 2012 x86_64 AMD Phenom(tm) II X4 940 Processor AuthenticAMD GNU/Linux
LH-MAIN /tmp% yss canon printer 640
aur/cnijfilter-common-mp640 3.20-1 (1)
    Canon IJ Printer Driver (common package)
aur/cnijfilter-mp640 3.20-1 (2)
    Canon Printer Driver (For Multifunction MP640)

とりあえず、さすが Arch Linux (というかAUR)、 Canon MP640 のドライバも収録済み。しかし問題は、このドライバ(一応元はCanon公式)はx86向けに作られているという事。このドライバをx86_64のArch Linuxで使う為には lib32-libcups が必要。素直に base-devel とかセットアップしただけの環境では Multilib 系のGCC周りなどアレコレ要求を満たしていないので、先ずは pacman.conf の Multilib を有効にし、 gcc 関連のx86_64向けのパッケージを Multilib 向けのパッケージに入れ替える必要がある。

LH-MAIN /tmp% pacman -S gcc-multilib gcc-libs-multilib binutils-multilib libtool-multilib lib32-glibc

とかなんとか。これでMP640の32-Bitなcupsドライバーも使える様になる。

LH-MAIN /tmp% yaourt -S cnijfilter-common-mp640 cnijfilter-mp640
LH-MAIN /tmp% head /usr/share/cups/model/canonmp640.ppd 
*PPD-Adobe: "4.3"
*%  CUPS add-on PPD file for Canon Inkjet Printer Driver.
*%  Copyright CANON INC. 2001-2009
*%  All Rights Reserved.
*%
*%  This program is free software; you can redistribute it and/or modify
*%  it under the terms of the GNU General Public License as published by
*%  the Free Software Foundation; version 2 of the License.
*%
*%  This program is distributed in the hope that it will be useful,

ここで、Canon MP640のドライバーは独自仕様のポートを[lp]から使うので、Arch Linuxのlpモジュールを有効化しておく。常用する場合は /etc/rc.conf のMODULES=()に追加する。

LH-MAIN /tmp% modprobe ls

それからCUPS - ArchWikiもインストールしてcupsdを動かせばMP640を使える( ・`д・´)

LH-MAIN /tmp% pacman -S cups
LH-MAIN /tmp% sudo rc.d start cupsd

これでCUPSで設定したりジョブ管理したりできる。

LH-MAIN /tmp% w3m http://localhost:631

f:id:USAGI-WRP:20120305141333p:plain

管理→新しいプリンターの検索→…

f:id:USAGI-WRP:20120305150152p:plain

Oops! テキストブラウザにCUPSのWEB-GUIは対応していない様だ。Oh, no user-experience!!

f:id:USAGI-WRP:20120305150714p:plain

と、言う訳で素直に Firefox 10.0.2 で追加しましょう。PPDは先程表示した場所にあるので、直接提示すると良いでしょう。

※ちなみにアクセス権の設定などは/etc/cups/cups.confで可能。デフォルトだと/adminは@systemにアクセス許可されているのでシステムに登録されたユーザーのアカウントで認証通過できる状態になっている。

さて、セットアップが終わると何やらMP640とも通信し…テストページが…えー…。MP640が準備しています…だけで終わる(´・ω・`)

…どうもこのAURにあるcnijfilter-mp640というドライバー…動かないって報告が何件かあるようで、実際コメントにmp620のパッケージ作って動いたよとか、このドライバーダメぽくね、とか書いてあった(´・ω・`) 動いてる人もたぶんいるんだろうけど。

うちが試した限りでは、WiFi接続もUSB接続もダメ、cupsのデバッグモードのログも見たし、lp直接も叩いたし、cnijnetprnコマンドやlpadminコマンドも叩いたし、Gutenprint Printer Driversの組み合わせも試したけどダメダメですた。

と、言う訳なので延長戦へ。
(やっぱりか・・・orz)

LH-MAIN /tmp% yaourt -Ss mp620
aur/cnijfilter-mp620 2.80-1 (Out of Date) (2)
    Canon drivers for the MP620 printer/scanner with improved PPD files
aur/ppd-mp620-630 1.5-1 (3)
    Canon drivers for the MP620 and MP630 printer/scanner
LH-MAIN /tmp% yaourt -S cnijfilter-mp620

…"cnij_backend_common.c"のコンパイル中にエラーが発生して止まりますね…。AURでもコメントが付けられている通りでどうも解析するのもダルイしそもそもMP620用で本当に動くのかも謎なのでひとまず撤収…。

さて、直接プリンターを使う事を諦める前に、最後に公式ドライバーのページなどよく見てみると、rpmとdebのバイナリパッケージの他、下の方にこっそりソースコードがあるではありませんか…。とりあえず拾う。

LH-MAIN /tmp/mp640% aria2c "http://pdisp01.c-wss.com/gdl/WWUFORedirectTarget.do?id=MDEwMDAwMjM2NzAx&cmp=ACM&lang=JA"

2012-03-05 22:09:54.617506 NOTICE - Allocating disk space. Use --file-allocation=none to disable it. See --file-allocation option in man page for more details.
[#1 SIZE:2.8MiB/6.1MiB(45%) CN:1 SPD:3.5MiBs]                                                    
2012-03-05 22:09:56.317992 NOTICE - ダウンロード完了: /tmp/mp640/cnijfilter-source-3.20-1.tar.gz

ダウンロード結果:
gid|stat|avg speed  |path/URI
===+====+===========+===========================================================
  1|  OK|   3.6MiB/s|/tmp/mp640/cnijfilter-source-3.20-1.tar.gz

凡例:
(OK):download completed.

とりあえず展開してみましょう。

LH-MAIN /tmp/mp640% tar xf cnijfilter-source-3.20-1.tar.gz
LH-MAIN /tmp/mp640% cd cnijfilter-source-3.20-1/
LH-MAIN /tmp/mp640/cnijfilter-source-3.20-1% ls    
合計 144K
drwxr-xr-x 22 usagi users 560  9月 28  2009 .
drwxr-xr-x  3 usagi users 100  3月  5 22:11 ..
drwxr-xr-x  4 usagi users  80  9月 28  2009 356
drwxr-xr-x  4 usagi users  80  9月 28  2009 357
drwxr-xr-x  4 usagi users  80  9月 28  2009 358
drwxr-xr-x  4 usagi users  80  9月 28  2009 359
drwxr-xr-x  4 usagi users  80  9月 28  2009 360
drwxr-xr-x  4 usagi users  80  9月 28  2009 361
drwxr-xr-x  4 usagi users  80  9月 28  2009 362
-rw-r--r--  1 usagi users 27K  7月 14  2009 LICENSE-cnijfilter-3.20EN.txt
-rw-r--r--  1 usagi users 29K  7月 14  2009 LICENSE-cnijfilter-3.20FR.txt
-rw-r--r--  1 usagi users 30K  7月 14  2009 LICENSE-cnijfilter-3.20JP.txt
-rw-r--r--  1 usagi users 26K  7月 14  2009 LICENSE-cnijfilter-3.20SC.txt
-rw-r--r--  1 usagi users 289  4月  6  2009 Makefile
drwxr-xr-x  3 usagi users 300  9月 28  2009 backend
drwxr-xr-x  4 usagi users 320  9月 28  2009 backendnet
drwxr-xr-x  4 usagi users 300  9月 28  2009 cngpij
drwxr-xr-x  6 usagi users 380  9月 28  2009 cngpijmon
drwxr-xr-x  4 usagi users 300  9月 28  2009 cnijfilter
-rwxr-xr-x  1 usagi users 17K  9月 28  2009 cnijfilter-common.spec
drwxr-xr-x  4 usagi users  80  9月 28  2009 com
drwxr-xr-x  2 usagi users 640  9月 28  2009 debian
drwxr-xr-x  4 usagi users 300  9月 28  2009 lgmon
drwxr-xr-x  4 usagi users 240  9月 28  2009 libs
drwxr-xr-x  2 usagi users 340  9月 28  2009 ppd
drwxr-xr-x  7 usagi users 440  9月 28  2009 printui
drwxr-xr-x  3 usagi users 280  9月 28  2009 pstocanonij
drwxr-xr-x  2 usagi users  60  9月 28  2009 scripts

なぜか実行可能なファイルが1つ含まれていますが、定義などつらつら書いたテキストの模様。

LH-MAIN /tmp/mp640/cnijfilter-source-3.20-1% head cnijfilter-common.spec 
%define VERSION 3.20
%define RELEASE 1

%define _prefix /usr/local
%define _bindir %{_prefix}/bin
%define _libdir /usr/lib
%define _ppddir /usr

%define PR1     mp250
%define PR2     mp270

Makefileがあるので眺めてみましょう・x・

LH-MAIN /tmp/mp640/cnijfilter-source-3.20-1% cat Makefile                
#dirs = libs cngpij cngpijmon ppd pstocanonij 
dirs = libs cngpij pstocanonij backend backendnet cngpijmon/cnijnpr

scripts=for dir in $(dirs); do\
                        (cd $$dir; make $$target)|| exit 1;\
                done

all :
        $(scripts)

clean :
        target=clean; $(scripts)

install :
        target=install; $(scripts)

順に、 libs cngpij pstocanonij backend backendnet cngpijmon/cnijnpr で make する様になっていますね。何事も無ければここで make && make install すれば良さそうです。

・・・ぇぃ・x・!

LH-MAIN /tmp/mp640/cnijfilter-source-3.20-1% make
for dir in libs cngpij pstocanonij backend backendnet cngpijmon/cnijnpr; do (cd $dir; make $target)|| exit 1; done
make[1]: ディレクトリ `/tmp/mp640/cnijfilter-source-3.20-1/libs' に入ります
make[1]: *** ターゲットが指定されておらず, makefile も見つかりません.  中止.
make[1]: ディレクトリ `/tmp/mp640/cnijfilter-source-3.20-1/libs' から出ます
make: *** [all] エラー 1

わらた。。。。。。

LH-MAIN /tmp/mp640/cnijfilter-source-3.20-1% cd libs
LH-MAIN /tmp/mp640/cnijfilter-source-3.20-1/libs% ls
合計 20K
drwxr-xr-x  5 usagi users  260  3月  5 22:23 .
drwxr-xr-x 22 usagi users  560  9月 28  2009 ..
-rw-r--r--  1 usagi users    0  4月  6  2009 AUTHORS
-rw-r--r--  1 usagi users    0  4月  6  2009 ChangeLog
-rw-r--r--  1 usagi users   59  4月  6  2009 INSTALL
-rw-r--r--  1 usagi users   26  4月  6  2009 Makefile.am
-rw-r--r--  1 usagi users    0  4月  6  2009 NEWS
-rw-r--r--  1 usagi users    0  4月  6  2009 README
-rwxr-xr-x  1 usagi users 4.5K  4月  6  2009 autogen.sh
drwxr-xr-x  2 usagi users  160  9月 28  2009 buftool
-rw-r--r--  1 usagi users  605  4月  6  2009 configure.in
drwxr-xr-x  2 usagi users  120  9月 28  2009 paramlist

configure.inとMakefile.amがあってautogen.shてのが実行可能フラグ。

LH-MAIN /tmp/mp640/cnijfilter-source-3.20-1/libs% head autogen.sh            
#!/bin/sh
# Run this to generate all the initial makefiles, etc.

# cp configures/configure.in.new ./configure.in

srcdir=`dirname $0`
PKG_NAME="buftool"

DIE=0

・・・ぇぃ・x・!

LH-MAIN /tmp/mp640/cnijfilter-source-3.20-1/libs% ./autogen.sh      
**Warning**: I am going to run `configure' with no arguments.
If you wish to pass any to it, please specify them on the
`./autogen.sh' command line.

processing .
Running libtoolize...
libtoolize: putting auxiliary files in `.'.
libtoolize: copying file `./ltmain.sh'
libtoolize: You should add the contents of the following files to `aclocal.m4':
libtoolize:   `/usr/share/aclocal/libtool.m4'
libtoolize:   `/usr/share/aclocal/ltoptions.m4'
libtoolize:   `/usr/share/aclocal/ltversion.m4'
libtoolize:   `/usr/share/aclocal/ltsugar.m4'
libtoolize:   `/usr/share/aclocal/lt~obsolete.m4'
libtoolize: Consider adding `AC_CONFIG_MACRO_DIR([m4])' to configure.in and
libtoolize: rerunning libtoolize, to keep the correct libtool macros in-tree.
libtoolize: Consider adding `-I m4' to ACLOCAL_AMFLAGS in Makefile.am.
Running aclocal  ...
Running autoheader...
Running automake --gnu  ...
configure.in:11: installing `./config.guess'
configure.in:11: installing `./config.sub'
configure.in:2: installing `./install-sh'
configure.in:2: installing `./missing'
buftool/Makefile.am: installing `./depcomp'
Makefile.am: installing `./COPYING' using GNU General Public License v3 file
Makefile.am:     Consider adding the COPYING file to the version control system
Makefile.am:     for your code, to avoid questions about which license your project uses.
Running autoconf ...
Running ./configure ...
checking for a BSD-compatible install... /bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking for g++... g++
checking whether the C++ compiler works... yes
checking for C++ compiler default output file name... a.out
checking for suffix of executables... 
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C++ compiler... yes
checking whether g++ accepts -g... yes
checking for style of include used by make... GNU
checking dependency style of g++... gcc3
checking for gcc... gcc
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking dependency style of gcc... gcc3
checking whether make sets $(MAKE)... (cached) yes
checking build system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
checking how to print strings... printf
checking for a sed that does not truncate output... sed
checking for grep that handles long lines and -e... /usr/bin/grep
checking for egrep... /usr/bin/grep -E
checking for fgrep... /usr/bin/grep -F
checking for ld used by gcc... /usr/bin/ld
checking if the linker (/usr/bin/ld) is GNU ld... yes
checking for BSD- or MS-compatible name lister (nm)... /usr/bin/nm -B
checking the name lister (/usr/bin/nm -B) interface... BSD nm
checking whether ln -s works... yes
checking the maximum length of command line arguments... 1572864
checking whether the shell understands some XSI constructs... yes
checking whether the shell understands "+="... yes
checking how to convert x86_64-unknown-linux-gnu file names to x86_64-unknown-linux-gnu format... func_convert_file_noop
checking how to convert x86_64-unknown-linux-gnu file names to toolchain format... func_convert_file_noop
checking for /usr/bin/ld option to reload object files... -r
checking for objdump... objdump
checking how to recognize dependent libraries... pass_all
checking for dlltool... no
checking how to associate runtime and link libraries... printf %s\n
checking for ar... ar
checking for archiver @FILE support... @
checking for strip... strip
checking for ranlib... ranlib
checking command to parse /usr/bin/nm -B output from gcc object... ok
checking for sysroot... no
checking for mt... no
checking if : is a manifest tool... no
checking how to run the C preprocessor... gcc -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking for dlfcn.h... yes
checking for objdir... .libs
checking if gcc supports -fno-rtti -fno-exceptions... no
checking for gcc option to produce PIC... -fPIC -DPIC
checking if gcc PIC flag -fPIC -DPIC works... yes
checking if gcc static flag -static works... yes
checking if gcc supports -c -o file.o... yes
checking if gcc supports -c -o file.o... (cached) yes
checking whether the gcc linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes
checking whether -lc should be explicitly linked in... no
checking dynamic linker characteristics... GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... yes
checking how to run the C++ preprocessor... g++ -E
checking for ld used by g++... /usr/bin/ld -m elf_x86_64
checking if the linker (/usr/bin/ld -m elf_x86_64) is GNU ld... yes
checking whether the g++ linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes
checking for g++ option to produce PIC... -fPIC -DPIC
checking if g++ PIC flag -fPIC -DPIC works... yes
checking if g++ static flag -static works... yes
checking if g++ supports -c -o file.o... yes
checking if g++ supports -c -o file.o... (cached) yes
checking whether the g++ linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes
checking dynamic linker characteristics... (cached) GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
checking for ANSI C header files... (cached) yes
checking for sys/wait.h that is POSIX.1 compatible... yes
checking malloc.h usability... yes
checking malloc.h presence... yes
checking for malloc.h... yes
checking for stdlib.h... (cached) yes
checking for string.h... (cached) yes
checking for unistd.h... (cached) yes
checking for an ANSI C-conforming const... yes
checking for pid_t... yes
checking vfork.h usability... no
checking vfork.h presence... no
checking for vfork.h... no
checking for fork... yes
checking for vfork... yes
checking for working fork... yes
checking for working vfork... (cached) yes
checking for stdlib.h... (cached) yes
checking for GNU libc compatible malloc... yes
checking for dup2... yes
checking for memset... yes
configure: creating ./config.status
config.status: creating Makefile
config.status: creating buftool/Makefile
config.status: creating paramlist/Makefile
config.status: creating config.h
config.status: executing depfiles commands
config.status: executing libtool commands
Now type `make' to compile buftool

と、いうわけで、

LH-MAIN /tmp/mp640/cnijfilter-source-3.20-1/libs% ls    
合計 1.7M
drwxr-xr-x  5 usagi users  600  3月  5 22:27 .
drwxr-xr-x 22 usagi users  560  9月 28  2009 ..
-rw-r--r--  1 usagi users    0  4月  6  2009 AUTHORS
lrwxrwxrwx  1 usagi users   32  3月  5 22:27 COPYING -> /usr/share/automake-1.11/COPYING
-rw-r--r--  1 usagi users    0  4月  6  2009 ChangeLog
-rw-r--r--  1 usagi users   59  4月  6  2009 INSTALL
-rw-r--r--  1 usagi users  23K  3月  5 22:27 Makefile
-rw-r--r--  1 usagi users   26  4月  6  2009 Makefile.am
-rw-r--r--  1 usagi users  23K  3月  5 22:27 Makefile.in
-rw-r--r--  1 usagi users    0  4月  6  2009 NEWS
-rw-r--r--  1 usagi users    0  4月  6  2009 README
-rw-r--r--  1 usagi users 336K  3月  5 22:27 aclocal.m4
-rwxr-xr-x  1 usagi users 4.5K  4月  6  2009 autogen.sh
drwxr-xr-x  2 usagi users  180  3月  5 22:27 autom4te.cache
drwxr-xr-x  3 usagi users  220  3月  5 22:27 buftool
lrwxrwxrwx  1 usagi users   37  3月  5 22:27 config.guess -> /usr/share/automake-1.11/config.guess
-rw-r--r--  1 usagi users 2.9K  3月  5 22:27 config.h
-rw-r--r--  1 usagi users 2.7K  3月  5 22:27 config.h.in
-rw-r--r--  1 usagi users  33K  3月  5 22:27 config.log
-rwxr-xr-x  1 usagi users  70K  3月  5 22:27 config.status
lrwxrwxrwx  1 usagi users   35  3月  5 22:27 config.sub -> /usr/share/automake-1.11/config.sub
-rwxr-xr-x  1 usagi users 549K  3月  5 22:27 configure
-rw-r--r--  1 usagi users  605  4月  6  2009 configure.in
lrwxrwxrwx  1 usagi users   32  3月  5 22:27 depcomp -> /usr/share/automake-1.11/depcomp
lrwxrwxrwx  1 usagi users   35  3月  5 22:27 install-sh -> /usr/share/automake-1.11/install-sh
-rwxr-xr-x  1 usagi users 292K  3月  5 22:27 libtool
-rw-r--r--  1 usagi users 277K  3月  5 22:27 ltmain.sh
lrwxrwxrwx  1 usagi users   32  3月  5 22:27 missing -> /usr/share/automake-1.11/missing
drwxr-xr-x  3 usagi users  160  3月  5 22:27 paramlist
-rw-r--r--  1 usagi users   23  3月  5 22:27 stamp-h1

これで make れるようになったみたいですね。ではさっそく。

LH-MAIN /tmp/mp640/cnijfilter-source-3.20-1/libs% make     
make  all-recursive
make[1]: ディレクトリ `/tmp/mp640/cnijfilter-source-3.20-1/libs' に入ります
Making all in paramlist
make[2]: ディレクトリ `/tmp/mp640/cnijfilter-source-3.20-1/libs/paramlist' に入ります
/bin/sh ../libtool --tag=CC   --mode=compile gcc -DHAVE_CONFIG_H -I. -I..    -O2 -Wall -O2 -MT paramlist.lo -MD -MP -MF .deps/paramlist.Tpo -c -o paramlist.lo paramlist.c
libtool: compile:  gcc -DHAVE_CONFIG_H -I. -I.. -O2 -Wall -O2 -MT paramlist.lo -MD -MP -MF .deps/paramlist.Tpo -c paramlist.c  -fPIC -DPIC -o .libs/paramlist.o
libtool: compile:  gcc -DHAVE_CONFIG_H -I. -I.. -O2 -Wall -O2 -MT paramlist.lo -MD -MP -MF .deps/paramlist.Tpo -c paramlist.c -o paramlist.o >/dev/null 2>&1
mv -f .deps/paramlist.Tpo .deps/paramlist.Plo
/bin/sh ../libtool --tag=CC   --mode=link gcc -O2 -Wall -O2   -o libparamlist.la  paramlist.lo  
libtool: link: ar cru .libs/libparamlist.a .libs/paramlist.o 
libtool: link: ranlib .libs/libparamlist.a
libtool: link: ( cd ".libs" && rm -f "libparamlist.la" && ln -s "../libparamlist.la" "libparamlist.la" )
make[2]: ディレクトリ `/tmp/mp640/cnijfilter-source-3.20-1/libs/paramlist' から出ます
Making all in buftool
make[2]: ディレクトリ `/tmp/mp640/cnijfilter-source-3.20-1/libs/buftool' に入ります
gcc -DHAVE_CONFIG_H -I. -I..     -O2 -MT buftool.o -MD -MP -MF .deps/buftool.Tpo -c -o buftool.o buftool.c
mv -f .deps/buftool.Tpo .deps/buftool.Po
gcc -DHAVE_CONFIG_H -I. -I..     -O2 -MT buflist.o -MD -MP -MF .deps/buflist.Tpo -c -o buflist.o buflist.c
mv -f .deps/buflist.Tpo .deps/buflist.Po
rm -f libbuftool.a
ar cru libbuftool.a buftool.o buflist.o 
ranlib libbuftool.a
make[2]: ディレクトリ `/tmp/mp640/cnijfilter-source-3.20-1/libs/buftool' から出ます
make[2]: ディレクトリ `/tmp/mp640/cnijfilter-source-3.20-1/libs' に入ります
make[2]: ディレクトリ `/tmp/mp640/cnijfilter-source-3.20-1/libs' から出ます
make[1]: ディレクトリ `/tmp/mp640/cnijfilter-source-3.20-1/libs' から出ます

できたようですね。次へ。

LH-MAIN /tmp/mp640/cnijfilter-source-3.20-1% cd cngpij
LH-MAIN /tmp/mp640/cnijfilter-source-3.20-1/cngpij% ls    
合計 60K
drwxr-xr-x  4 usagi users  300  9月 28  2009 .
drwxr-xr-x 22 usagi users  560  9月 28  2009 ..
-rw-r--r--  1 usagi users   11  4月  6  2009 AUTHORS
-rw-r--r--  1 usagi users  18K  4月  6  2009 COPYING
-rwxr-xr-x  1 usagi users  614  4月  6  2009 ChangeLog
-rw-r--r--  1 usagi users  506  4月  6  2009 INSTALL
-rw-r--r--  1 usagi users  125  4月  6  2009 LICENSE
-rw-r--r--  1 usagi users   18  4月  6  2009 Makefile.am
-rwxr-xr-x  1 usagi users 1.3K  4月  6  2009 NEWS
-rwxr-xr-x  1 usagi users 1.1K  4月  6  2009 README
-rw-r--r--  1 usagi users   17  4月  6  2009 acconfig.h
-rwxr-xr-x  1 usagi users 4.0K  4月  6  2009 autogen.sh
drwxr-xr-x  2 usagi users  160  9月 28  2009 cngpij
-rwxr-xr-x  1 usagi users 1.1K  4月  6  2009 configure.in
drwxr-xr-x  4 usagi users   80  9月 28  2009 include

なんだかパーミッションの釈然としない感が一層高いですが、気にしていると更に疲れるので見なかった事にして ./autogen.sh && make 。

LH-MAIN /tmp/mp640/cnijfilter-source-3.20-1/cngpij% ./autogen.sh && make
**Warning**: I am going to run `configure' with no arguments.
If you wish to pass any to it, please specify them on the
`./autogen.sh' command line.

processing .
Running libtoolize..
libtoolize: putting auxiliary files in `.'.
libtoolize: copying file `./ltmain.sh'
libtoolize: You should add the contents of the following files to `aclocal.m4':
libtoolize:   `/usr/share/aclocal/libtool.m4'
libtoolize:   `/usr/share/aclocal/ltoptions.m4'
libtoolize:   `/usr/share/aclocal/ltversion.m4'
libtoolize:   `/usr/share/aclocal/ltsugar.m4'
libtoolize:   `/usr/share/aclocal/lt~obsolete.m4'
libtoolize: Consider adding `AC_CONFIG_MACRO_DIR([m4])' to configure.in an
libtoolize: rerunning libtoolize, to keep the correct libtool macros in-tree
libtoolize: Consider adding `-I m4' to ACLOCAL_AMFLAGS in Makefile.am.
Running aclocal  ...
Running autoheader...
autoheader: WARNING: Using auxiliary files such as `acconfig.h', `config.h.bot'
autoheader: WARNING: and `config.h.top', to define templates for `config.h.in'
autoheader: WARNING: is deprecated and discouraged.
autoheader: 
autoheader: WARNING: Using the third argument of `AC_DEFINE' and
autoheader: WARNING: `AC_DEFINE_UNQUOTED' allows one to define a template without
autoheader: WARNING: `acconfig.h':
autoheader: 
autoheader: WARNING:   AC_DEFINE([NEED_FUNC_MAIN], 1,
autoheader:             [Define if a function `main' is needed.])
autoheader: 
autoheader: WARNING: More sophisticated templates can also be produced, see the
autoheader: WARNING: documentation.
Running automake --gnu  ...
configure.in:20: installing `./config.guess'
configure.in:20: installing `./config.sub'
configure.in:2: installing `./install-sh'
configure.in:2: installing `./missing'
cngpij/Makefile.am: installing `./depcomp'
Running autoconf ...
Running ./configure ...
checking for a BSD-compatible install... /bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking for g++... g++
checking whether the C++ compiler works... yes
checking for C++ compiler default output file name... a.out
checking for suffix of executables... 
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C++ compiler... yes
checking whether g++ accepts -g... yes
checking for style of include used by make... GNU
checking dependency style of g++... gcc3
checking for gcc... gcc
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking dependency style of gcc... gcc3
checking whether make sets $(MAKE)... (cached) yes
checking build system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
checking how to print strings... printf
checking for a sed that does not truncate output... sed
checking for grep that handles long lines and -e... /usr/bin/grep
checking for egrep... /usr/bin/grep -E
checking for fgrep... /usr/bin/grep -F
checking for ld used by gcc... /usr/bin/ld
checking if the linker (/usr/bin/ld) is GNU ld... yes
checking for BSD- or MS-compatible name lister (nm)... /usr/bin/nm -
checking the name lister (/usr/bin/nm -B) interface... BSD nm
checking whether ln -s works... yes
checking the maximum length of command line arguments... 1572864
checking whether the shell understands some XSI constructs... yes
checking whether the shell understands "+="... yes
checking how to convert x86_64-unknown-linux-gnu file names to x86_64-unknown-linux-gnu format... func_convert_file_noop
checking how to convert x86_64-unknown-linux-gnu file names to toolchain format... func_convert_file_noop
checking for /usr/bin/ld option to reload object files... -r
checking for objdump... objdump
checking how to recognize dependent libraries... pass_all
checking for dlltool... no
checking how to associate runtime and link libraries... printf %s\n
checking for ar... ar
checking for archiver @FILE support... @
checking for strip... strip
checking for ranlib... ranlib
checking command to parse /usr/bin/nm -B output from gcc object... o
checking for sysroot... no
checking for mt... no
checking if : is a manifest tool... no
checking how to run the C preprocessor... gcc -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking for dlfcn.h... yes
checking for objdir... .libs
checking if gcc supports -fno-rtti -fno-exceptions... no
checking for gcc option to produce PIC... -fPIC -DPIC
checking if gcc PIC flag -fPIC -DPIC works... yes
checking if gcc static flag -static works... yes
checking if gcc supports -c -o file.o... yes
checking if gcc supports -c -o file.o... (cached) yes
checking whether the gcc linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes
checking whether -lc should be explicitly linked in... no
checking dynamic linker characteristics... GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... yes
checking how to run the C++ preprocessor... g++ -E
checking for ld used by g++... /usr/bin/ld -m elf_x86_64
checking if the linker (/usr/bin/ld -m elf_x86_64) is GNU ld... yes
checking whether the g++ linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes
checking for g++ option to produce PIC... -fPIC -DPIC
checking if g++ PIC flag -fPIC -DPIC works... yes
checking if g++ static flag -static works... yes
checking if g++ supports -c -o file.o... yes
checking if g++ supports -c -o file.o... (cached) yes
checking whether the g++ linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes
checking dynamic linker characteristics... (cached) GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
checking for main in -lcups... yes
checking for main in -lparamlist... no
checking for main in -lpopt... yes
checking for ANSI C header files... (cached) yes
checking for sys/wait.h that is POSIX.1 compatible... yes
checking arpa/inet.h usability... yes
checking arpa/inet.h presence... yes
checking for arpa/inet.h... yes
checking fcntl.h usability... yes
checking fcntl.h presence... yes
checking for fcntl.h... yes
checking netdb.h usability... yes
checking netdb.h presence... yes
checking for netdb.h... yes
checking netinet/in.h usability... yes
checking netinet/in.h presence... yes
checking for netinet/in.h... yes
checking for stdlib.h... (cached) yes
checking for string.h... (cached) yes
checking sys/socket.h usability... yes
checking sys/socket.h presence... yes
checking for sys/socket.h... yes
checking for unistd.h... (cached) yes
checking for an ANSI C-conforming const... yes
checking for size_t... yes
checking for pid_t... yes
checking vfork.h usability... no
checking vfork.h presence... no
checking for vfork.h... no
checking for fork... yes
checking for vfork... yes
checking for working fork... yes
checking for working vfork... (cached) yes
checking for stdlib.h... (cached) yes
checking for GNU libc compatible malloc... yes
checking for memset... yes
checking for socket... yes
checking for strdup... yes
checking for strrchr... yes
configure: creating ./config.status
config.status: creating Makefile
config.status: creating cngpij/Makefile
config.status: creating config.h
config.status: executing depfiles commands
config.status: executing libtool commands
Now type `make' to compile
make  all-recursive
make[1]: ディレクトリ `/tmp/mp640/cnijfilter-source-3.20-1/cngpij' に入ります
Making all in cngpij
make[2]: ディレクトリ `/tmp/mp640/cnijfilter-source-3.20-1/cngpij/cngpij' に入ります
gcc -DHAVE_CONFIG_H -I. -I..    -O2 -Wall -I../include/cncl -I../include/misc -I../../libs/paramlist -O2 -MT bjcups.o -MD -MP -MF .deps/bjcups.Tpo -c -o bjcups.o bjcups.c
bjcups.c: 関数 ‘main’ 内:
bjcups.c:823:14: 警告: assignment discards ‘const’ qualifier from pointer target type [デフォルトで有効]
mv -f .deps/bjcups.Tpo .deps/bjcups.Po
gcc -DHAVE_CONFIG_H -I. -I..    -O2 -Wall -I../include/cncl -I../include/misc -I../../libs/paramlist -O2 -MT getipc.o -MD -MP -MF .deps/getipc.Tpo -c -o getipc.o getipc.c
getipc.c: 関数 ‘GetIPCData’ 内:
getipc.c:62:48: 警告: 互換性のないポインタ型から 3 番目の ‘accept’ の引数に渡しています [デフォルトで有効]
/usr/include/sys/socket.h:214:12: 備考: expected ‘socklen_t * __restrict__’ but argument is of type ‘size_t *’
mv -f .deps/getipc.Tpo .deps/getipc.Po
gcc -DHAVE_CONFIG_H -I. -I..    -O2 -Wall -I../include/cncl -I../include/misc -I../../libs/paramlist -O2 -MT bjutil.o -MD -MP -MF .deps/bjutil.Tpo -c -o bjutil.o bjutil.c
mv -f .deps/bjutil.Tpo .deps/bjutil.Po
/bin/sh ../libtool --tag=CC   --mode=link gcc -O2 -Wall -I../include/cncl -I../include/misc -I../../libs/paramlist -O2 -L../../libs/paramlist  -o cngpij bjcups.o getipc.o bjutil.o -lpopt -lcups -lparamlist  -lpopt -lcups 
libtool: link: gcc -O2 -Wall -I../include/cncl -I../include/misc -I../../libs/paramlist -O2 -o cngpij bjcups.o getipc.o bjutil.o  -L../../libs/paramlist /tmp/mp640/cnijfilter-source-3.20-1/libs/paramlist/.libs/libparamlist.a -lpopt -lcups
make[2]: ディレクトリ `/tmp/mp640/cnijfilter-source-3.20-1/cngpij/cngpij' から出ます
make[2]: ディレクトリ `/tmp/mp640/cnijfilter-source-3.20-1/cngpij' に入ります
make[2]: ディレクトリ `/tmp/mp640/cnijfilter-source-3.20-1/cngpij' から出ます
make[1]: ディレクトリ `/tmp/mp640/cnijfilter-source-3.20-1/cngpij' から出ます

はい次。

LH-MAIN /tmp/mp640/cnijfilter-source-3.20-1/cngpij% cd ../pstocanonij          
LH-MAIN /tmp/mp640/cnijfilter-source-3.20-1/pstocanonij% ls    
合計 64K
drwxr-xr-x  3 usagi users  280  9月 28  2009 .
drwxr-xr-x 22 usagi users  560  9月 28  2009 ..
-rw-r--r--  1 usagi users   12  4月  6  2009 AUTHORS
-rw-r--r--  1 usagi users  18K  4月  6  2009 COPYING
-rwxr-xr-x  1 usagi users  966  4月  6  2009 ChangeLog
-rw-r--r--  1 usagi users  512  4月  6  2009 INSTALL
-rw-r--r--  1 usagi users  125  4月  6  2009 LICENSE
-rw-r--r--  1 usagi users   18  4月  6  2009 Makefile.am
-rwxr-xr-x  1 usagi users 1.3K  4月  6  2009 NEWS
-rw-r--r--  1 usagi users  642  4月  6  2009 README
-rw-r--r--  1 usagi users  122  4月  6  2009 acconfig.h
-rwxr-xr-x  1 usagi users 4.1K  4月  6  2009 autogen.sh
-rwxr-xr-x  1 usagi users 1.2K  4月  6  2009 configure.in
drwxr-xr-x  2 usagi users  160  9月 28  2009 filter
LH-MAIN /tmp/mp640/cnijfilter-source-3.20-1/pstocanonij% ./autogen.sh && make
**Warning**: I am going to run `configure' with no arguments.
If you wish to pass any to it, please specify them on the
`./autogen.sh' command line.

processing .
Running libtoolize..
libtoolize: putting auxiliary files in `.'.
libtoolize: copying file `./ltmain.sh'
libtoolize: You should add the contents of the following files to `aclocal.m4':
libtoolize:   `/usr/share/aclocal/libtool.m4'
libtoolize:   `/usr/share/aclocal/ltoptions.m4'
libtoolize:   `/usr/share/aclocal/ltversion.m4'
libtoolize:   `/usr/share/aclocal/ltsugar.m4'
libtoolize:   `/usr/share/aclocal/lt~obsolete.m4'
libtoolize: Consider adding `AC_CONFIG_MACRO_DIR([m4])' to configure.in and
libtoolize: rerunning libtoolize, to keep the correct libtool macros in-tree.
libtoolize: Consider adding `-I m4' to ACLOCAL_AMFLAGS in Makefile.am.
libtoolize: `AC_PROG_RANLIB' is rendered obsolete by `LT_INIT'
Running aclocal  ...
Running autoheader...
autoheader: WARNING: Using auxiliary files such as `acconfig.h', `config.h.bot'
autoheader: WARNING: and `config.h.top', to define templates for `config.h.in'
autoheader: WARNING: is deprecated and discouraged.
autoheader: 
autoheader: WARNING: Using the third argument of `AC_DEFINE' and
autoheader: WARNING: `AC_DEFINE_UNQUOTED' allows one to define a template without
autoheader: WARNING: `acconfig.h':
autoheader: 
autoheader: WARNING:   AC_DEFINE([NEED_FUNC_MAIN], 1,
autoheader:             [Define if a function `main' is needed.])
autoheader: 
autoheader: WARNING: More sophisticated templates can also be produced, see the
autoheader: WARNING: documentation.
Running automake --gnu  ...
configure.in:22: installing `./config.guess'
configure.in:22: installing `./config.sub'
configure.in:2: installing `./install-sh'
configure.in:2: installing `./missing'
filter/Makefile.am: installing `./depcomp'
Running autoconf ...
Running ./configure ...
checking for a BSD-compatible install... /bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking for g++... g++
checking whether the C++ compiler works... yes
checking for C++ compiler default output file name... a.out
checking for suffix of executables... 
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C++ compiler... yes
checking whether g++ accepts -g... yes
checking for style of include used by make... GNU
checking dependency style of g++... gcc3
checking for gcc... gcc
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking dependency style of gcc... gcc3
checking how to run the C preprocessor... gcc -E
checking whether ln -s works... yes
checking whether make sets $(MAKE)... (cached) yes
checking for ranlib... ranlib
checking build system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
checking how to print strings... printf
checking for a sed that does not truncate output... sed
checking for grep that handles long lines and -e... /usr/bin/grep
checking for egrep... /usr/bin/grep -E
checking for fgrep... /usr/bin/grep -F
checking for ld used by gcc... /usr/bin/ld
checking if the linker (/usr/bin/ld) is GNU ld... yes
checking for BSD- or MS-compatible name lister (nm)... /usr/bin/nm -B
checking the name lister (/usr/bin/nm -B) interface... BSD nm
checking the maximum length of command line arguments... 1572864
checking whether the shell understands some XSI constructs... yes
checking whether the shell understands "+="... yes
checking how to convert x86_64-unknown-linux-gnu file names to x86_64-unknown-linux-gnu format... func_convert_file_noop
checking how to convert x86_64-unknown-linux-gnu file names to toolchain format... func_convert_file_noop
checking for /usr/bin/ld option to reload object files... -r
checking for objdump... objdump
checking how to recognize dependent libraries... pass_all
checking for dlltool... no
checking how to associate runtime and link libraries... printf %s\n
checking for ar... ar
checking for archiver @FILE support... @
checking for strip... strip
checking for ranlib... (cached) ranlib
checking command to parse /usr/bin/nm -B output from gcc object... ok
checking for sysroot... no
checking for mt... no
checking if : is a manifest tool... no
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking for dlfcn.h... yes
checking for objdir... .libs
checking if gcc supports -fno-rtti -fno-exceptions... no
checking for gcc option to produce PIC... -fPIC -DPIC
checking if gcc PIC flag -fPIC -DPIC works... yes
checking if gcc static flag -static works... yes
checking if gcc supports -c -o file.o... yes
checking if gcc supports -c -o file.o... (cached) yes
checking whether the gcc linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes
checking whether -lc should be explicitly linked in... no
checking dynamic linker characteristics... GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... yes
checking how to run the C++ preprocessor... g++ -E
checking for ld used by g++... /usr/bin/ld -m elf_x86_64
checking if the linker (/usr/bin/ld -m elf_x86_64) is GNU ld... yes
checking whether the g++ linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes
checking for g++ option to produce PIC... -fPIC -DPIC
checking if g++ PIC flag -fPIC -DPIC works... yes
checking if g++ static flag -static works... yes
checking if g++ supports -c -o file.o... yes
checking if g++ supports -c -o file.o... (cached) yes
checking whether the g++ linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes
checking dynamic linker characteristics... (cached) GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
checking for main in -lcups... yes
checking for main in -lparamlist... no
checking for main in -lpopt... yes
checking for ANSI C header files... (cached) yes
checking for sys/wait.h that is POSIX.1 compatible... yes
checking arpa/inet.h usability... yes
checking arpa/inet.h presence... yes
checking for arpa/inet.h... yes
checking fcntl.h usability... yes
checking fcntl.h presence... yes
checking for fcntl.h... yes
checking malloc.h usability... yes
checking malloc.h presence... yes
checking for malloc.h... yes
checking netdb.h usability... yes
checking netdb.h presence... yes
checking for netdb.h... yes
checking netinet/in.h usability... yes
checking netinet/in.h presence... yes
checking for netinet/in.h... yes
checking for stdlib.h... (cached) yes
checking for string.h... (cached) yes
checking sys/socket.h usability... yes
checking sys/socket.h presence... yes
checking for sys/socket.h... yes
checking for unistd.h... (cached) yes
checking for an ANSI C-conforming const... yes
checking for size_t... yes
checking for pid_t... yes
checking vfork.h usability... no
checking vfork.h presence... no
checking for vfork.h... no
checking for fork... yes
checking for vfork... yes
checking for working fork... yes
checking for working vfork... (cached) yes
checking for stdlib.h... (cached) yes
checking for GNU libc compatible malloc... yes
checking for dup2... yes
checking for memset... yes
checking for socket... yes
checking for strdup... yes
checking for strrchr... yes
configure: creating ./config.status
config.status: creating Makefile
config.status: creating filter/Makefile
config.status: creating config.h
config.status: executing depfiles commands
config.status: executing libtool commands
Now type `make' to compile
make  all-recursiv
make[1]: ディレクトリ `/tmp/mp640/cnijfilter-source-3.20-1/pstocanonij' に入ります
Making all in filter
make[2]: ディレクトリ `/tmp/mp640/cnijfilter-source-3.20-1/pstocanonij/filter' に入ります
gcc -DHAVE_CONFIG_H -I. -I..    -O2 -Wall -I../../libs/buftool -O2 -MT pstocanonij.o -MD -MP -MF .deps/pstocanonij.Tpo -c -o pstocanonij.o pstocanonij.c
pstocanonij.c: 関数 ‘get_ps_params’ 内:
pstocanonij.c:248:3: 警告: 1 番目の ‘buflist_new’ の引数を渡すときのポインタの先の符号が異なります [-Wpointer-sign
../../libs/buftool/buflist.h:38:10: 備考: expected ‘unsigned char *’ but argument is of type ‘char *’
pstocanonij.c:298:5: 警告: 計算された値が使用されません [-Wunused-value]
pstocanonij.c:384:3: 警告: 1 番目の ‘buflist_new’ の引数を渡すときのポインタの先の符号が異なります [-Wpointer-sign]
../../libs/buftool/buflist.h:38:10: 備考: expected ‘unsigned char *’ but argument is of type ‘char *’
pstocanonij.c: 関数 ‘make_cmd_param’ 内:
pstocanonij.c:919:6: 警告: 書式 ‘%s’ は引数の型が ‘char *’ であると予期されますが、第 4 引数の型は ‘char (*)[256]’ です [-Wformat]
pstocanonij.c:920:6: 警告: 書式 ‘%s’ は引数の型が ‘char *’ であると予期されますが、第 4 引数の型は ‘char (*)[256]’ です [-Wformat]
pstocanonij.c:949:6: 警告: 書式 ‘%s’ は引数の型が ‘char *’ であると予期されますが、第 4 引数の型は ‘char (*)[256]’ です [-Wformat]
pstocanonij.c:950:6: 警告: 書式 ‘%s’ は引数の型が ‘char *’ であると予期されますが、第 4 引数の型は ‘char (*)[256]’ です [-Wformat]
pstocanonij.c: 関数 ‘exec_filter’ 内:
pstocanonij.c:1153:6: 警告: 変数 ‘status’ が設定されましたが使用されていません [-Wunused-but-set-variable]
mv -f .deps/pstocanonij.Tpo .deps/pstocanonij.Po
gcc -DHAVE_CONFIG_H -I. -I..    -O2 -Wall -I../../libs/buftool -O2 -MT canonopt.o -MD -MP -MF .deps/canonopt.Tpo -c -o canonopt.o canonopt.c
mv -f .deps/canonopt.Tpo .deps/canonopt.Po
gcc -DHAVE_CONFIG_H -I. -I..    -O2 -Wall -I../../libs/buftool -O2 -MT paramlist.o -MD -MP -MF .deps/paramlist.Tpo -c -o paramlist.o paramlist.c
mv -f .deps/paramlist.Tpo .deps/paramlist.Po
/bin/sh ../libtool --tag=CC   --mode=link gcc -O2 -Wall -I../../libs/buftool -O2 -L../../libs/buftool  -o pstocanonij pstocanonij.o canonopt.o paramlist.o -lcups ../../libs/buftool/libbuftool.a -lpopt -lcups 
libtool: link: gcc -O2 -Wall -I../../libs/buftool -O2 -o pstocanonij pstocanonij.o canonopt.o paramlist.o  -L../../libs/buftool ../../libs/buftool/libbuftool.a -lpopt -lcups
make[2]: ディレクトリ `/tmp/mp640/cnijfilter-source-3.20-1/pstocanonij/filter' から出ます
make[2]: ディレクトリ `/tmp/mp640/cnijfilter-source-3.20-1/pstocanonij' に入ります
make[2]: ディレクトリ `/tmp/mp640/cnijfilter-source-3.20-1/pstocanonij' から出ます
make[1]: ディレクトリ `/tmp/mp640/cnijfilter-source-3.20-1/pstocanonij' から出ます

つぎ。

LH-MAIN /tmp/mp640/cnijfilter-source-3.20-1/pstocanonij% cd ../backend     
LH-MAIN /tmp/mp640/cnijfilter-source-3.20-1/backend% ls    
合計 104K
drwxr-xr-x  3 usagi users  300  9月 28  2009 .
drwxr-xr-x 22 usagi users  560  9月 28  2009 ..
-rwxr-xr-x  1 usagi users   12  4月  6  2009 AUTHORS
-rwxr-xr-x  1 usagi users  18K  4月  6  2009 COPYING
-rwxr-xr-x  1 usagi users   23  4月  6  2009 ChangeLog
-rwxr-xr-x  1 usagi users  363  4月  6  2009 INSTALL
-rwxr-xr-x  1 usagi users  125  4月  6  2009 LICENSE.canon.txt
-rwxr-xr-x  1 usagi users  42K  4月  6  2009 LICENSE.txt
-rwxr-xr-x  1 usagi users   14  4月  6  2009 Makefile.am
-rwxr-xr-x  1 usagi users 1.4K  4月  6  2009 NEWS
-rwxr-xr-x  1 usagi users  697  4月  6  2009 README
-rwxr-xr-x  1 usagi users   17  4月  6  2009 acconfig.h
-rwxr-xr-x  1 usagi users 4.0K  4月  6  2009 autogen.sh
-rwxr-xr-x  1 usagi users  897  4月  6  2009 configure.in
drwxr-xr-x  2 usagi users  160  9月 28  2009 src
LH-MAIN /tmp/mp640/cnijfilter-source-3.20-1/backend% ./autogen.sh && make
**Warning**: I am going to run `configure' with no arguments.
If you wish to pass any to it, please specify them on the
`./autogen.sh' command line.

processing .
Running libtoolize...
libtoolize: putting auxiliary files in `.'.
libtoolize: copying file `./ltmain.sh'
libtoolize: You should add the contents of the following files to `aclocal.m4':
libtoolize:   `/usr/share/aclocal/libtool.m4'
libtoolize:   `/usr/share/aclocal/ltoptions.m4'
libtoolize:   `/usr/share/aclocal/ltversion.m4'
libtoolize:   `/usr/share/aclocal/ltsugar.m4'
libtoolize:   `/usr/share/aclocal/lt~obsolete.m4'
libtoolize: Consider adding `AC_CONFIG_MACRO_DIR([m4])' to configure.in and
libtoolize: rerunning libtoolize, to keep the correct libtool macros in-tree.
libtoolize: Consider adding `-I m4' to ACLOCAL_AMFLAGS in Makefile.am
Running aclocal  ..
Running autoheader...
autoheader: WARNING: Using auxiliary files such as `acconfig.h', `config.h.bot'
autoheader: WARNING: and `config.h.top', to define templates for `config.h.in'
autoheader: WARNING: is deprecated and discouraged.
autoheader: 
autoheader: WARNING: Using the third argument of `AC_DEFINE' and
autoheader: WARNING: `AC_DEFINE_UNQUOTED' allows one to define a template without
autoheader: WARNING: `acconfig.h':
autoheader: 
autoheader: WARNING:   AC_DEFINE([NEED_FUNC_MAIN], 1,
autoheader:             [Define if a function `main' is needed.])
autoheader: 
autoheader: WARNING: More sophisticated templates can also be produced, see the
autoheader: WARNING: documentation.
Running automake --gnu  ...
configure.in:19: installing `./config.guess'
configure.in:19: installing `./config.sub'
configure.in:2: installing `./install-sh'
configure.in:2: installing `./missing'
src/Makefile.am: installing `./depcomp'
src/Makefile.am:10: `CFLAGS' is a user variable, you should not override it;
src/Makefile.am:10: use `AM_CFLAGS' instead.
Running autoconf ..
Running ./configure ...
checking for a BSD-compatible install... /bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking for g++... g++
checking whether the C++ compiler works... yes
checking for C++ compiler default output file name... a.out
checking for suffix of executables... 
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C++ compiler... yes
checking whether g++ accepts -g... yes
checking for style of include used by make... GNU
checking dependency style of g++... gcc3
checking for gcc... gcc
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking dependency style of gcc... gcc3
checking whether make sets $(MAKE)... (cached) yes
checking build system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
checking how to print strings... printf
checking for a sed that does not truncate output... sed
checking for grep that handles long lines and -e... /usr/bin/grep
checking for egrep... /usr/bin/grep -E
checking for fgrep... /usr/bin/grep -F
checking for ld used by gcc... /usr/bin/ld
checking if the linker (/usr/bin/ld) is GNU ld... yes
checking for BSD- or MS-compatible name lister (nm)... /usr/bin/nm -B
checking the name lister (/usr/bin/nm -B) interface... BSD nm
checking whether ln -s works... yes
checking the maximum length of command line arguments... 1572864
checking whether the shell understands some XSI constructs... yes
checking whether the shell understands "+="... yes
checking how to convert x86_64-unknown-linux-gnu file names to x86_64-unknown-linux-gnu format.. func_convert_file_noop
checking how to convert x86_64-unknown-linux-gnu file names to toolchain format... func_convertfile_noop
checking for /usr/bin/ld option to reload object files... -r
checking for objdump... objdump
checking how to recognize dependent libraries... pass_all
checking for dlltool... no
checking how to associate runtime and link libraries... printf %s\n
checking for ar... ar
checking for archiver @FILE support... @
checking for strip... strip
checking for ranlib... ranlib
checking command to parse /usr/bin/nm -B output from gcc object... ok
checking for sysroot... no
checking for mt... no
checking if : is a manifest tool... no
checking how to run the C preprocessor... gcc -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking for dlfcn.h... yes
checking for objdir... .libs
checking if gcc supports -fno-rtti -fno-exceptions... no
checking for gcc option to produce PIC... -fPIC -DPIC
checking if gcc PIC flag -fPIC -DPIC works... yes
checking if gcc static flag -static works... yes
checking if gcc supports -c -o file.o... yes
checking if gcc supports -c -o file.o... (cached) yes
checking whether the gcc linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... ye
checking whether -lc should be explicitly linked in... no
checking dynamic linker characteristics... GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... yes
checking how to run the C++ preprocessor... g++ -E
checking for ld used by g++... /usr/bin/ld -m elf_x86_64
checking if the linker (/usr/bin/ld -m elf_x86_64) is GNU ld... yes
checking whether the g++ linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... ye
checking for g++ option to produce PIC... -fPIC -DPIC
checking if g++ PIC flag -fPIC -DPIC works... yes
checking if g++ static flag -static works... yes
checking if g++ supports -c -o file.o... yes
checking if g++ supports -c -o file.o... (cached) yes
checking whether the g++ linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... ye
checking dynamic linker characteristics... (cached) GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
checking for main in -lcups... yes
checking for ANSI C header files... (cached) yes
checking for sys/wait.h that is POSIX.1 compatible... yes
checking arpa/inet.h usability... yes
checking arpa/inet.h presence... yes
checking for arpa/inet.h... yes
checking fcntl.h usability... yes
checking fcntl.h presence... yes
checking for fcntl.h... yes
checking netdb.h usability... yes
checking netdb.h presence... yes
checking for netdb.h... yes
checking netinet/in.h usability... yes
checking netinet/in.h presence... yes
checking for netinet/in.h... yes
checking for stdlib.h... (cached) yes
checking for string.h... (cached) yes
checking sys/socket.h usability... yes
checking sys/socket.h presence... yes
checking for sys/socket.h... yes
checking for unistd.h... (cached) yes
checking for an ANSI C-conforming const... yes
checking for size_t... yes
checking for pid_t... yes
checking vfork.h usability... no
checking vfork.h presence... no
checking for vfork.h... no
checking for fork... yes
checking for vfork... yes
checking for working fork... yes
checking for working vfork... (cached) yes
checking for stdlib.h... (cached) yes
checking for GNU libc compatible malloc... yes
checking for memset... yes
checking for socket... yes
checking for strdup... yes
checking for strrchr... yes
configure: creating ./config.status
config.status: creating Makefile
config.status: creating src/Makefile
config.status: creating config.h
config.status: executing depfiles commands
config.status: executing libtool commands
Now type `make' to compile
make  all-recursive
make[1]: ディレクトリ `/tmp/mp640/cnijfilter-source-3.20-1/backend' に入ります
Making all in src
make[2]: ディレクトリ `/tmp/mp640/cnijfilter-source-3.20-1/backend/src' に入ります
gcc -DHAVE_CONFIG_H -I. -I..     -O2 -Wall -MT cnij_backend_common.o -MD -MP -MF .deps/cnij_backend_common.Tpo -c -o cnij_backend_common.o cnij_backend_common.c
cnij_backend_common.c: 関数 ‘make_lgmon_command’ 内:
cnij_backend_common.c:161:2: エラー: 不明な型名 ‘ppd_file_t’ です
cnij_backend_common.c:165:2: 警告: 関数 ‘ppdOpenFile’ の暗黙的な宣言です [-Wimplicit-function-declaration]
cnij_backend_common.c:165:13: 警告: 代入で整数からキャスト無しにポインタを作成しています [デフォルトで有効]
cnij_backend_common.c:168:11: エラー: 構造体または共用体ではない何かのメンバ ‘model_number’ の要求です
cnij_backend_common.c:169:67: エラー: 構造体または共用体ではない何かのメンバ ‘model_number’ の要求です
cnij_backend_common.c:170:2: 警告: 関数 ‘ppdClose’ の暗黙的な宣言です [-Wimplicit-function-declaration]
cnij_backend_common.c: 関数 ‘get_model_name’ 内:
cnij_backend_common.c:215:2: エラー: 不明な型名 ‘ppd_file_t’ です
cnij_backend_common.c:219:17: 警告: 代入で整数からキャスト無しにポインタを作成しています [デフォルトで有効]
cnij_backend_common.c:221:23: エラー: 構造体または共用体ではない何かのメンバ ‘product’ の要求です
cnij_backend_common.c:227:4: エラー: 構造体または共用体ではない何かのメンバ ‘product’ の要求です
make[2]: *** [cnij_backend_common.o] エラー 1
make[2]: ディレクトリ `/tmp/mp640/cnijfilter-source-3.20-1/backend/src' から出ます
make[1]: *** [all-recursive] エラー 1
make[1]: ディレクトリ `/tmp/mp640/cnijfilter-source-3.20-1/backend' から出ます
make: *** [all] エラー 2

ここで"ppd_file_t"が無いよエラー停止。状況と名前からPPDファイルを扱う構造体でCUPS関連の開発用リソースに含まれている気がする。

と、いうわけで、 cups/ppd.h にこの定義が含まれるらしいから、

LH-MAIN /tmp/mp640/cnijfilter-source-3.20-1/backend% find /usr/include -name ppd.h
/usr/include/cups/ppd.h

はいはいあったあった・w・

LH-MAIN /tmp/mp640/cnijfilter-source-3.20-1/backend% grep -n "ppd_file_t" /usr/include/cups/ppd.h | head 
344:} ppd_file_t;
351:extern int          cupsMarkOptions(ppd_file_t *ppd, int num_options,
353:extern void         ppdClose(ppd_file_t *ppd);
354:extern int          ppdCollect(ppd_file_t *ppd, ppd_section_t section,
356:extern int          ppdConflicts(ppd_file_t *ppd);
357:extern int          ppdEmit(ppd_file_t *ppd, FILE *fp,
359:extern int          ppdEmitFd(ppd_file_t *ppd, int fd,
361:extern int          ppdEmitJCL(ppd_file_t *ppd, FILE *fp, int job_id,
364:extern ppd_choice_t *ppdFindMarkedChoice(ppd_file_t *ppd, const char *keyword);
365:extern ppd_option_t *ppdFindOption(ppd_file_t *ppd, const char *keyword);

とゆーわけで、たぶん先程コンパイルエラーが発生した箇所で既に#includeされているべきファイルはこれでいいんでしょうね・w・

問題はなぜこのファイルが#includeされずにコンパイルが進んだのか。

LH-MAIN /tmp/mp640/cnijfilter-source-3.20-1/backend% grep -n "ppd_file_t" src/cnij_backend_common.c
161:    ppd_file_t      *p_ppd;
215:    ppd_file_t      *p_file  ;

ふむ、"ppd_file_t"はここで使っていた、と。で、"cups/ppd.h"は何処に。

LH-MAIN /tmp/mp640/cnijfilter-source-3.20-1/backend% grep -n "<cups/" src/cnij_backend_common.c
39:#include <cups/cups.h>
40:#include <cups/ipp.h>
LH-MAIN /tmp/mp640/cnijfilter-source-3.20-1/backend% head -n50 src/cnij_backend_common.c | tail -n13 
// CUPS Header
#include <cups/cups.h>
#include <cups/ipp.h>

// Header file for CANON
#include "cnij_backend_common.h"
#include "cnij_common_function.h"


/*--------- Prototypes. */
/* _canon_bj() local function */
static void lgmon_sigterm_handler( int ) ;
static int  get_model_name( char * ) ;

どうして "// CUPS Header" とやらで を #include していないんでしょうね・w・ まあ、とりあえずプリンター使いたいだけなのでコードごちゃごちゃ確認とかせずさっさと追記してビルドしてみましょう。

LH-MAIN /tmp/mp640/cnijfilter-source-3.20-1/backend% cp src/cnij_backend_common.c src/cnij_backend_common.c.orz
LH-MAIN /tmp/mp640/cnijfilter-source-3.20-1/backend% vim src/cnij_backend_common.c

っぱっち。

LH-MAIN /tmp/mp640/cnijfilter-source-3.20-1/backend% diff -u src/cnij_backend_common.c.orz src/cnij_backend_common.c
--- src/cnij_backend_common.c.orz       2012-03-06 01:27:19.256584395 +0900
+++ src/cnij_backend_common.c   2012-03-06 01:28:01.138811908 +0900
@@ -38,6 +38,7 @@
 // CUPS Header
 #include <cups/cups.h>
 #include <cups/ipp.h>
+#include <cups/ppd.h>
 
 // Header file for CANON
 #include "cnij_backend_common.h"
LH-MAIN /tmp/mp640/cnijfilter-source-3.20-1/backend% make

あっさり終わったよ…。こんだけかい=w=
さあ次。

記事が長くなりすぎたのか下書き保存したらこっからごっそり消えた欝。
次の記事へ続く、とかにしよう。