|
組み込みLinux技術情報TOPページ PlusG再ビルド手順書 †セルフコンパイル環境環境の構築 †環境
セルフコンパイル環境の準備(DirectFBの導入) †再ビルドに必要な依存パッケージのインストール # apt-get build-dep libdirectfb-dev DirectFBソース入手および展開 †$ wget http://www.directfb.org/downloads/Old/DirectFB-1.0.0.tar.gz (※ 2007/10/25 現在の最新は DirectFB-1.1.0.tar.gz です) $ tar xzfv DirectFB-1.0.0.tar.gz $ cd DirectFB-1.0.0 DirectFBコンフィグ及びMake、インストール †$ ./configure \ --disable-sdl --with-gfxdrivers=none $ make (SH4でセルフの場合、landy1で36分) $ su Password: rootユーザパスワードを入力 # make install この結果、 /usr/local 以下に DirectFB のライブラリとヘッダーがインストールされる。 /usr/local/ |-- bin |-- games |-- include | |-- directfb | | |-- direct | | `-- fusion | | `-- shm | `-- directfb-internal | |-- core | |-- display | |-- fbdev | |-- gfx | | `-- generic | |-- input | |-- media | |-- misc | `-- windows |-- lib | |-- directfb-1.0-0 | | |-- inputdrivers | | |-- interfaces | | | |-- IDirectFBFont | | | |-- IDirectFBImageProvider | | | `-- IDirectFBVideoProvider | | |-- systems | | `-- wm | `-- pkgconfig |-- man |-- sbin |-- share | |-- directfb-1.0.0 | |-- fonts | `-- man | |-- man1 | `-- man5 `-- src 以上で PlusG をコンパイルする環境準備が整った。 PlusGのセルフコンパイル †PlusGライブラリソースの展開 †$ tar xzfv plusg0915-src.tar.gz $ cd plusg PlusGライブラリのMake †$ make ready $ make make の ready はショートカットの作成とmkdirをしています。 クロスとセルフのobjを別々のフォルダに置く為の処理です。 開発環境へのPlusGライブラリのインストール †$ su Password: rootユーザパスワードを入力 # make install (make install で失敗するときは、Makefileの install: 行の下の各コマンドの頭に- を挿入する) install: -cp *.h /usr/local/include/plusg -rm /usr/local/lib/libplusg.so.0.9 -cp obj/$(OUTPUT) /usr/local/lib -ln -s $(OUTPUT) /usr/local/lib/libplusg.so.0.9 -rm /usr/sh4-linux/lib/libplusg.so -cp sh4-linux-obj/$(OUTPUT) /usr/sh4-linux/lib -ln -s $(OUTPUT) /usr/sh4-linux/lib/libplusg.so installの結果 /usr/local/lib/libplusg.so.0.9 -> libplusg.so.0.9.15 /usr/local/lib/libplusg.so.0.9.15 /usr/local/include/plusg/ |-- orgpalette.h |-- palkintou.h |-- palregular.h |-- palwindows.h |-- sgapplication.h |-- sgcore.h |-- sgdialog.h |-- sggraphics.h |-- sgimage.h |-- sglib.h `-- sgobject.h のようになる PlusGライブラリは /usr/local/lib/ にインストールされるため、PlusGライブラリとリンクされたアプリケーションを実行するには環境変数 LD_LIBRARY_PATH を設定する必要がある $ export LD_LIBRARY_PATH=/usr/local/lib/ 実行機(ターゲットマシン:HDD,CF,SDカード等)への PlusG のインストール †開発機とターゲット機が両方とも同じアーキテクチャ (Intel i386 PC) であれば、ターゲット機の /usr/local/lib に以下のファイルが存在すればよい。(開発機の /usr/local/lib からコピーする) /usr/local/lib/ libdirect-1.0.so.0 -> libdirect-1.0.so.0.0.0 libdirect-1.0.so.0.0.0 libdirect.so -> libdirect-1.0.so.0.0.0 libdirectfb-1.0.so.0 -> libdirectfb-1.0.so.0.0.0 libdirectfb-1.0.so.0.0.0 libdirectfb.so -> libdirectfb-1.0.so.0.0.0 libfusion-1.0.so.0 -> libfusion-1.0.so.0.0.0 libfusion-1.0.so.0.0.0 libfusion.so -> libfusion-1.0.so.0.0.0 libplusg.so.0.9 -> libplusg.so.0.9.15 libplusg.so.0.9.15 クロスコンパイル †SH4やARM等のクロスコンパイル環境を準備する。 DirectFB のクロス版ライブラリの準備 †DirectFBのコンパイルまではSH4やARMの実機(sh-debian や arm-debian等で)行っておく。あらかじめ作った SH4版の DirectFB-1.0.0 を → directfb-1.0.0_sh4.tgz におく。 directfb-1.0.0_sh4.tgz を開発環境のルート位置で展開する 開発PC # cd / 開発PC # tar xzvf directfb-1.0.0_sh4.tgz 展開されるファイル構成は以下のとおり usr/ usr/sh4-linux/ usr/sh4-linux/bin/ usr/sh4-linux/bin/directfb-csource usr/sh4-linux/bin/dfbdump usr/sh4-linux/bin/dfbg usr/sh4-linux/bin/dfbinfo usr/sh4-linux/bin/dfbinput usr/sh4-linux/bin/dfblayer usr/sh4-linux/bin/dfbscreen usr/sh4-linux/bin/dfbsummon usr/sh4-linux/bin/dfbpenmount usr/sh4-linux/bin/mkdfiff usr/sh4-linux/bin/mkdgiff usr/sh4-linux/bin/directfb-config usr/sh4-linux/include/ usr/sh4-linux/include/directfb/ usr/sh4-linux/include/directfb/directfb.h usr/sh4-linux/include/directfb/directfb_keyboard.h usr/sh4-linux/include/directfb/directfb_keynames.h usr/sh4-linux/include/directfb/directfb_strings.h usr/sh4-linux/include/directfb/directfb_util.h usr/sh4-linux/include/directfb/directfb_version.h usr/sh4-linux/include/directfb/directfbgl.h usr/sh4-linux/include/directfb/dfb_types.h usr/sh4-linux/include/directfb/dfiff.h usr/sh4-linux/include/directfb/dgiff.h usr/sh4-linux/include/directfb/direct/ usr/sh4-linux/include/directfb/direct/build.h usr/sh4-linux/include/directfb/direct/clock.h usr/sh4-linux/include/directfb/direct/conf.h usr/sh4-linux/include/directfb/direct/debug.h usr/sh4-linux/include/directfb/direct/direct.h usr/sh4-linux/include/directfb/direct/hash.h usr/sh4-linux/include/directfb/direct/interface.h usr/sh4-linux/include/directfb/direct/interface_implementation.h usr/sh4-linux/include/directfb/direct/list.h usr/sh4-linux/include/directfb/direct/log.h usr/sh4-linux/include/directfb/direct/mem.h usr/sh4-linux/include/directfb/direct/memcpy.h usr/sh4-linux/include/directfb/direct/messages.h usr/sh4-linux/include/directfb/direct/modules.h usr/sh4-linux/include/directfb/direct/serial.h usr/sh4-linux/include/directfb/direct/signals.h usr/sh4-linux/include/directfb/direct/stream.h usr/sh4-linux/include/directfb/direct/system.h usr/sh4-linux/include/directfb/direct/thread.h usr/sh4-linux/include/directfb/direct/trace.h usr/sh4-linux/include/directfb/direct/tree.h usr/sh4-linux/include/directfb/direct/types.h usr/sh4-linux/include/directfb/direct/utf8.h usr/sh4-linux/include/directfb/direct/util.h usr/sh4-linux/include/directfb/fusion/ usr/sh4-linux/include/directfb/fusion/shm/ usr/sh4-linux/include/directfb/fusion/shm/pool.h usr/sh4-linux/include/directfb/fusion/shm/shm.h usr/sh4-linux/include/directfb/fusion/shm/shm_internal.h usr/sh4-linux/include/directfb/fusion/arena.h usr/sh4-linux/include/directfb/fusion/build.h usr/sh4-linux/include/directfb/fusion/call.h usr/sh4-linux/include/directfb/fusion/conf.h usr/sh4-linux/include/directfb/fusion/fusion.h usr/sh4-linux/include/directfb/fusion/fusion_internal.h usr/sh4-linux/include/directfb/fusion/hash.h usr/sh4-linux/include/directfb/fusion/lock.h usr/sh4-linux/include/directfb/fusion/object.h usr/sh4-linux/include/directfb/fusion/property.h usr/sh4-linux/include/directfb/fusion/reactor.h usr/sh4-linux/include/directfb/fusion/ref.h usr/sh4-linux/include/directfb/fusion/shmalloc.h usr/sh4-linux/include/directfb/fusion/types.h usr/sh4-linux/include/directfb/fusion/vector.h usr/sh4-linux/include/directfb-internal/ usr/sh4-linux/include/directfb-internal/core/ usr/sh4-linux/include/directfb-internal/core/clipboard.h usr/sh4-linux/include/directfb-internal/core/colorhash.h usr/sh4-linux/include/directfb-internal/core/coredefs.h usr/sh4-linux/include/directfb-internal/core/coretypes.h usr/sh4-linux/include/directfb-internal/core/core_parts.h usr/sh4-linux/include/directfb-internal/core/core_system.h usr/sh4-linux/include/directfb-internal/core/core.h usr/sh4-linux/include/directfb-internal/core/fonts.h usr/sh4-linux/include/directfb-internal/core/gfxcard.h usr/sh4-linux/include/directfb-internal/core/graphics_driver.h usr/sh4-linux/include/directfb-internal/core/input.h usr/sh4-linux/include/directfb-internal/core/input_driver.h usr/sh4-linux/include/directfb-internal/core/layer_context.h usr/sh4-linux/include/directfb-internal/core/layer_control.h usr/sh4-linux/include/directfb-internal/core/layer_region.h usr/sh4-linux/include/directfb-internal/core/layers.h usr/sh4-linux/include/directfb-internal/core/layers_internal.h usr/sh4-linux/include/directfb-internal/core/palette.h usr/sh4-linux/include/directfb-internal/core/screen.h usr/sh4-linux/include/directfb-internal/core/screens.h usr/sh4-linux/include/directfb-internal/core/screens_internal.h usr/sh4-linux/include/directfb-internal/core/state.h usr/sh4-linux/include/directfb-internal/core/surfaces.h usr/sh4-linux/include/directfb-internal/core/surfacemanager.h usr/sh4-linux/include/directfb-internal/core/system.h usr/sh4-linux/include/directfb-internal/core/windows.h usr/sh4-linux/include/directfb-internal/core/windows_internal.h usr/sh4-linux/include/directfb-internal/core/windowstack.h usr/sh4-linux/include/directfb-internal/core/wm.h usr/sh4-linux/include/directfb-internal/core/wm_module.h usr/sh4-linux/include/directfb-internal/display/ usr/sh4-linux/include/directfb-internal/display/idirectfbpalette.h usr/sh4-linux/include/directfb-internal/display/idirectfbsurface.h usr/sh4-linux/include/directfb-internal/display/idirectfbsurface_layer.h usr/sh4-linux/include/directfb-internal/display/idirectfbsurface_window.h usr/sh4-linux/include/directfb-internal/display/idirectfbdisplaylayer.h usr/sh4-linux/include/directfb-internal/display/idirectfbscreen.h usr/sh4-linux/include/directfb-internal/gfx/ usr/sh4-linux/include/directfb-internal/gfx/generic/ usr/sh4-linux/include/directfb-internal/gfx/generic/generic.h usr/sh4-linux/include/directfb-internal/gfx/clip.h usr/sh4-linux/include/directfb-internal/gfx/convert.h usr/sh4-linux/include/directfb-internal/gfx/util.h usr/sh4-linux/include/directfb-internal/input/ usr/sh4-linux/include/directfb-internal/input/idirectfbinputdevice.h usr/sh4-linux/include/directfb-internal/input/idirectfbinputbuffer.h usr/sh4-linux/include/directfb-internal/media/ usr/sh4-linux/include/directfb-internal/media/idirectfbdatabuffer.h usr/sh4-linux/include/directfb-internal/media/idirectfbfont.h usr/sh4-linux/include/directfb-internal/media/idirectfbimageprovider.h usr/sh4-linux/include/directfb-internal/media/idirectfbvideoprovider.h usr/sh4-linux/include/directfb-internal/misc/ usr/sh4-linux/include/directfb-internal/misc/conf.h usr/sh4-linux/include/directfb-internal/misc/gfx_util.h usr/sh4-linux/include/directfb-internal/misc/util.h usr/sh4-linux/include/directfb-internal/windows/ usr/sh4-linux/include/directfb-internal/windows/idirectfbwindow.h usr/sh4-linux/include/directfb-internal/idirectfb.h usr/sh4-linux/include/directfb-internal/fbdev/ usr/sh4-linux/include/directfb-internal/fbdev/fbdev.h usr/sh4-linux/include/directfb-internal/fbdev/fb.h usr/sh4-linux/include/directfb-internal/fbdev/vt.h usr/sh4-linux/include/directfb-internal/fbdev/agp.h usr/sh4-linux/lib/ usr/sh4-linux/lib/libdirect-1.0.so.0.0.0 usr/sh4-linux/lib/libdirect-1.0.so.0 -> libdirect-1.0.so.0.0.0 usr/sh4-linux/lib/libdirect.so -> libdirect-1.0.so.0.0.0 usr/sh4-linux/lib/libdirect.la usr/sh4-linux/lib/pkgconfig/ usr/sh4-linux/lib/pkgconfig/direct.pc usr/sh4-linux/lib/pkgconfig/fusion.pc usr/sh4-linux/lib/pkgconfig/directfb.pc usr/sh4-linux/lib/pkgconfig/directfb-internal.pc usr/sh4-linux/lib/libfusion-1.0.so.0.0.0 usr/sh4-linux/lib/libfusion-1.0.so.0 -> libfusion-1.0.so.0.0.0 usr/sh4-linux/lib/libfusion.so -> libfusion-1.0.so.0.0.0 usr/sh4-linux/lib/libfusion.la usr/sh4-linux/lib/libdirectfb-1.0.so.0.0.0 usr/sh4-linux/lib/libdirectfb-1.0.so.0 -> libdirectfb-1.0.so.0.0.0 usr/sh4-linux/lib/libdirectfb.so -> libdirectfb-1.0.so.0.0.0 usr/sh4-linux/lib/libdirectfb.la usr/sh4-linux/lib/directfb-1.0-0/ usr/sh4-linux/lib/directfb-1.0-0/systems/ usr/sh4-linux/lib/directfb-1.0-0/systems/libdirectfb_fbdev.so usr/sh4-linux/lib/directfb-1.0-0/systems/libdirectfb_fbdev.la usr/sh4-linux/lib/directfb-1.0-0/systems/libdirectfb_sdl.so usr/sh4-linux/lib/directfb-1.0-0/systems/libdirectfb_sdl.la usr/sh4-linux/lib/directfb-1.0-0/inputdrivers/ usr/sh4-linux/lib/directfb-1.0-0/inputdrivers/libdirectfb_sdlinput.so usr/sh4-linux/lib/directfb-1.0-0/inputdrivers/libdirectfb_sdlinput.la usr/sh4-linux/lib/directfb-1.0-0/inputdrivers/libdirectfb_joystick.so usr/sh4-linux/lib/directfb-1.0-0/inputdrivers/libdirectfb_joystick.la usr/sh4-linux/lib/directfb-1.0-0/inputdrivers/libdirectfb_keyboard.so usr/sh4-linux/lib/directfb-1.0-0/inputdrivers/libdirectfb_keyboard.la usr/sh4-linux/lib/directfb-1.0-0/inputdrivers/libdirectfb_linux_input.so usr/sh4-linux/lib/directfb-1.0-0/inputdrivers/libdirectfb_linux_input.la usr/sh4-linux/lib/directfb-1.0-0/inputdrivers/libdirectfb_lirc.so usr/sh4-linux/lib/directfb-1.0-0/inputdrivers/libdirectfb_lirc.la usr/sh4-linux/lib/directfb-1.0-0/inputdrivers/libdirectfb_ps2mouse.so usr/sh4-linux/lib/directfb-1.0-0/inputdrivers/libdirectfb_ps2mouse.la usr/sh4-linux/lib/directfb-1.0-0/inputdrivers/libdirectfb_serialmouse.so usr/sh4-linux/lib/directfb-1.0-0/inputdrivers/libdirectfb_serialmouse.la usr/sh4-linux/lib/directfb-1.0-0/inputdrivers/libdirectfb_mutouch.so usr/sh4-linux/lib/directfb-1.0-0/inputdrivers/libdirectfb_mutouch.la usr/sh4-linux/lib/directfb-1.0-0/inputdrivers/libdirectfb_penmount.so usr/sh4-linux/lib/directfb-1.0-0/inputdrivers/libdirectfb_penmount.la usr/sh4-linux/lib/directfb-1.0-0/inputdrivers/libdirectfb_sonypi.so usr/sh4-linux/lib/directfb-1.0-0/inputdrivers/libdirectfb_sonypi.la usr/sh4-linux/lib/directfb-1.0-0/inputdrivers/libdirectfb_wm97xx_ts.so usr/sh4-linux/lib/directfb-1.0-0/inputdrivers/libdirectfb_wm97xx_ts.la usr/sh4-linux/lib/directfb-1.0-0/wm/ usr/sh4-linux/lib/directfb-1.0-0/wm/libdirectfbwm_default.so usr/sh4-linux/lib/directfb-1.0-0/wm/libdirectfbwm_default.la usr/sh4-linux/lib/directfb-1.0-0/interfaces/ usr/sh4-linux/lib/directfb-1.0-0/interfaces/IDirectFBFont/ usr/sh4-linux/lib/directfb-1.0-0/interfaces/IDirectFBFont/libidirectfbfont_default.so usr/sh4-linux/lib/directfb-1.0-0/interfaces/IDirectFBFont/libidirectfbfont_default.la usr/sh4-linux/lib/directfb-1.0-0/interfaces/IDirectFBFont/libidirectfbfont_dgiff.so usr/sh4-linux/lib/directfb-1.0-0/interfaces/IDirectFBFont/libidirectfbfont_dgiff.la usr/sh4-linux/lib/directfb-1.0-0/interfaces/IDirectFBFont/libidirectfbfont_ft2.so usr/sh4-linux/lib/directfb-1.0-0/interfaces/IDirectFBFont/libidirectfbfont_ft2.la usr/sh4-linux/lib/directfb-1.0-0/interfaces/IDirectFBImageProvider/ usr/sh4-linux/lib/directfb-1.0-0/interfaces/IDirectFBImageProvider/libidirectfbimageprovider_dfiff.so usr/sh4-linux/lib/directfb-1.0-0/interfaces/IDirectFBImageProvider/libidirectfbimageprovider_dfiff.la usr/sh4-linux/lib/directfb-1.0-0/interfaces/IDirectFBImageProvider/libidirectfbimageprovider_mpeg2.so usr/sh4-linux/lib/directfb-1.0-0/interfaces/IDirectFBImageProvider/libidirectfbimageprovider_mpeg2.la usr/sh4-linux/lib/directfb-1.0-0/interfaces/IDirectFBImageProvider/libidirectfbimageprovider_gif.so usr/sh4-linux/lib/directfb-1.0-0/interfaces/IDirectFBImageProvider/libidirectfbimageprovider_gif.la usr/sh4-linux/lib/directfb-1.0-0/interfaces/IDirectFBImageProvider/libidirectfbimageprovider_jpeg.so usr/sh4-linux/lib/directfb-1.0-0/interfaces/IDirectFBImageProvider/libidirectfbimageprovider_jpeg.la usr/sh4-linux/lib/directfb-1.0-0/interfaces/IDirectFBImageProvider/libidirectfbimageprovider_png.so usr/sh4-linux/lib/directfb-1.0-0/interfaces/IDirectFBImageProvider/libidirectfbimageprovider_png.la usr/sh4-linux/lib/directfb-1.0-0/interfaces/IDirectFBVideoProvider/ usr/sh4-linux/lib/directfb-1.0-0/interfaces/IDirectFBVideoProvider/libidirectfbvideoprovider_v4l.so usr/sh4-linux/lib/directfb-1.0-0/interfaces/IDirectFBVideoProvider/libidirectfbvideoprovider_v4l.la usr/sh4-linux/lib/directfb-1.0-0/interfaces/IDirectFBVideoProvider/libidirectfbvideoprovider_gif.so usr/sh4-linux/lib/directfb-1.0-0/interfaces/IDirectFBVideoProvider/libidirectfbvideoprovider_gif.la usr/sh4-linux/share/ usr/sh4-linux/share/directfb-1.0.0/ usr/sh4-linux/share/directfb-1.0.0/cursor.dat usr/sh4-linux/share/man/ usr/sh4-linux/share/man/man1/ usr/sh4-linux/share/man/man1/directfb-csource.1 usr/sh4-linux/share/man/man1/dfbg.1 usr/sh4-linux/share/man/man5/ usr/sh4-linux/share/man/man5/directfbrc.5 PlusGライブラリのクロスコンパイル †セルフコンパイルと手順は同じ PlusGライブラリソースの展開 †$ tar xzfv plusg0915-src.tar.gz $ cd plusg Makefile の INCLUDEPATH 変数に -I/usr/sh4-linux/include/directfb/ を追加する。以下Makefileの抜粋 CC = $(CROSS_COMPILE)gcc CXX = $(CROSS_COMPILE)g++ LIBSPATH = -L/usr/local/lib INCLUDESPATH = -I/usr/local/include/directfb -I/usr/sh4-linux/include/directfb/ PlusGライブラリのMake †CROSS_COMPILE=クロスコンパイラ名 をつけてMakeする。 $ make clean $ make CROSS_COMPILE=sh4-linux- ready $ make CROSS_COMPILE=sh4-linux- make の ready はショートカットの作成とmkdirをしています。 クロスとセルフのobjを別々のフォルダに置く為の処理です。 開発環境へのクロスPlusGライブラリのインストール †$ su Password: rootユーザパスワードを入力 # make install (make install で失敗するときは、Makefileの install: 行の下の各コマンドの頭に- を挿入する) install: -cp *.h /usr/local/include/plusg -rm /usr/local/lib/libplusg.so.0.9 -cp obj/$(OUTPUT) /usr/local/lib -ln -s $(OUTPUT) /usr/local/lib/libplusg.so.0.9 -rm /usr/sh4-linux/lib/libplusg.so -cp sh4-linux-obj/$(OUTPUT) /usr/sh4-linux/lib -ln -s $(OUTPUT) /usr/sh4-linux/lib/libplusg.so installの結果 /usr/sh4-linux/lib/libplusg.so.0.9 -> libplusg.so.0.9.15 /usr/sh4-linux/lib/libplusg.so.0.9.15 /usr/local/include/plusg/ |-- orgpalette.h |-- palkintou.h |-- palregular.h |-- palwindows.h |-- sgapplication.h |-- sgcore.h |-- sgdialog.h |-- sggraphics.h |-- sgimage.h |-- sglib.h `-- sgobject.h のようになる PlusGライブラリは /usr/local/lib/ にインストールされるため、PlusGライブラリとリンクされたアプリケーションを実行するには環境変数 LD_LIBRARY_PATH を設定する必要がある $ export LD_LIBRARY_PATH=/usr/local/lib/ 実行機(SH4, ARM 等のターゲットマシン:HDD,CF,SDメディア等)への PlusG のインストール †開発PCの /usr/sh4-linux/lib から以下のファイルをターゲット機の /usr/local/lib にコピーする SH4等ターゲット機の /usr/local/lib/ が以下になるように libdirect-1.0.so.0 -> libdirect-1.0.so.0.0.0 libdirect-1.0.so.0.0.0 libdirect.so -> libdirect-1.0.so.0.0.0 libdirectfb-1.0.so.0 -> libdirectfb-1.0.so.0.0.0 libdirectfb-1.0.so.0.0.0 libdirectfb.so -> libdirectfb-1.0.so.0.0.0 libfusion-1.0.so.0 -> libfusion-1.0.so.0.0.0 libfusion-1.0.so.0.0.0 libfusion.so -> libfusion-1.0.so.0.0.0 libplusg.so.0.9 -> libplusg.so.0.9.15 libplusg.so.0.9.15 関連事項 †
|