머.. 어짜피 samba3 계열의 중간 다리를 하는 버전들이라 설치방법은 3.2.0 과 동일하다.

./samba-3.0.23c/source/ 에서
$ ./autogen.sh
$ export CC=<cross-compile-gcc>
$ ./configure --host=i686
$ make
$ make DESTDIR=<target_root_path> install

근데, 하다보면 에러난다.

Compiling lib/time.c
lib/time.c: In function `GetTimeOfDay':
lib/time.c:60: error: too few arguments to function `gettimeofday'

검색해보니, vi ./samba-3.0.23c/source/lib/time.c 의 60 라인에
gettimeofday(tval); 부분을
gettimeofday(tval,NULL);  이렇게 수정해주면된다.

  55 void GetTimeOfDay(struct timeval *tval)
  56 {
  57 #ifdef HAVE_GETTIMEOFDAY_TZ
  58         gettimeofday(tval,NULL);
  59 #else
  60         gettimeofday(tval);
  61 #endif
  62 }

이런 소스인데, HAVE_GETTIMEOFDAY_TZ 를 다른 곳에서 선언해주면 문제없이 될 듯 하다.


[링크 : http://www.nabble.com/3.0.21a-cross-compiling-%28uClibc%29-for-mipsel-fails-td2450460.html]
Posted by 구차니
삼바를 하면서 고생한게 몇개 있는데..

첫째는 크로스 컴파일시에 --target 옵션 넣으면 안된다는 것과
둘째는 설치 경로를 못잡아서 헤맨 것이다.


일단 삼바가 제대로 설정되었는지 확인하기 위한 testparm툴을 삼바에서 제공한다.
이 녀석을 사용하면 무엇이 잘못되었는지 찾는데 도움이 될 것이다.
[링크 : http://forums.debian.net/viewtopic.php?f=5&t=42082]

나의 경우에는 무리하게 Makefile 을 수정해서 생긴문제였는데
testparm을 하면 아래와 같이 출력되었었다.
# testparm
Load smb config files from /etc/smb.conf
creating default valid table
Loaded services file OK.
ERROR: lock directory /home/morpheuz/st7109/target/var/locks does not exist
ERROR: state directory /home/morpheuz/st7109/target/var/locks does not exist
ERROR: cache directory /home/morpheuz/st7109/target/var/locks does not exist
ERROR: pid directory /home/morpheuz/st7109/target/var/locks does not exist
Server role: ROLE_STANDALONE
Press enter to see a dump of your service definitions

[global]
        netbios name = SMB TEST

Makefile에서
prefix를 /home/morpheuz/st7109/target 으로 했었는데. 이 경우에 컴파일 된 smbd에 저 경로를 이식하는 바람에
타켓 환경에서 엉뚱한 경로를 뒤적이게 되서 이러한 현상이 발생하게 되었다.

이를 해결하기 위해서는
아~~~무런 Makefile 수정없이 아래와 같이 입력하면 된다.

make DESTDIR=/home/morpheuz/st7109/target install

물론 Makefile 내에 DESTDIR이 있지만, 설정상의 문제인지 강제로 저값을 넣어주면
설치중에 엉뚱한 경로가 추가되어 설치에 실패하게 된다.
($(DESTDIR)%(LIBDIR) 사이에 이상하게도 /가 하나더 들어간다 결과적으로
/home/moprheuz/st7109/target//usr/local 경로가 되면서 설치 실패한다.)


아래의 링크는 autoconf의 DESTDIR 과 각종 디렉토리 변수에 대한 gnu 문서이다.
[링크 : http://www.gnu.org/software/autoconf/manual/standards/DESTDIR.html#DESTDIR]
[링크 : http://www.gnu.org/software/autoconf/manual/standards/Directory-Variables.html#Directory-Variables]
Posted by 구차니