hack/trouble_shooting

fossil 컴파일 에러 수정

envi 2011. 8. 27. 18:42
SQLite 를 좀 수정해서 쓸 일이 있어서 repository를 찾아보니 fossil 이라는 듣도못한 잡 DVCS를 쓰고 있었다.
SQLite 개발자가 직접 만든 거 같은데 뭔가 특이하긴 하다. 최근엔 UnQL이란 NoSQL계열 DBMS 도 만드는거 같은데 backend 를 죄다 직접 만들 셈인가 보다.

어쨌거나 Fossil을 쓰려면 미리 만들어진 binary를 쓰거나 직접 컴파일을 해야하는데 직접 컴파일을 할때 2011-07-13 일자 1.18 버젼을 받아서 configure 명령을 치면 아래와 같은 에러가 난다.
Checking for ssl via pkg-config...no
auto.def:77 missing close-bracket
in expression "[check-for-openssl $msg..."
missing close-bracket
in expression "[check-for-openssl $msg..."
(parsing expression "[check-for-openssl $ms...")
invoked from within
"if {[check-for-openssl $msg "$cflags $ldflags"} {
incr found
break
}"
("foreach" body line 11)
invoked from within
"foreach dir $ssldirs {
if {$dir eq ""} {
set msg "system ssl"
set cflags ""
set ldflags ""..."
invoked from within
"if {$ssldirs ne "none"} {
set found 0
if {$ssldirs in {auto ""}} {
catch {
set cflags [exec pkg-config openssl --cflags-on..."
(file "auto.def" line 77)
invoked from within
"source $autosetup(autodef)"
(procedure "main" line 148)
invoked from within
"main $argv"
view raw gistfile1.txt hosted with ❤ by GitHub
이는 auto.def 파일의 문법이 잘못되서 그렇다. 다음과 같은 patch 파일을 만들어 patch한다. 아래를 auto-def-missing-bracket.patch 로 저장한다. 또는 간단한 문법 에러므로 직접 101번째 줄에 ] 가 빠진걸 넣어줘도 된다.
Index: auto.def
===================================================================
--- auto.def
+++ auto.def
@@ -96,11 +96,11 @@
} else {
set msg "ssl in $dir"
set cflags "-I$dir/include"
set ldflags "-L$dir/include"
}
- if {[check-for-openssl $msg "$cflags $ldflags"} {
+ if {[check-for-openssl $msg "$cflags $ldflags"]} {
incr found
break
}
}
}
ADDED autosetup/local.tcl
view raw gistfile1.txt hosted with ❤ by GitHub
다음으로 make install을 하면 옮겨야할 곳의 디렉토리를 생성 안하고 mv 명령을 때리기 때문에 에러가 난다. --prefix 로 /usr/local/stow/fossil 이었을 경우 /usr/local/stow로 이동하여 fossil 과 fossil/bin 을 생성해준다.