前回までにPlamoBuildスクリプトの基本的な使い方を紹介しました。今回は、
設定オプションの指定
ソースコードに必要な設定を施すconfigureスクリプトは、
オプション引数には、
どのようなオプション引数が使用可能かはconfigure --helpで確認できます。前回までに紹介してきたfluxboxの場合、
$ ./configure --help | cat -n .... 76 --enable-regexp regular expression support (default=yes) 77 --enable-slit include code for the Slit (default=yes) 78 --enable-systray include SystemTray (default=yes) 79 --enable-toolbar include Toolbar (default=yes) 80 --enable-ewmh enable support for Extended Window Manager Hints 81 (default=yes) 82 --enable-debug include verbose debugging code (default=no) 83 --enable-test build programs used in testing fluxbox (default=no) 84 --enable-nls include native language support (default=yes) 85 --enable-timedcache use new timed pixmap cache (default=yes) 86 --enable-xmb XMB (multibyte font, utf-8) support (default=yes) 87 --disable-imlib2 disable imlib2 support 88 --disable-xft disable xft support 89 --disable-freetype2 disable freetype2 support 90 --disable-xrender disable xrender support 91 --disable-xpm disable xpm support 92 --disable-xinerama disable xinerama support 93 --disable-xext disable Misc X Extension Library support 94 --disable-xrandr disable xrandr support 95 --disable-fribidi disable fribidi support ...
各引数はそれぞれどのような機能を追加、
一方、
PlamoBuildスクリプトではconfigureに渡す引数はヘッダ部のOPT_
9 OPT_CONFIG="--enable-xmb=no --disable-fribidi"
この設定は、
設定オプションの虎の巻
紹介してきたfluxbox-1.
設定オプションに悩んだ時は、
LFS
一方、
取りあげてきたfluxboxの場合、
Arch Linuxで指定している各オプションの意味は何だろう、
主要ディストリビューションであるRedHat/
なお、
configure以外への対応
make_
たとえば、
54 cd $B
55 export PKG_CONFIG_PATH=/usr/${libdir}/pkgconfig:/usr/share/pkgconfig:/opt/lxqt/${libdir}/pkgconfig
56 export LDFLAGS='-Wl,--as-needed'
57 cmake -DCMAKE_INSTALL_PREFIX:PATH=/usr ${OPT_CONFIG[$i]} $S
58
cmakeコマンドはconfigureと同じように、
Perl用のソフトウェアが採用しているMakefile.
一方、
47 cd $B
48 for patch in $patchfiles ; do
49 patch -p1 50 done
51
52 python setup.py config
53
...
58 fi
59
60 if [ $opt_build -eq 1 ] ; then
61 cd $B
62 python setup.py build
...
67 fi
68
69 if [ $opt_package -eq 1 ] ; then
70 check_root
71 if [ -d $P ] ; then rm -rf $P ; fi ; mkdir -p $P
72 cd $B
73 python setup.py install --root $P
74
これら4種のビルドシステムはmake_
適切な設定方法が見つからない場合
make_
この場合、
これらのうち

