| 287 | |
| 288 | === rebuild after libraries were installed === |
| 289 | * mitty@precise:~/openwrt/trunk/package/utvpn$ make clean |
| 290 | * mitty@precise:~/openwrt/trunk/package/utvpn$ make CC=mips-openwrt-linux-gcc LD=mips-openwrt-linux-ld |
| 291 | {{{ |
| 292 | |
| 293 | mips-openwrt-linux-gcc tmp/as/Ham.a -O2 -fsigned-char -lm -ldl -lrt -lpthread -lssl -lcrypto -lreadline -lncurses -lz -o output/ham/ham |
| 294 | tmp/as/Ham.a(Internat.o): In function `IconvWideToStrInternal': |
| 295 | Internat.c:(.text+0x634): undefined reference to `iconv_open' |
| 296 | Internat.c:(.text+0x648): undefined reference to `iconv_open' |
| 297 | tmp/as/Ham.a(Internat.o): In function `IconvStrToWideInternal': |
| 298 | Internat.c:(.text+0x66c): undefined reference to `iconv_open' |
| 299 | Internat.c:(.text+0x680): undefined reference to `iconv_open' |
| 300 | tmp/as/Ham.a(Internat.o): In function `IconvFreeInternal': |
| 301 | Internat.c:(.text+0x690): undefined reference to `iconv_close' |
| 302 | tmp/as/Ham.a(Internat.o): In function `UnixUniToStr': |
| 303 | Internat.c:(.text+0x7b0): undefined reference to `iconv' |
| 304 | tmp/as/Ham.a(Internat.o): In function `InitInternational': |
| 305 | Internat.c:(.text+0xb68): undefined reference to `iconv_close' |
| 306 | Internat.c:(.text+0xbcc): undefined reference to `iconv_close' |
| 307 | tmp/as/Ham.a(Internat.o): In function `UnixStrToUni': |
| 308 | Internat.c:(.text+0x37e4): undefined reference to `iconv' |
| 309 | collect2: ld returned 1 exit status |
| 310 | make: *** [output/ham/ham] Error 1 |
| 311 | }}} |
| 312 | |
| 313 | === make install iconv === |
| 314 | * mitty@precise:~/openwrt$ wget http://ftp.gnu.org/pub/gnu/libiconv/libiconv-1.14.tar.gz |
| 315 | * mitty@precise:~/openwrt/libiconv-1.14$ CC=mips-openwrt-linux-gcc ./configure --prefix=$STAGING_DIR --host=mips-openwrt-linux |
| 316 | * mitty@precise:~/openwrt/libiconv-1.14$ make |
| 317 | * mitty@precise:~/openwrt/libiconv-1.14$ make install |
| 318 | |
| 319 | * mitty@precise:~/openwrt/trunk/package/utvpn$ make clean |
| 320 | * mitty@precise:~/openwrt/trunk/package/utvpn$ make CC=mips-openwrt-linux-gcc LD=mips-openwrt-linux-ld |
| 321 | {{{ |
| 322 | |
| 323 | mips-openwrt-linux-gcc tmp/as/Ham.a -O2 -fsigned-char -lm -ldl -lrt -lpthread -lssl -lcrypto -lreadline -lncurses -lz -o output/ham/ham |
| 324 | tmp/as/Ham.a(Internat.o): In function `IconvWideToStrInternal': |
| 325 | Internat.c:(.text+0x634): undefined reference to `iconv_open' |
| 326 | |
| 327 | (snip) |
| 328 | }}} |
| 329 | |
| 330 | === fix source === |
| 331 | * mitty@precise:~/openwrt/trunk/package/utvpn$ vim src/Mayaqua/Mayaqua.h |
| 332 | {{{#!diff |
| 333 | Index: src/Mayaqua/Mayaqua.h |
| 334 | =================================================================== |
| 335 | --- src/Mayaqua/Mayaqua.h (revision 147) |
| 336 | +++ src/Mayaqua/Mayaqua.h (working copy) |
| 337 | @@ -221,6 +221,8 @@ |
| 338 | //#include <curses.h> |
| 339 | |
| 340 | #ifdef UNIX_LINUX |
| 341 | +#include <iconv.h> |
| 342 | +/* |
| 343 | typedef void *iconv_t; |
| 344 | iconv_t iconv_open (__const char *__tocode, __const char *__fromcode); |
| 345 | size_t iconv (iconv_t __cd, char **__restrict __inbuf, |
| 346 | @@ -228,6 +230,7 @@ |
| 347 | char **__restrict __outbuf, |
| 348 | size_t *__restrict __outbytesleft); |
| 349 | int iconv_close (iconv_t __cd); |
| 350 | +*/ |
| 351 | #else // UNIX_LINUX |
| 352 | #include <iconv.h> |
| 353 | #endif // UNIX_LINUX |
| 354 | }}} |
| 355 | * mitty@precise:~/openwrt/trunk/package/utvpn$ vim Makefile |
| 356 | {{{#!diff |
| 357 | Index: Makefile |
| 358 | =================================================================== |
| 359 | --- Makefile (revision 147) |
| 360 | +++ Makefile (working copy) |
| 361 | @@ -27,16 +27,16 @@ |
| 362 | |
| 363 | OPTIONS_COMPILE_DEBUG=-D_DEBUG -DDEBUG -DUNIX -DUNIX_LINUX -D_REENTRANT -DREENTRANT -D_THREAD_SAFE -D_THREADSAFE -DTHREAD_SAFE -DTHREADSAFE -I./src/ -I./src/Cedar/ -I./src/Mayaqua/ -g -fsigned-char |
| 364 | |
| 365 | -OPTIONS_LINK_DEBUG=-g -fsigned-char -lm -ldl -lrt -lpthread -lssl -lcrypto -lreadline -lncurses -lz |
| 366 | +OPTIONS_LINK_DEBUG=-g -fsigned-char -lm -ldl -lrt -lpthread -lssl -lcrypto -lreadline -lncurses -lz -liconv |
| 367 | |
| 368 | OPTIONS_COMPILE_RELEASE=-DNDEBUG -DVPN_SPEED -DUNIX -DUNIX_LINUX -D_REENTRANT -DREENTRANT -D_THREAD_SAFE -D_THREADSAFE -DTHREAD_SAFE -DTHREADSAFE -I./src/ -I./src/Cedar/ -I./src/Mayaqua/ -O2 -fsigned-char |
| 369 | |
| 370 | -OPTIONS_LINK_RELEASE=-O2 -fsigned-char -lm -ldl -lrt -lpthread -lssl -lcrypto -lreadline -lncurses -lz |
| 371 | +OPTIONS_LINK_RELEASE=-O2 -fsigned-char -lm -ldl -lrt -lpthread -lssl -lcrypto -lreadline -lncurses -lz -liconv |
| 372 | |
| 373 | -INSTALL_BINDIR=/usr/bin/ |
| 374 | -INSTALL_UTVPNSERVER_DIR=/usr/utvpnserver/ |
| 375 | -INSTALL_UTVPNCLIENT_DIR=/usr/utvpnclient/ |
| 376 | -INSTALL_UTVPNCMD_DIR=/usr/utvpncmd/ |
| 377 | +INSTALL_BINDIR=$(PREFIX)/usr/bin/ |
| 378 | +INSTALL_UTVPNSERVER_DIR=$(PREFIX)/usr/utvpnserver/ |
| 379 | +INSTALL_UTVPNCLIENT_DIR=$(PREFIX)/usr/utvpnclient/ |
| 380 | +INSTALL_UTVPNCMD_DIR=$(PREFIX)/usr/utvpncmd/ |
| 381 | |
| 382 | ifeq ($(DEBUG),YES) |
| 383 | OPTIONS_COMPILE=$(OPTIONS_COMPILE_DEBUG) |
| 384 | @@ -307,6 +307,7 @@ |
| 385 | @mkdir -p $(INSTALL_UTVPNSERVER_DIR) |
| 386 | cp output/utvpnserver/hamcore.utvpn $(INSTALL_UTVPNSERVER_DIR)hamcore.utvpn |
| 387 | cp output/utvpnserver/utvpnserver $(INSTALL_UTVPNSERVER_DIR)utvpnserver |
| 388 | + @mkdir -p $(INSTALL_BINDIR) |
| 389 | echo "#!/bin/sh" > $(INSTALL_BINDIR)utvpnserver |
| 390 | echo $(INSTALL_UTVPNSERVER_DIR)utvpnserver '"$$@"' >> $(INSTALL_BINDIR)utvpnserver |
| 391 | echo 'exit $$?' >> $(INSTALL_BINDIR)utvpnserver |
| 392 | @@ -317,6 +318,7 @@ |
| 393 | cp output/utvpnclient/hamcore.utvpn $(INSTALL_UTVPNCLIENT_DIR)hamcore.utvpn |
| 394 | cp output/utvpnclient/utvpnclient $(INSTALL_UTVPNCLIENT_DIR)utvpnclient |
| 395 | echo "#!/bin/sh" > $(INSTALL_BINDIR)utvpnclient |
| 396 | + @mkdir -p $(INSTALL_BINDIR) |
| 397 | echo $(INSTALL_UTVPNCLIENT_DIR)utvpnclient '"$$@"' >> $(INSTALL_BINDIR)utvpnclient |
| 398 | echo 'exit $$?' >> $(INSTALL_BINDIR)utvpnclient |
| 399 | chmod 755 $(INSTALL_BINDIR)utvpnclient |
| 400 | @@ -325,6 +327,7 @@ |
| 401 | @mkdir -p $(INSTALL_UTVPNCMD_DIR) |
| 402 | cp output/utvpncmd/hamcore.utvpn $(INSTALL_UTVPNCMD_DIR)hamcore.utvpn |
| 403 | cp output/utvpncmd/utvpncmd $(INSTALL_UTVPNCMD_DIR)utvpncmd |
| 404 | + @mkdir -p $(INSTALL_BINDIR) |
| 405 | echo "#!/bin/sh" > $(INSTALL_BINDIR)utvpncmd |
| 406 | echo $(INSTALL_UTVPNCMD_DIR)utvpncmd '"$$@"' >> $(INSTALL_BINDIR)utvpncmd |
| 407 | echo 'exit $$?' >> $(INSTALL_BINDIR)utvpncmd |
| 408 | }}} |
| 409 | * mitty@precise:~/openwrt/trunk/package/utvpn$ make CC=mips-openwrt-linux-gcc LD=mips-openwrt-linux-ld |
| 410 | |
| 411 | * mitty@precise:~/openwrt/trunk/package/utvpn$ make install PREFIX=~/tmp |
| 412 | {{{ |
| 413 | cp output/utvpnserver/hamcore.utvpn /home/mitty/tmp/usr/utvpnserver/hamcore.utvpn |
| 414 | cp output/utvpnserver/utvpnserver /home/mitty/tmp/usr/utvpnserver/utvpnserver |
| 415 | echo "#!/bin/sh" > /home/mitty/tmp/usr/bin/utvpnserver |
| 416 | echo /home/mitty/tmp/usr/utvpnserver/utvpnserver '"$@"' >> /home/mitty/tmp/usr/bin/utvpnserver |
| 417 | echo 'exit $?' >> /home/mitty/tmp/usr/bin/utvpnserver |
| 418 | chmod 755 /home/mitty/tmp/usr/bin/utvpnserver |
| 419 | cp output/utvpnclient/hamcore.utvpn /home/mitty/tmp/usr/utvpnclient/hamcore.utvpn |
| 420 | cp output/utvpnclient/utvpnclient /home/mitty/tmp/usr/utvpnclient/utvpnclient |
| 421 | echo "#!/bin/sh" > /home/mitty/tmp/usr/bin/utvpnclient |
| 422 | echo /home/mitty/tmp/usr/utvpnclient/utvpnclient '"$@"' >> /home/mitty/tmp/usr/bin/utvpnclient |
| 423 | echo 'exit $?' >> /home/mitty/tmp/usr/bin/utvpnclient |
| 424 | chmod 755 /home/mitty/tmp/usr/bin/utvpnclient |
| 425 | cp output/utvpncmd/hamcore.utvpn /home/mitty/tmp/usr/utvpncmd/hamcore.utvpn |
| 426 | cp output/utvpncmd/utvpncmd /home/mitty/tmp/usr/utvpncmd/utvpncmd |
| 427 | echo "#!/bin/sh" > /home/mitty/tmp/usr/bin/utvpncmd |
| 428 | echo /home/mitty/tmp/usr/utvpncmd/utvpncmd '"$@"' >> /home/mitty/tmp/usr/bin/utvpncmd |
| 429 | echo 'exit $?' >> /home/mitty/tmp/usr/bin/utvpncmd |
| 430 | chmod 755 /home/mitty/tmp/usr/bin/utvpncmd |
| 431 | |
| 432 | -------------------------------------------------------------------- |
| 433 | Installation completed successfully. |
| 434 | |
| 435 | Please execute 'utvpnserver start' to run UT-VPN Server Background Service. |
| 436 | Or please execute 'utvpnclient start' to run UT-VPN Client Background Service. |
| 437 | And please execute 'utvpncmd' to run UT-VPN Command-Line Utility to configure UT-Server or UT-VPN Client. |
| 438 | -------------------------------------------------------------------- |
| 439 | }}} |
| 440 | |
| 441 | * mitty@precise:~$ mv tmp utvpn-unix-v101-7101-public.mips |
| 442 | * mitty@precise:~$ tar czf utvpn-unix-v101-7101-public.mips.tar.gz utvpn-unix-v101-7101-public.mips |
| 443 | |
| 444 | * mitty@starseed:~/utvpn-unix-v101-7101-public.mips/usr/utvpncmd$ ./utvpncmd |
| 445 | {{{ |
| 446 | Bus error |
| 447 | }}} |
| 448 | * うまく動かない |
| 449 | * [http://wiki.livedoor.jp/taiki_kondo/d/UT-VPN/Debian UT-VPN/Debian - 判ってるよねWiki - livedoor Wiki(ウィキ)] |
| 450 | * [http://blog.falconsrv.net/2012/05/ut-vpnubuntu-1204.html Falcon’s Diary: UT-VPNのビルド方法(Ubuntu 12.04)] |