vlc-1.0.4$ make
...
/opt/STM/STLinux-2.2/devkit/sh4/lib/gcc/sh4-linux/4.1.1/../../../../sh4-linux/bin/ld: warning: libvlccore.so.2, needed by ../src/.libs/libvlc.so, not found (try using -rpath or -rpath-link)
vlc.o: In function `main':
vlc.c:(.text+0x2e0): undefined reference to `FromLocale'
vlc.c:(.text+0x30c): undefined reference to `LocaleFree'
../src/.libs/libvlc.so: undefined reference to `input_Control'
../src/.libs/libvlc.so: undefined reference to `vlc_cond_broadcast'
../src/.libs/libvlc.so: undefined reference to `vlc_gettext'
../src/.libs/libvlc.so: undefined reference to `playlist_Status'
../src/.libs/libvlc.so: undefined reference to `module_get_name'
../src/.libs/libvlc.so: undefined reference to `var_GetChecked'
../src/.libs/libvlc.so: undefined reference to `input_item_IsPreparsed'
../src/.libs/libvlc.so: undefined reference to `vlc_event_detach'
../src/.libs/libvlc.so: undefined reference to `vlc_object_find_name'
../src/.libs/libvlc.so: undefined reference to `vlc_hold'
../src/.libs/libvlc.so: undefined reference to `__vlc_object_detach'
../src/.libs/libvlc.so: undefined reference to `__var_TriggerCallback'
../src/.libs/libvlc.so: undefined reference to `__var_Change'
../src/.libs/libvlc.so: undefined reference to `vlm_Control'
../src/.libs/libvlc.so: undefined reference to `vlc_clone'
../src/.libs/libvlc.so: undefined reference to `vlc_threadvar_get'
../src/.libs/libvlc.so: undefined reference to `vlc_sd_Create'
../src/.libs/libvlc.so: undefined reference to `module_exists'
../src/.libs/libvlc.so: undefined reference to `vlc_threadvar_delete'
../src/.libs/libvlc.so: undefined reference to `osd_ShowTextAbsolute'
../src/.libs/libvlc.so: undefined reference to `playlist_AssertLocked'
../src/.libs/libvlc.so: undefined reference to `playlist_CurrentInput'
../src/.libs/libvlc.so: undefined reference to `libvlc_InternalDestroy'
../src/.libs/libvlc.so: undefined reference to `__var_Set'
../src/.libs/libvlc.so: undefined reference to `vlc_mutex_destroy'
../src/.libs/libvlc.so: undefined reference to `__vlc_object_release'
../src/.libs/libvlc.so: undefined reference to `__var_Type'
../src/.libs/libvlc.so: undefined reference to `input_GetItem'
../src/.libs/libvlc.so: undefined reference to `__msg_Generic'
../src/.libs/libvlc.so: undefined reference to `mdate'
../src/.libs/libvlc.so: undefined reference to `module_list_free'
../src/.libs/libvlc.so: undefined reference to `__config_PutPsz'
../src/.libs/libvlc.so: undefined reference to `vlc_cond_init'
../src/.libs/libvlc.so: undefined reference to `playlist_Lock'
../src/.libs/libvlc.so: undefined reference to `__input_item_NewExt'
../src/.libs/libvlc.so: undefined reference to `__var_AddCallback'
../src/.libs/libvlc.so: undefined reference to `input_Stop'
../src/.libs/libvlc.so: undefined reference to `vlc_release'
../src/.libs/libvlc.so: undefined reference to `libvlc_InternalCleanup'
../src/.libs/libvlc.so: undefined reference to `VLC_Compiler'
../src/.libs/libvlc.so: undefined reference to `module_get_object'
../src/.libs/libvlc.so: undefined reference to `input_Start'
../src/.libs/libvlc.so: undefined reference to `__vlc_thread_join'
../src/.libs/libvlc.so: undefined reference to `__aout_VolumeMute'
../src/.libs/libvlc.so: undefined reference to `vlc_sd_Start'
../src/.libs/libvlc.so: undefined reference to `libvlc_InternalInit'
../src/.libs/libvlc.so: undefined reference to `VLC_Version'
../src/.libs/libvlc.so: undefined reference to `vout_ShowTextAbsolute'
../src/.libs/libvlc.so: undefined reference to `services_discovery_EventManager'
../src/.libs/libvlc.so: undefined reference to `__var_Create'
../src/.libs/libvlc.so: undefined reference to `__vlm_New'
../src/.libs/libvlc.so: undefined reference to `vlc_cond_destroy'
../src/.libs/libvlc.so: undefined reference to `__aout_VolumeSet'
../src/.libs/libvlc.so: undefined reference to `vlc_threadvar_create'
../src/.libs/libvlc.so: undefined reference to `__aout_VolumeGet'
../src/.libs/libvlc.so: undefined reference to `playlist_PreparseEnqueue'
../src/.libs/libvlc.so: undefined reference to `config_FindConfig'
../src/.libs/libvlc.so: undefined reference to `playlist_AskForArtEnqueue'
../src/.libs/libvlc.so: undefined reference to `services_discovery_GetLocalizedName'
../src/.libs/libvlc.so: undefined reference to `__var_Destroy'
../src/.libs/libvlc.so: undefined reference to `playlist_CurrentPlayingItem'
../src/.libs/libvlc.so: undefined reference to `playlist_Unlock'
../src/.libs/libvlc.so: undefined reference to `input_item_AddOption'
../src/.libs/libvlc.so: undefined reference to `vlc_threadvar_set'
../src/.libs/libvlc.so: undefined reference to `vlc_mutex_init'
../src/.libs/libvlc.so: undefined reference to `vlc_mutex_init_recursive'
../src/.libs/libvlc.so: undefined reference to `vlc_join'
../src/.libs/libvlc.so: undefined reference to `module_list_get'
../src/.libs/libvlc.so: undefined reference to `__vlc_object_hold'
../src/.libs/libvlc.so: undefined reference to `var_SetChecked'
../src/.libs/libvlc.so: undefined reference to `__config_PutInt'
../src/.libs/libvlc.so: undefined reference to `playlist_Clear'
../src/.libs/libvlc.so: undefined reference to `vlc_mutex_lock'
../src/.libs/libvlc.so: undefined reference to `vout_GetSnapshot'
../src/.libs/libvlc.so: undefined reference to `__input_Create'
../src/.libs/libvlc.so: undefined reference to `__vlc_event_attach'
../src/.libs/libvlc.so: undefined reference to `vlm_Delete'
../src/.libs/libvlc.so: undefined reference to `__input_Read'
../src/.libs/libvlc.so: undefined reference to `__var_Get'
../src/.libs/libvlc.so: undefined reference to `vlc_sd_Stop'
../src/.libs/libvlc.so: undefined reference to `libvlc_InternalCreate'
../src/.libs/libvlc.so: undefined reference to `vlc_cond_wait'
../src/.libs/libvlc.so: undefined reference to `playlist_DeleteFromInput'
../src/.libs/libvlc.so: undefined reference to `input_item_GetDuration'
../src/.libs/libvlc.so: undefined reference to `__vlc_object_find'
../src/.libs/libvlc.so: undefined reference to `input_item_GetURI'
../src/.libs/libvlc.so: undefined reference to `module_provides'
../src/.libs/libvlc.so: undefined reference to `vlc_mutex_unlock'
../src/.libs/libvlc.so: undefined reference to `libvlc_InternalWait'
../src/.libs/libvlc.so: undefined reference to `playlist_ItemGetByInputId'
../src/.libs/libvlc.so: undefined reference to `playlist_Control'
../src/.libs/libvlc.so: undefined reference to `msg_Subscribe'
../src/.libs/libvlc.so: undefined reference to `msg_Unsubscribe'
../src/.libs/libvlc.so: undefined reference to `playlist_AddExt'
../src/.libs/libvlc.so: undefined reference to `input_item_GetMeta'
../src/.libs/libvlc.so: undefined reference to `__var_DelCallback'
../src/.libs/libvlc.so: undefined reference to `config_GetUserDataDir'
../src/.libs/libvlc.so: undefined reference to `vlc_cond_signal'
../src/.libs/libvlc.so: undefined reference to `vlc_cancel'
../src/.libs/libvlc.so: undefined reference to `libvlc_InternalAddIntf'
collect2: ld returned 1 exit status
이런식으로 오류가 발생한다.
아무튼, Makefile의 문제로, 1.0.5 에는 버그 수정이 되었다고 한다.
Try to modify bin/Makefile. It works for me. vlc_LDADD = ../src/libvlc.la `$(VLC_CONFIG) -libs vlc` $(am__append_2)
change to vlc_LDADD = ../src/libvlccore.la ../src/libvlc.la `$(VLC_CONFIG) -libs vlc` $(am__append_2)
$ vi configure.ac 1621 dnl 1622 dnl Special arch tuning 1623 dnl 1624 AC_ARG_WITH(tuning, 1625 [ --with-tuning=ARCH enable special tuning for an architecture 1626 (default Pentium 2 on IA-32 and G4 on PPC)]) 1627 if test -n "${with_tuning}"; then 1628 if test "${with_tuning}" != "no"; then 1629 CFLAGS_TUNING="-mtune=${with_tuning}" 1630 fi 1631 else 1632 if test "${SYS}" = "darwin" -a "${host_cpu}" != "powerpc"; then 1633 CFLAGS_TUNING="-march=pentium-m -mtune=prescott" 1634 elif test "${host_cpu}" = "i686" -o "${host_cpu}" = "i586" -o "${host_cpu}" = "i486" -o "${host_cpu}" = "i386"; then 1635 CFLAGS_TUNING="-mtune=pentium2" 1636 elif test "${host_cpu}" = "x86_64"; then 1637 CFLAGS_TUNING="-mtune=athlon64" 1638 elif test "${host_cpu}" = "powerpc"; then 1639 CFLAGS_TUNING="-mtune=G4"; 1640 fi 1641 fi
그리고 ubuntu 에서 sudo vlc 하면
$ sudo vlc
VLC is not supposed to be run as root. Sorry. If you need to use real-time priorities and/or privileged TCP ports
you can use vlc-wrapper (make sure it is Set-UID root and cannot be run by non-trusted users first).
라는 메시지가 출력되면서 실행되지 않는다. busybox나 대부분의 embeded 에서는 root로 할테니
크로스 컴파일 시에 root로 실행가능하도록 수정하고 (--enable-run-as-root)
cpu 최적화 부분을 꺼준다음 (--disable-mmx --disable-sse --with-tuning=no)
크로스 컴파일 되서 돌아갈 host를 지정해준다. (--host=sh4-linux)
좀 특이한(?) 점인데 --host=HOST_ARCH(==i686) --target=TARGET_ARCH(==sh4-linux)
처럼 입력이 되는게 아니라 host는 프로그램이 돌아갈 플랫폼을 의미한다.
즉, 일반적인 크로스 컴파일 옵션의 host, target 옵션이 바뀌어 build, host 로 인식한다.
$ ./configure --help
System types: --build=BUILD configure for building on BUILD [guessed] --host=HOST cross-compile to build programs to run on HOST [BUILD]
이렇게 find에 -name 옵션으로 파일을 지정하고(makefile 혹은 Makefile)
grep 옵션에 -w (Whole word matching) 으로 한정을 해주면 된다.
2010.02.04 추가
위의 예제는 "= gcc" 라고 들어있는 부분을 전체가 포함된 내용을 찾아 "= sh4-linux-gcc"로 변경해주는 것이다.
예를 들어 "= gcc3" 이런식으로 된 곳은 grep -w 옵션에 의해 무시된다.
그리고 tags 파일을 피하기 위해 find ./ -name Makefile 로 makefile에서만 수정을 하도록 제한한다.
'laststatus' 'ls' number (default 1) global {not in Vi} The value of this option influences when the last window will have a status line: 0: never 1: only if there are at least two windows 2: always The screen looks nicer with a status line if you have several windows, but it takes another screen line. |status-line|
#if 문이라던가 각종 전처리기용 문구들은
여러가지 확장을 통해서 컴파일을 하기 때문에 source insight 등의 힘을 빌려도 분석하기 어려운 면이 있다.
일반적으로 컴파일러는 전처리기 - 컴파일 - 어셈블 - 링크 과정을 거치는데(아마도?)
전처리기 까지만 거친 결과를 stdout 으로 출력해준다.
$ man gcc
-E Stop after the preprocessingstage; do not run the compiler proper.
The output is in the form of preprocessed source code, which is sent to the standard output.
Input files which don't require preprocessing are ignored.