FDcloneの最新版はftp.
$ wget ftp://ftp.unixusers.net/src/fdclone/FD-3.01h.tar.gz $ tar xvf FD-3.01h.tar.gz $ ls FD-3.01h/ FD-3.01h.tar.gz
次に、
$ make_PlamoBuild.py -u ftp://ftp.unixusers.net/src/fdclone/FD-3.01h.tar.gz FD-3.01h cannot find proper configure methods. PlamoBuild script is setup for configure, but you should adjust build script manually
このままでは、
$ ./PlamoBuild.FD-3.01h ./PlamoBuild.FD-3.01h: 行 59: /home/kojima/Srcs/FD-3.01h/configure: そのようなファイルやディレクトリはありません configure error. ./PlamoBuild.FD-3.01h script stop
一方、
$ ls FD-3.01h ... Makefile command.c fd_e.cat kanjicnv.c malloc.c pathname.c string.h url.c Makefile.in config.hin fd_e.man kconv.c malloc.h pathname.h sysemu.c url.h README custom.c file.c kconv.h mkcat.c posixsh.c sysemu.h urldisk.c ... $ cd FD-3.01h $ make echo '1,/^$/d' > hmachine.sed sed -n -e 's:machine.h:hmachine.h:g' -e '1,/^$/p' machine.h > hmachine.h sed -f hmachine.sed machine.h >> hmachine.h cp config.hin config.h cc -DPREFIX='"'/usr/local'"' -DCONFDIR='"'/etc'"' -DDICTSRC='"''''"' -DFD=3 -DCCCOMMAND='"'cc'"' -DHOSTCCCOMMAND='"'cc'"' -DCFLAGS='"''''"' -DHOSTCFLAGS='"''''"' -DCPPFLAGS='"''''"' -DHOSTCPPFLAGS='"''''"' -DLDFLAGS='"''''"' -DHOSTLDFLAGS='"''''"' -o mkmfsed mkmfsed.c ...
Makefileが用意されているなら直接ビルドできるのかな、
$ ./PlamoBuild.FD-3.01h build make: *** ターゲットが指定されておらず, makefile も見つかりません. 中止. build error. ./PlamoBuild.FD-3.01h script stop
このトラブルは、
元のビルドスクリプトの設定部分はこうなっていました。
41 if [ $opt_config -eq 1 ] ; then
42 ######################################################################
43 # out of tree build. patch apply in src dir
44 ######################################################################
45 if [ -d $B ] ; then rm -rf $B ; fi ; mkdir -p $B
46 cd $S
47 for patch in $patchfiles ; do
48 if [ ! -f .${patch} ]; then
49 patch -p1 50 touch .${patch}
51 fi
52 done
53 # if [ -f autogen.sh ] ; then
54 # sh ./autogen.sh
55 # fi
56 cd $B
57 export PKG_CONFIG_PATH=/usr/lib/pkgconfig:/usr/share/pkgconfig
58 export LDFLAGS='-Wl,--as-needed'
59 $S/configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var --mandir='${prefix}'/share/man ${OPT_CONFIG}
60 if [ $? != 0 ]; then
61 echo "configure error. $0 script stop"
62 exit 255
63 fi
64 fi
このコードの$Bがビルド作業用ディレクトリ
41 if [ $opt_config -eq 1 ] ; then
42 ######################################################################
43 # in source tree build. patch apply in build dir
44 ######################################################################
45 if [ -d $B ] ; then rm -rf $B ; fi ; cp -a $S $B
46 cd $B
47 for patch in $patchfiles ; do
48 if [ ! -f .${patch} ]; then
49 patch -p1 50 touch .${patch}
51 fi
52 done
53 opt_build=1
54 echo "no need to config, proceed to build"
55 fi
少し43行目のコメントも直していますが、
configureは不要なので削除し、
$ ./PlamoBuild.FD-3.01h no need to config, proceed to build make -f Makefile.tmp make[1]: ディレクトリ '/tmp/build' に入ります cc -DLINUX=1 -O -D_FILE_OFFSET_BITS=64 -Wno-empty-body -Wno-shift-negative-value -DFD=3 -c -o printf.o printf.c ...
しかしながら、
Do you want to package as root? [y/N] make BUILD= -f Makefile.tmp install ... install: 通常ファイル '/usr/local/bin/fd-unicd.tbl' を作成できません: 許可がありません chmod: '/usr/local/bin/fd-unicd.tbl' にアクセスできません: そのようなファイルやディレクトリはありません make[1]: [Makefile.tmp:486: install-table] エラー 1 (無視されました) ...
このエラーは、
"make install DESTDIR=..."はインストール先を変更するための指定ですが、
インストール先をどう指定するかはMakefile等を調べる必要があり、
72 export LDFLAGS='-Wl,--as-needed'
73 make install PREFIX=$P/usr
PlamoBuildスクリプトは"config"オプションを指定した際にビルド用ディレクトリが初期化されるようになっています。逆に言うと、
$ ./PlamoBuild.FD-3.01h package Do you want to package as root? [y/N] make BUILD= -f Makefile.tmp install make[1]: ディレクトリ '/tmp/build' に入ります if [ -f fd-unicd.tbl ]; then \ [ -d /home/kojima/Srcs/F/FDclone/work/usr/bin ] || ./mkdir_p /home/kojima/Srcs/F/FDclone/work/usr/bin; \ install -c fd-unicd.tbl /home/kojima/Srcs/F/FDclone/work/usr/bin; \ chmod a+r-x /home/kojima/Srcs/F/FDclone/work/usr/bin/fd-unicd.tbl; \ fi ... pruning symlink in /home/kojima/Srcs/F/FDclone/work/usr/share/man/man9 pruning symlink in /home/kojima/Srcs/F/FDclone/work/usr/share/man/mann basename:FD version:3.01h arch:x86_64 build:B1 ext:txz
上記の"make install PREFIX=$P/
$ ls -l 合計 1,429,504 drwxr-xr-x 1 kojima users 2,452 8月 11日 00:00 FD-3.01h/ -rw-r--r-- 1 kojima users 463,872 12月 20日 23:37 FD-3.01h-x86_64-B1.txz -rw-r--r-- 1 kojima users 957,354 12月 20日 15:24 FD-3.01h.tar.gz -rwxr-xr-x 1 kojima users 2,914 12月 20日 21:46 PlamoBuild.FD-3.01h* drwxr-xr-x 1 kojima users 6 12月 20日 23:37 work/
必要なファイル類が正しく収められているのを確認すれば、
今回取りあげたFDcloneのように、
しかしながら、