拡張子 | アイコン | Finderの表示 |
---|---|---|
.a | ![]() |
書類 |
.la | ![]() |
UNIX実行ファイル |
拡張子 | アイコン | Finderの表示 |
---|---|---|
libmp3lame.0.0.0.dylib | ![]() |
UNIX実行ファイル |
libmp3lame.0.dylib | ![]() |
エイリアス(オリジナルは.0.0.0.dylib) |
libmp3lame.a | ![]() |
書類 |
libmp3lame.dylib | ![]() |
エイリアス(オリジナルは.0.0.0.dylib) |
libmp3lame.la | ![]() |
UNIX実行ファイル |
$ which otoolXcodeとX11は入れてある。gccは4.0.1(たしかintel対応一発目)。
/usr/bin/otool
$ otoolなにやら深そうな単語が並ぶ。
Usage: otool [-fahlLDtdorSTMRIHvVcXm] <object file> ...
-f print the fat headers
-a print the archive header
-h print the mach header
-l print the load commands
-L print shared libraries used /*使われているシェアードライブラリを表示*/
-D print shared library id name
-t print the text section (disassemble with -v)
-p <routine name> start dissassemble from routine name
-s <segname> <sectname> print contents of section
-d print the data section
-o print the Objective-C segment
-r print the relocation entries
-S print the table of contents of a library
-T print the table of contents of a dynamic shared library
-M print the module table of a dynamic shared library
-R print the reference table of a dynamic shared library
-I print the indirect symbol table
-H print the two-level hints table
-v print verbosely (symbolicly) when possible
-V print disassembled operands symbolicly
-c print argument strings of a core file
-X print no leading addresses or headers
-m don't use archive(member) syntax
$ otool -L /usr/local/bin/mplayer続いてMEncoder
/usr/local/bin/mplayer:
/usr/X11R6/lib/libXext.6.dylib (compatibility version 6.4.0, current version 6.4.0)
/usr/X11R6/lib/libX11.6.dylib (compatibility version 6.2.0, current version 6.2.0)
/usr/X11R6/lib/libXv.1.dylib (compatibility version 1.0.0, current version 1.0.0)
/usr/X11R6/lib/libXinerama.1.dylib (compatibility version 1.0.0, current version 1.0.0)
/usr/X11R6/lib/libXxf86vm.1.dylib (compatibility version 1.0.0, current version 1.0.0)
/usr/local/lib/libSDL-1.2.0.dylib (compatibility version 8.0.0, current version 8.2.0)
/System/Library/Frameworks/Cocoa.framework/Versions/A/Cocoa (compatibility version 1.0.0, current version 11.0.0)
/System/Library/Frameworks/OpenGL.framework/Versions/A/OpenGL (compatibility version 1.0.0, current version 1.0.0)
/System/Library/Frameworks/OpenAL.framework/Versions/A/OpenAL (compatibility version 1.0.0, current version 1.0.0)
/usr/local/lib/libfaac.0.dylib (compatibility version 1.0.0, current version 1.0.0)
/usr/local/lib/libmp3lame.0.dylib (compatibility version 1.0.0, current version 1.0.0)
/usr/local/lib/libiconv.2.dylib (compatibility version 6.0.0, current version 6.0.0)
/usr/lib/libncurses.5.4.dylib (compatibility version 5.4.0, current version 5.4.0)
/System/Library/Frameworks/Carbon.framework/Versions/A/Carbon (compatibility version 2.0.0, current version 128.0.0)
/System/Library/Frameworks/QuickTime.framework/Versions/A/QuickTime (compatibility version 1.0.0, current version 6.0.0)
/System/Library/Frameworks/CoreAudio.framework/Versions/A/CoreAudio (compatibility version 1.0.0, current version 1.0.0)
/System/Library/Frameworks/AudioUnit.framework/Versions/A/AudioUnit (compatibility version 1.0.0, current version 1.0.0)
/System/Library/Frameworks/AudioToolbox.framework/Versions/A/AudioToolbox (compatibility version 1.0.0, current version 1.0.0)
/System/Library/Frameworks/QuartzCore.framework/Versions/A/QuartzCore (compatibility version 1.2.0, current version 1.4.9)
/usr/local/lib/libpng.3.dylib (compatibility version 3.0.0, current version 3.0.0)
/usr/lib/libz.1.dylib (compatibility version 1.0.0, current version 1.2.3)
/usr/local/lib/libjpeg.62.dylib (compatibility version 63.0.0, current version 63.0.0)
/usr/local/lib/libungif.4.dylib (compatibility version 6.0.0, current version 6.0.0)
/System/Library/Frameworks/IOKit.framework/Versions/A/IOKit (compatibility version 1.0.0, current version 275.0.0)
/usr/X11R6/lib/libfreetype.6.dylib (compatibility version 6.3.0, current version 6.3.0)
/usr/X11R6/lib/libfontconfig.1.dylib (compatibility version 1.0.0, current version 1.0.0)
/usr/local/lib/libmad.0.dylib (compatibility version 3.0.0, current version 3.1.0)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 88.1.7)
$ otool -L /usr/local/bin/mencoderただ、手許のシステムはいろいろぐちゃぐちゃな筈なのでこのまま先進む前にシステムを入れ替えたほうが良いだろう。
/usr/local/bin/mencoder:
/usr/local/lib/libfaac.0.dylib (compatibility version 1.0.0, current version 1.0.0)
/usr/local/lib/libmp3lame.0.dylib (compatibility version 1.0.0, current version 1.0.0)
/usr/local/lib/libiconv.2.dylib (compatibility version 6.0.0, current version 6.0.0)
/usr/lib/libncurses.5.4.dylib (compatibility version 5.4.0, current version 5.4.0)
/System/Library/Frameworks/Carbon.framework/Versions/A/Carbon (compatibility version 2.0.0, current version 128.0.0)
/System/Library/Frameworks/QuickTime.framework/Versions/A/QuickTime (compatibility version 1.0.0, current version 6.0.0)
/System/Library/Frameworks/CoreAudio.framework/Versions/A/CoreAudio (compatibility version 1.0.0, current version 1.0.0)
/System/Library/Frameworks/AudioUnit.framework/Versions/A/AudioUnit (compatibility version 1.0.0, current version 1.0.0)
/System/Library/Frameworks/AudioToolbox.framework/Versions/A/AudioToolbox (compatibility version 1.0.0, current version 1.0.0)
/System/Library/Frameworks/Cocoa.framework/Versions/A/Cocoa (compatibility version 1.0.0, current version 11.0.0)
/System/Library/Frameworks/QuartzCore.framework/Versions/A/QuartzCore (compatibility version 1.2.0, current version 1.4.9)
/System/Library/Frameworks/OpenGL.framework/Versions/A/OpenGL (compatibility version 1.0.0, current version 1.0.0)
/usr/local/lib/libpng.3.dylib (compatibility version 3.0.0, current version 3.0.0)
/usr/lib/libz.1.dylib (compatibility version 1.0.0, current version 1.2.3)
/usr/local/lib/libjpeg.62.dylib (compatibility version 63.0.0, current version 63.0.0)
/usr/local/lib/libungif.4.dylib (compatibility version 6.0.0, current version 6.0.0)
/System/Library/Frameworks/IOKit.framework/Versions/A/IOKit (compatibility version 1.0.0, current version 275.0.0)
/usr/X11R6/lib/libfreetype.6.dylib (compatibility version 6.3.0, current version 6.3.0)
/usr/X11R6/lib/libfontconfig.1.dylib (compatibility version 1.0.0, current version 1.0.0)
/usr/local/lib/libmad.0.dylib (compatibility version 3.0.0, current version 3.1.0)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 88.1.7)
cvs -d:pserver:anonymous@gpac.cvs.sourceforge.net:/cvsroot/gpac loginパスワードは何も入れずにリターンで通る。
cvs -z3 -d:pserver:anonymous@gpac.cvs.sourceforge.net:/cvsroot/gpac co -P gpac
$ cd ~/gpacアクセス権が無いと言う。良く解らないので全部アクセス権を与える。
$ ./configure --help
-bash: ./configure: Permission denied
chmod a+x *ヘルプが出た。
$ ./configure --helpとりあえずそのまま./configure。
Usage: configure [options]
Options: [defaults in brackets after descriptions]
GPAC configuration options:
--help print this message
--prefix=PREFIX install in PREFIX [/usr/local]
--mandir=DIR man documentation in DIR [PREFIX/man]
--source-path=PATH path of source code []
--cross-prefix=PREFIX use PREFIX for compile tools []
--cc=CC use C compiler CC [gcc]
--make=MAKE use specified make [make]
--extra-cflags=ECFLAGS add ECFLAGS to CFLAGS []
--extra-ldflags=ELDFLAGS add ELDFLAGS to LDFLAGS [ -Wl,--warn-common] /*あとでここで引っかかる事になる*/
--extra-libs=ELIBS add ELIBS []
--cpu=CPU force cpu to CPU [Power Macintosh]
--sdl-cfg=SDL_PATH specify path to sdl-config for local install []
--enable-sdl-static use static SDL linking [default=no]
--X11-path=X11_PATH specify path for X11 includes and libraries [/usr/X11R6]
--dxsdk-path=DX_PATH specify directX SDK for MinGW []
--mozdir=MOZ_PATH specify mozilla main directory path for system install
--enable-debug produce debug version
--enable-gprof enable profiling
--track-memory enables tracking of all memory allocated by gpac
--disable-fragments disable movie fragments in ISO media support
--disable-opt disable GCC optimizations
--disable-ipv6 disable IPV6 support
--disable-wx disable wxWidgets support
--disable-oss-audio disable OSS audio
--disable-x11-shm disable X11 shared memory support
--disable-fragments disable movie fragments in ISO media support
--enable-readonly force ISO media to be read-only
--disable-svg disable SVG support
--enable-fixed-point enable fixed-point math (THIS MODIFIES GPAC MATH.H HEADER)
--force-fixed-point force fixed-point math without changing gpac math.h header
--disable-opengl disable OpenGL support
--disable-ssl disable OpenSSL support
--enable-amr-nb-fixed enable AMR NB fixed-point decoder
--enable-amr-nb enable AMR NB library
--enable-amr-wb enable AMR WB library
--enable-amr enable both AMR NB and WB libraries
Extra libraries configuration. You can turn a libray off or force using the local version in gpac/extra_lib/
--use-js=OPT force SpiderMonkey ECMAScript OPT=[no,local]
--use-ft=OPT force FreeType OPT=[no,local]
--use-jpeg=OPT force JPEG OPT=[no,local]
--use-png=OPT force PNG OPT=[no,local]
--use-faad=OPT force FAAD OPT=[no,local]
--use-mad=OPT force MAD OPT=[no,local]
--use-xvid=OPT force XVID OPT=[no,local]
--use-ffmpeg=OPT force FFMPEG OPT=[no,local]
NOTE: The object files are build at the place where configure is launched
$ ./configureMac OSXという表示が無いのが地味に不安をそそるが、make helpを見ろと言うので見る。
** System Configuration
Install prefix: /usr/local
Source path: /Users/USERNAME/gpac
C compiler: cc
make: make
CPU: powerpc
Big Endian: yes
** GPAC 0.4.3-DEV Core Configuration **
debug version: no
GProf enabled: no
Memory tracking enabled: no
read-only version: no
fixed-point version: no
IPV6 Support: no
IsoMedia MovieFragments support: yes
SVG Support disabled: no
** Detected libraries **
zlib: system
OSS Audio: no
ALSA Audio: no
X11 Shared Memory support: yes (path: /usr/X11R6)
SDL Support: yes /*これはsrcからビルドした記憶がある*/
libXML2: yes
OpenGL support: yes
OpenSSL support: yes
wxWidgets support: Version 253
** Extra Libraries used **
SpiderMonkey: no
FreeType: system
JPEG: system
OpenJPEG: no
PNG: system
MAD: system /*これはsrcからビルドした記憶がある*/
FAAD: system /*これはsrcからビルドした*/
XVID: system /*これもsrcからビルドした*/
FFMPEG: no /*これは成功した事がない*/
Xiph OGG: no
Creating config.mak
Done - type 'make help' for make info, 'make' to build
$ make help欲しいのはmp4boxだけなのだけど、とりあえずmake appsで。
Input to GPAC make:
depend/dep: builds dependencies (dev only)
all (void): builds main library, programs and plugins
lib: builds GPAC library only (libgpac.so)
apps: builds programs only /*たぶんこれでmp4boxなどのツールだけできる*/
modules: builds modules only
instmoz: build and local install of osmozilla
sggen: builds scene graph generators
clean: clean src repository
distclean: clean src repository and host config file
tar: create GPAC tarball
install: install applications and modules on system
uninstall: uninstall applications and modules
install-lib: install gpac library (dyn and static) and headers <gpac/*.h>, <gpac/modules/*.h> and <gpac/internal/*.h>
uninstall-lib: uninstall gpac library (dyn and static) and headers
to build libgpac documentation, go to gpac/doc and type 'doxygen'
$ make appsコケタ。しかも当のmp4boxで。たぶん黄色いとこがエラーだと思う。
make -C applications all
set -e; for i in mp4box mp4client generators osmo4_wx ; do make -C $i all; done
cc -O3 -no-cpp-precomp -pipe -fomit-frame-pointer -fno-common -fno-strict-aliasing -Wno-pointer-sign -Wall -I/Users/USERNAME/gpac/include -c -o main.o main.c
cc -O3 -no-cpp-precomp -pipe -fomit-frame-pointer -fno-common -fno-strict-aliasing -Wno-pointer-sign -Wall -I/Users/USERNAME/gpac/include -c -o filedump.o filedump.c
cc -O3 -no-cpp-precomp -pipe -fomit-frame-pointer -fno-common -fno-strict-aliasing -Wno-pointer-sign -Wall -I/Users/USERNAME/gpac/include -c -o fileimport.o fileimport.c
cc -Wl,--warn-common -read_only_relocs warning -o ../../bin/gcc/MP4Box main.o filedump.o fileimport.o -L../../bin/gcc -lgpac -lz
/usr/bin/ld: unknown flag: --warn-common
collect2: ld returned 1 exit status
make[2]: *** [MP4Box] Error 1
make[1]: *** [apps] Error 2
make: *** [apps] Error 2
NAMEまで読んだ。Mach objectってたしか、Mach-Oとか書くんだよな。マークオブジェクト。タスケテ海上さん。
ld - Mach object file link editor
リンカ 【linker】~/gpac/applications/mp4box/以下はこうなっている。
コンパイラによって変換されたオブジェクトコードに、必要なライブラリなどを付け加えて実行可能ファイルを生成するプログラム。最近はコン パイラにその機能が統合されていることが多い。
C 言語などの高級言語では、プログラマの書いたソースコードをコンパイラで機械語の集合であるオブジェクトコードに変換するが、単に変換し ただけではコン ピュータ上で実行できる形にはならない。リンカはオブジェクトファイルを解析して、参照している他のオブジェクトファイルやライブラリなどを探し出し、必 要なものを結合して実行形式のファイルを作成する。その際、一つのファイルにすべてを結合する方式を静的リンク、実行時に必要に応じて 外部のファイルをメ モリ上に呼び出す方式を動的リンクという。
$ ls拡張子.cがソースコード。ソース落とした段階では拡張子.oのものは無かったから、これがオブジェクトコードというものだろ~。
CVS filedump.c fileimport.c main.c
Makefile filedump.o fileimport.o main.o
-warn_commons (64-bit only)あるじゃん(なんだその微妙な違いは)。
Causes the static linker to write a diagnostic line about how
common symbols were processed. This is useful for debugging
problems with common symbols.
Manpage of ld http://www.linux.or.jp/JM/html/GNU_binutils/man1/ld.1.html
-warn-common
共通シンボルが他の共通シンボルやシンボル定義と結合されている場合に警告を発する。 Unix のリンカはこの点には比較的寛容であるが、他の OS のリンカにはそうでないものもある。このオプションはグローバルシンボルを結合することによって生じる問題点を見つける手がかりになるかもしれない。
なんとなく似たもん同士という印象を受けた。んじゃどっかにある-warn-commonを探して-warn_commons
に書き換えてみるデスだよ。
さてどこでしょお。
~/gpac/Makefile をCotEditorで開いても-warn-commonはおろかldも無い。ここぢゃない。
~/gpac/applications/mp4box/Makefile も同様。むむむ。しかし一行目にinclude
../../config.makと書いてある、、、怪しいぞキサマッ!
二つ上二つ上、、、居た。
-warn_commonsに書き換えて、もっかいmake apps。
$ make appsぢゃ抜いちゃえ。
make -C applications all
set -e; for i in mp4box mp4client generators osmo4_wx ; do make -C $i all; done
cc -Wl,-warn_commons -read_only_relocs warning -o ../../bin/gcc/MP4Box main.o filedump.o fileimport.o -L../../bin/gcc -lgpac -lz
/usr/bin/ld: unknown flag: -warn_commons
collect2: ld returned 1 exit status
make[2]: *** [MP4Box] Error 1
make[1]: *** [apps] Error 2
make: *** [apps] Error 2
$ make appsなんか全然違うらしい。cc -wl, なんたらって書いてあるから、ccのオプション書式なのかな。cc…Cコンパイラ?
make -C applications all
set -e; for i in mp4box mp4client generators osmo4_wx ; do make -C $i all; done
cc -Wl,-read_only_relocs warning -o ../../bin/gcc/MP4Box main.o filedump.o fileimport.o -L../../bin/gcc -lgpac -lz
powerpc-apple-darwin8-gcc-4.0.1: warning: No such file or directory
make[2]: *** [MP4Box] Error 1
make[1]: *** [apps] Error 2
make: *** [apps] Error 2
Linker Optionsありやんの。
object-file-name -llibrary -no-c++filt (APPLE ONLY) -nostartfiles
-nodefaultlibs -nostdlib -pie -s -static -static-libgcc -shared
-shared-libgcc -symbolic -Wl,option -Xlinker option -u symbol
Manpage of GCC http://www.linux.or.jp/JM/html/GNU_gcc/man1/gcc.1.htmlではman ccにもどってずりずりとスクロールしていくと(なんか飛ぶ方法があると思うが)、
-Wl,option
オプション option をリンカに渡します。option がコンマを含む場合は、それらのコンマで複数のオプションとして分割されます。
-Wl,optionいやそのオプションが知りたいんすけど?むー。
Pass option as an option to the linker. If option contains commas,
it is split into multiple options at the commas.
--extra-ldflags=ELDFLAGS add ELDFLAGS to LDFLAGS [ -Wl,--warn-common]ってあるな。ぢゃ、-Wl,--warn-commonを消してみっか。
$ make apps……………取りあえず、一歩進んだという印象を受けた。
make -C applications all
set -e; for i in mp4box mp4client generators osmo4_wx ; do make -C $i all; done
cc -read_only_relocs warning -o ../../bin/gcc/MP4Box main.o filedump.o fileimport.o -L../../bin/gcc -lgpac -lz
/usr/bin/ld: can't locate file for: -lgpac
collect2: ld returned 1 exit status
make[2]: *** [MP4Box] Error 1
make[1]: *** [apps] Error 2
make: *** [apps] Error 2