2012년 11월 20일 화요일

mingw 로 qrencode dll 빌드



http://fukuchi.org/works/qrencode/index.html.en

./configure
make
make install

qrencode 를 mingw + msys 로 dll 빌드시 계속 static 라이브러리만 생성됨.
ubuntu 에서는 정상적으로 so 파일 생성.

구글링해보니 약간의 패치가 옵션조정이 필요함.
pthread 라이브러리 링크에 문제가 있는 것으로 보임.
pthread  static 라이브러를 링크해볼려고 했으나 mingw 의 pthread static 라이브러리에 문제가 있는 것 같음.

http://lrn.no-ip.info/other/mingw/mingw32/qrencode/3.3.1-2/

Makefile.in 에서 다음줄을 찾아서  -no-undefined 추가.
libqrencode_la_LDFLAGS = -version-number $(MAJOR_VERSION):$(MINOR_VERSION):$(MICRO_VERSION)
libqrencode_la_LDFLAGS = -version-number $(MAJOR_VERSION):$(MINOR_VERSION):$(MICRO_VERSION) -no-undefined
다시 빌드.
make clean
./configure --without-tools --disable-thread-safety
make
mae install
./libs 폴더에 dll 이 생성된 것을 볼 수가 있음.
thread safe 하지 않으므로 lock 은 알아서 잘 해야 될 것 같음.