Changes between Version 7 and Version 8 of TipAndDoc/Linux/OpenWRT/CrossCompile


Ignore:
Timestamp:
Jun 21, 2012 2:42:59 PM (12 years ago)
Author:
mitty
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • TipAndDoc/Linux/OpenWRT/CrossCompile

    v7 v8  
    285285collect2: ld returned 1 exit status 
    286286}}} 
     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 
     293mips-openwrt-linux-gcc tmp/as/Ham.a -O2 -fsigned-char -lm -ldl -lrt -lpthread -lssl -lcrypto -lreadline -lncurses -lz -o output/ham/ham 
     294tmp/as/Ham.a(Internat.o): In function `IconvWideToStrInternal': 
     295Internat.c:(.text+0x634): undefined reference to `iconv_open' 
     296Internat.c:(.text+0x648): undefined reference to `iconv_open' 
     297tmp/as/Ham.a(Internat.o): In function `IconvStrToWideInternal': 
     298Internat.c:(.text+0x66c): undefined reference to `iconv_open' 
     299Internat.c:(.text+0x680): undefined reference to `iconv_open' 
     300tmp/as/Ham.a(Internat.o): In function `IconvFreeInternal': 
     301Internat.c:(.text+0x690): undefined reference to `iconv_close' 
     302tmp/as/Ham.a(Internat.o): In function `UnixUniToStr': 
     303Internat.c:(.text+0x7b0): undefined reference to `iconv' 
     304tmp/as/Ham.a(Internat.o): In function `InitInternational': 
     305Internat.c:(.text+0xb68): undefined reference to `iconv_close' 
     306Internat.c:(.text+0xbcc): undefined reference to `iconv_close' 
     307tmp/as/Ham.a(Internat.o): In function `UnixStrToUni': 
     308Internat.c:(.text+0x37e4): undefined reference to `iconv' 
     309collect2: ld returned 1 exit status 
     310make: *** [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 
     323mips-openwrt-linux-gcc tmp/as/Ham.a -O2 -fsigned-char -lm -ldl -lrt -lpthread -lssl -lcrypto -lreadline -lncurses -lz -o output/ham/ham 
     324tmp/as/Ham.a(Internat.o): In function `IconvWideToStrInternal': 
     325Internat.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 
     333Index: 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 
     357Index: 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{{{ 
     413cp output/utvpnserver/hamcore.utvpn /home/mitty/tmp/usr/utvpnserver/hamcore.utvpn 
     414cp output/utvpnserver/utvpnserver /home/mitty/tmp/usr/utvpnserver/utvpnserver 
     415echo "#!/bin/sh" > /home/mitty/tmp/usr/bin/utvpnserver 
     416echo /home/mitty/tmp/usr/utvpnserver/utvpnserver '"$@"' >> /home/mitty/tmp/usr/bin/utvpnserver 
     417echo 'exit $?' >> /home/mitty/tmp/usr/bin/utvpnserver 
     418chmod 755 /home/mitty/tmp/usr/bin/utvpnserver 
     419cp output/utvpnclient/hamcore.utvpn /home/mitty/tmp/usr/utvpnclient/hamcore.utvpn 
     420cp output/utvpnclient/utvpnclient /home/mitty/tmp/usr/utvpnclient/utvpnclient 
     421echo "#!/bin/sh" > /home/mitty/tmp/usr/bin/utvpnclient 
     422echo /home/mitty/tmp/usr/utvpnclient/utvpnclient '"$@"' >> /home/mitty/tmp/usr/bin/utvpnclient 
     423echo 'exit $?' >> /home/mitty/tmp/usr/bin/utvpnclient 
     424chmod 755 /home/mitty/tmp/usr/bin/utvpnclient 
     425cp output/utvpncmd/hamcore.utvpn /home/mitty/tmp/usr/utvpncmd/hamcore.utvpn 
     426cp output/utvpncmd/utvpncmd /home/mitty/tmp/usr/utvpncmd/utvpncmd 
     427echo "#!/bin/sh" > /home/mitty/tmp/usr/bin/utvpncmd 
     428echo /home/mitty/tmp/usr/utvpncmd/utvpncmd '"$@"' >> /home/mitty/tmp/usr/bin/utvpncmd 
     429echo 'exit $?' >> /home/mitty/tmp/usr/bin/utvpncmd 
     430chmod 755 /home/mitty/tmp/usr/bin/utvpncmd 
     431 
     432-------------------------------------------------------------------- 
     433Installation completed successfully. 
     434 
     435Please execute 'utvpnserver start' to run UT-VPN Server Background Service. 
     436Or please execute 'utvpnclient start' to run UT-VPN Client Background Service. 
     437And 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{{{ 
     446Bus 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)] 
    287451 == zlib == 
    288452 * [http://www.crosscompile.org/static/pages/ZLib.html How to Cross Compile Zlib Compression Library - Step by Step Guide (crosscompile.org)]