wiki:TipAndDoc/Linux/OpenWRT/CrossCompile/oldmethod

Version 1 (modified by mitty, 12 years ago) (diff)

--

  • 試行錯誤しながらmake installした際の、冗長な手順など

utvpn

  • mitty@precise:~/openwrt/trunk/package$ svn co https://lab.mitty.jp/svn/lab/trunk/Dev/utvpn/utvpn-unix-v101-7101-public utvpn
  • mitty@precise:~/openwrt/trunk/package/utvpn$ ./configure
    -------------------------------------------------------------
    SoftEther UT-VPN for Unix
    
    Copyright (C) 2004-2010 SoftEther Corporation.
    Copyright (C) 2004-2010 University of Tsukuba, Japan.
    Copyright (C) 2003-2010 Daiyuu Nobori. All Rights Reserved.
    
    This program is free software; you can redistribute it and/or
    modify it under the terms of the GNU General Public License
    version 2 as published by the Free Software Foundation.
    -------------------------------------------------------------
    
    Please select your Operating System below:
     1: Linux
     2: FreeBSD
     3: Solaris
     4: Mac OS X
    
    Which is your operating system (1-4):
    1
    
    Please select your CPU Bits below:
     1: 32-bit
     2: 64-bit
    
    Which is the bits of your CPU (1-2):
    1
    
    Makefile is generated. Please execute 'make' to build UT-VPN.
    
  • mitty@precise:~/openwrt/trunk/package/utvpn$ sha1sum Makefile makefiles/linux_32bit_ja.mak
    5d63c1cbb04ef9a3ecc6d4b8f1150cac20fbfa9d  Makefile
    5d63c1cbb04ef9a3ecc6d4b8f1150cac20fbfa9d  makefiles/linux_32bit_ja.mak
    
    • Makefileは単純にcpしているだけ
  • mitty@precise:~/openwrt/trunk/package/utvpn$ svn cp makefiles/linux_32bit_ja.mak Makefile

build with gcc for mips

  • mitty@precise:~/openwrt/trunk/package/utvpn$ export PATH=$PATH:~/openwrt/trunk/staging_dir/toolchain-mips_r2_gcc-4.6-linaro_uClibc-0.9.33.2/bin/
  • mitty@precise:~/openwrt/trunk/package/utvpn$ make CC=mips-openwrt-linux-gcc LD=mips-openwrt-linux-ld
    mips-openwrt-linux-gcc -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 -c src/Mayaqua/Cfg.c -o tmp/objs/Mayaqua/Cfg.o
    mips-openwrt-linux-gcc: warning: environment variable 'STAGING_DIR' not defined
    In file included from src/Mayaqua/Cfg.c:90:0:
    ./src/Mayaqua/Mayaqua.h:219:31: fatal error: readline/readline.h: No such file or directory
    compilation terminated.
    make: *** [tmp/objs/Mayaqua/Cfg.o] Error 1
    
  • mitty@precise:~$ sudo aptitude install -R libssl-dev libreadline-dev libncurses-dev
  • mitty@precise:~/openwrt/trunk/package/utvpn$ export STAGING_DIR=~/openwrt/trunk/staging_dir/toolchain-mips_r2_gcc-4.6-linaro_uClibc-0.9.33.2/
  • mitty@precise:~/openwrt/trunk/package/utvpn$ make CC=mips-openwrt-linux-gcc LD=mips-openwrt-linux-ld
    (snip)
    
    mips-openwrt-linux-gcc tmp/as/Ham.a -O2 -fsigned-char -lm -ldl -lrt -lpthread -lssl -lcrypto -lreadline -lncurses -lz -o output/ham/ham
    /home/mitty/openwrt/trunk/staging_dir/toolchain-mips_r2_gcc-4.6-linaro_uClibc-0.9.33.2/lib/gcc/mips-openwrt-linux-uclibc/4.6.3/../../../../mips-openwrt-linux-uclibc/bin/ld: cannot find -lssl
    /home/mitty/openwrt/trunk/staging_dir/toolchain-mips_r2_gcc-4.6-linaro_uClibc-0.9.33.2/lib/gcc/mips-openwrt-linux-uclibc/4.6.3/../../../../mips-openwrt-linux-uclibc/bin/ld: cannot find -lcrypto
    /home/mitty/openwrt/trunk/staging_dir/toolchain-mips_r2_gcc-4.6-linaro_uClibc-0.9.33.2/lib/gcc/mips-openwrt-linux-uclibc/4.6.3/../../../../mips-openwrt-linux-uclibc/bin/ld: cannot find -lreadline
    /home/mitty/openwrt/trunk/staging_dir/toolchain-mips_r2_gcc-4.6-linaro_uClibc-0.9.33.2/lib/gcc/mips-openwrt-linux-uclibc/4.6.3/../../../../mips-openwrt-linux-uclibc/bin/ld: cannot find -lncurses
    /home/mitty/openwrt/trunk/staging_dir/toolchain-mips_r2_gcc-4.6-linaro_uClibc-0.9.33.2/lib/gcc/mips-openwrt-linux-uclibc/4.6.3/../../../../mips-openwrt-linux-uclibc/bin/ld: cannot find -lz
    collect2: ld returned 1 exit status
    

rebuild after libraries were installed

  • mitty@precise:~/openwrt/trunk/package/utvpn$ make clean
  • mitty@precise:~/openwrt/trunk/package/utvpn$ make CC=mips-openwrt-linux-gcc LD=mips-openwrt-linux-ld
    mips-openwrt-linux-gcc tmp/as/Ham.a -O2 -fsigned-char -lm -ldl -lrt -lpthread -lssl -lcrypto -lreadline -lncurses -lz -o output/ham/ham
    tmp/as/Ham.a(Internat.o): In function `IconvWideToStrInternal':
    Internat.c:(.text+0x634): undefined reference to `iconv_open'
    Internat.c:(.text+0x648): undefined reference to `iconv_open'
    tmp/as/Ham.a(Internat.o): In function `IconvStrToWideInternal':
    Internat.c:(.text+0x66c): undefined reference to `iconv_open'
    Internat.c:(.text+0x680): undefined reference to `iconv_open'
    tmp/as/Ham.a(Internat.o): In function `IconvFreeInternal':
    Internat.c:(.text+0x690): undefined reference to `iconv_close'
    tmp/as/Ham.a(Internat.o): In function `UnixUniToStr':
    Internat.c:(.text+0x7b0): undefined reference to `iconv'
    tmp/as/Ham.a(Internat.o): In function `InitInternational':
    Internat.c:(.text+0xb68): undefined reference to `iconv_close'
    Internat.c:(.text+0xbcc): undefined reference to `iconv_close'
    tmp/as/Ham.a(Internat.o): In function `UnixStrToUni':
    Internat.c:(.text+0x37e4): undefined reference to `iconv'
    collect2: ld returned 1 exit status
    make: *** [output/ham/ham] Error 1
    

make install iconv

  • mitty@precise:~/openwrt$ wget http://ftp.gnu.org/pub/gnu/libiconv/libiconv-1.14.tar.gz
  • mitty@precise:~/openwrt/libiconv-1.14$ CC=mips-openwrt-linux-gcc ./configure --prefix=$STAGING_DIR --host=mips-openwrt-linux
  • mitty@precise:~/openwrt/libiconv-1.14$ make
  • mitty@precise:~/openwrt/libiconv-1.14$ make install
  • mitty@precise:~/openwrt/trunk/package/utvpn$ make clean
  • mitty@precise:~/openwrt/trunk/package/utvpn$ make CC=mips-openwrt-linux-gcc LD=mips-openwrt-linux-ld
    mips-openwrt-linux-gcc tmp/as/Ham.a -O2 -fsigned-char -lm -ldl -lrt -lpthread -lssl -lcrypto -lreadline -lncurses -lz -o output/ham/ham
    tmp/as/Ham.a(Internat.o): In function `IconvWideToStrInternal':
    Internat.c:(.text+0x634): undefined reference to `iconv_open'
    
    (snip)
    

fix source

  • mitty@precise:~/openwrt/trunk/package/utvpn$ vim src/Mayaqua/Mayaqua.h
    • src/Mayaqua/Mayaqua.h

       
      221221//#include <curses.h> 
      222222 
      223223#ifdef  UNIX_LINUX 
       224#include <iconv.h> 
       225/* 
      224226typedef void *iconv_t; 
      225227iconv_t iconv_open (__const char *__tocode, __const char *__fromcode); 
      226228size_t iconv (iconv_t __cd, char **__restrict __inbuf, 
       
      228230                     char **__restrict __outbuf, 
      229231                     size_t *__restrict __outbytesleft); 
      230232int iconv_close (iconv_t __cd); 
       233*/ 
      231234#else   // UNIX_LINUX 
      232235#include <iconv.h> 
      233236#endif  // UNIX_LINUX 
  • mitty@precise:~/openwrt/trunk/package/utvpn$ vim Makefile
    • Makefile

       
      2727 
      2828OPTIONS_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 
      2929 
      30 OPTIONS_LINK_DEBUG=-g -fsigned-char -lm -ldl -lrt -lpthread -lssl -lcrypto -lreadline -lncurses -lz 
       30OPTIONS_LINK_DEBUG=-g -fsigned-char -lm -ldl -lrt -lpthread -lssl -lcrypto -lreadline -lncurses -lz -liconv 
      3131 
      3232OPTIONS_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 
      3333 
      34 OPTIONS_LINK_RELEASE=-O2 -fsigned-char -lm -ldl -lrt -lpthread -lssl -lcrypto -lreadline -lncurses -lz 
       34OPTIONS_LINK_RELEASE=-O2 -fsigned-char -lm -ldl -lrt -lpthread -lssl -lcrypto -lreadline -lncurses -lz -liconv 
      3535 
      36 INSTALL_BINDIR=/usr/bin/ 
      37 INSTALL_UTVPNSERVER_DIR=/usr/utvpnserver/ 
      38 INSTALL_UTVPNCLIENT_DIR=/usr/utvpnclient/ 
      39 INSTALL_UTVPNCMD_DIR=/usr/utvpncmd/ 
       36INSTALL_BINDIR=$(PREFIX)/usr/bin/ 
       37INSTALL_UTVPNSERVER_DIR=$(PREFIX)/usr/utvpnserver/ 
       38INSTALL_UTVPNCLIENT_DIR=$(PREFIX)/usr/utvpnclient/ 
       39INSTALL_UTVPNCMD_DIR=$(PREFIX)/usr/utvpncmd/ 
      4040 
      4141ifeq ($(DEBUG),YES) 
      4242    OPTIONS_COMPILE=$(OPTIONS_COMPILE_DEBUG) 
       
      307307    @mkdir -p $(INSTALL_UTVPNSERVER_DIR) 
      308308    cp output/utvpnserver/hamcore.utvpn $(INSTALL_UTVPNSERVER_DIR)hamcore.utvpn 
      309309    cp output/utvpnserver/utvpnserver $(INSTALL_UTVPNSERVER_DIR)utvpnserver 
       310    @mkdir -p $(INSTALL_BINDIR) 
      310311    echo "#!/bin/sh" > $(INSTALL_BINDIR)utvpnserver 
      311312    echo $(INSTALL_UTVPNSERVER_DIR)utvpnserver '"$$@"' >> $(INSTALL_BINDIR)utvpnserver 
      312313    echo 'exit $$?' >> $(INSTALL_BINDIR)utvpnserver 
       
      317318    cp output/utvpnclient/hamcore.utvpn $(INSTALL_UTVPNCLIENT_DIR)hamcore.utvpn 
      318319    cp output/utvpnclient/utvpnclient $(INSTALL_UTVPNCLIENT_DIR)utvpnclient 
      319320    echo "#!/bin/sh" > $(INSTALL_BINDIR)utvpnclient 
       321    @mkdir -p $(INSTALL_BINDIR) 
      320322    echo $(INSTALL_UTVPNCLIENT_DIR)utvpnclient '"$$@"' >> $(INSTALL_BINDIR)utvpnclient 
      321323    echo 'exit $$?' >> $(INSTALL_BINDIR)utvpnclient 
      322324    chmod 755 $(INSTALL_BINDIR)utvpnclient 
       
      325327    @mkdir -p $(INSTALL_UTVPNCMD_DIR) 
      326328    cp output/utvpncmd/hamcore.utvpn $(INSTALL_UTVPNCMD_DIR)hamcore.utvpn 
      327329    cp output/utvpncmd/utvpncmd $(INSTALL_UTVPNCMD_DIR)utvpncmd 
       330    @mkdir -p $(INSTALL_BINDIR) 
      328331    echo "#!/bin/sh" > $(INSTALL_BINDIR)utvpncmd 
      329332    echo $(INSTALL_UTVPNCMD_DIR)utvpncmd '"$$@"' >> $(INSTALL_BINDIR)utvpncmd 
      330333    echo 'exit $$?' >> $(INSTALL_BINDIR)utvpncmd 
  • mitty@precise:~/openwrt/trunk/package/utvpn$ make CC=mips-openwrt-linux-gcc LD=mips-openwrt-linux-ld
  • mitty@precise:~/openwrt/trunk/package/utvpn$ make install PREFIX=~/tmp
    cp output/utvpnserver/hamcore.utvpn /home/mitty/tmp/usr/utvpnserver/hamcore.utvpn
    cp output/utvpnserver/utvpnserver /home/mitty/tmp/usr/utvpnserver/utvpnserver
    echo "#!/bin/sh" > /home/mitty/tmp/usr/bin/utvpnserver
    echo /home/mitty/tmp/usr/utvpnserver/utvpnserver '"$@"' >> /home/mitty/tmp/usr/bin/utvpnserver
    echo 'exit $?' >> /home/mitty/tmp/usr/bin/utvpnserver
    chmod 755 /home/mitty/tmp/usr/bin/utvpnserver
    cp output/utvpnclient/hamcore.utvpn /home/mitty/tmp/usr/utvpnclient/hamcore.utvpn
    cp output/utvpnclient/utvpnclient /home/mitty/tmp/usr/utvpnclient/utvpnclient
    echo "#!/bin/sh" > /home/mitty/tmp/usr/bin/utvpnclient
    echo /home/mitty/tmp/usr/utvpnclient/utvpnclient '"$@"' >> /home/mitty/tmp/usr/bin/utvpnclient
    echo 'exit $?' >> /home/mitty/tmp/usr/bin/utvpnclient
    chmod 755 /home/mitty/tmp/usr/bin/utvpnclient
    cp output/utvpncmd/hamcore.utvpn /home/mitty/tmp/usr/utvpncmd/hamcore.utvpn
    cp output/utvpncmd/utvpncmd /home/mitty/tmp/usr/utvpncmd/utvpncmd
    echo "#!/bin/sh" > /home/mitty/tmp/usr/bin/utvpncmd
    echo /home/mitty/tmp/usr/utvpncmd/utvpncmd '"$@"' >> /home/mitty/tmp/usr/bin/utvpncmd
    echo 'exit $?' >> /home/mitty/tmp/usr/bin/utvpncmd
    chmod 755 /home/mitty/tmp/usr/bin/utvpncmd
    
    --------------------------------------------------------------------
    Installation completed successfully.
    
    Please execute 'utvpnserver start' to run UT-VPN Server Background Service.
    Or please execute 'utvpnclient start' to run UT-VPN Client Background Service.
    And please execute 'utvpncmd' to run UT-VPN Command-Line Utility to configure UT-Server or UT-VPN Client.
    --------------------------------------------------------------------
    
  • mitty@precise:~$ mv tmp utvpn-unix-v101-7101-public.mips
  • mitty@precise:~$ tar czf utvpn-unix-v101-7101-public.mips.tar.gz utvpn-unix-v101-7101-public.mips

update openssl headers

  • mitty@precise:~/openwrt/trunk/package/utvpn$ export PATH=$PATH:~/openwrt/trunk/staging_dir/toolchain-mips_r2_gcc-4.6-linaro_uClibc-0.9.33.2/bin/
  • mitty@precise:~/openwrt/trunk/package/utvpn$ export STAGING_DIR=~/openwrt/trunk/staging_dir/toolchain-mips_r2_gcc-4.6-linaro_uClibc-0.9.33.2/
  • mitty@precise:~/openwrt/trunk/package/utvpn$ cp ../../staging_dir/toolchain-mips_r2_gcc-4.6-linaro_uClibc-0.9.33.2/include/openssl/* src/Mayaqua/openssl/
  • mitty@precise:~/openwrt/trunk/package/utvpn$ make CC=mips-openwrt-linux-gcc LD=mips-openwrt-linux-ld
  • mitty@precise:~/openwrt/trunk/package/utvpn$ make install PREFIX=~/utvpn-unix-v101-7101-public.mips

it works !

  • mitty@starseed:~$ ./utvpn-unix-v101-7101-public.mips/usr/utvpnclient/utvpnclient
    SoftEther UT-VPN Client Service Program
    Copyright (C) 2004-2010 SoftEther Corporation.
    Copyright (C) 2004-2010 University of Tsukuba, Japan.
    Copyright (C) 2003-2010 Daiyuu Nobori.
    All Rights Reserved.
    
    utvpnclient Command Usage:
     utvpnclient start  - Start SoftEther UT-VPN Client Service.
     utvpnclient stop   - Stop SoftEther UT-VPN Client Service if the service is already started.
    
  • mitty@starseed:~$ ./utvpn-unix-v101-7101-public.mips/usr/utvpnclient/utvpnclient start
    SoftEther UT-VPN Client Service Started.
    
  • mitty@starseed:~$ ps w | tail
    29986 root         0 SW   [flush-mtd-unmap]
    29987 mitty     2100 S    -bash
    29992 mitty     1548 S    /usr/sbin/screen -d -RR -U
    29993 mitty     4344 S    {screen} /usr/sbin/SCREEN -d -RR -U
    29994 mitty     2648 S    /bin/bash
    30026 root         0 SW   [kworker/0:0]
    30033 mitty     4164 S    /home/mitty/utvpn-unix-v101-7101-public.mips/usr/utvpnclient/utvpnclient execsvc
    30034 mitty    11948 S    /home/mitty/utvpn-unix-v101-7101-public.mips/usr/utvpnclient/utvpnclient execsvc
    30043 mitty     1492 R    ps w
    30044 mitty     1492 S    tail
    
    • mitty@starseed:~$ netstat -nap --inet | grep utvpn
      (Not all processes could be identified, non-owned process info
       will not be shown, you would have to be root to see it all.)
      tcp        0      0 0.0.0.0:9930            0.0.0.0:*               LISTEN      30034/utvpnclient
      

zlib

  • mitty@precise:~$ export PATH=$PATH:~/openwrt/trunk/staging_dir/toolchain-mips_r2_gcc-4.6-linaro_uClibc-0.9.33.2/bin/
  • mitty@precise:~$ export STAGING_DIR=~/openwrt/trunk/staging_dir/toolchain-mips_r2_gcc-4.6-linaro_uClibc-0.9.33.2/
  • mitty@precise:~/openwrt$ wget http://zlib.net/zlib-1.2.7.tar.gz
  • mitty@precise:~/openwrt/zlib-1.2.7$ ./configure --prefix=$STAGING_DIR
  • mitty@precise:~/openwrt/zlib-1.2.7$ vim Makefile
    • Makefile

      old new  
      1616# To install in $HOME instead of /usr/local, use: 
      1717#    make install prefix=$HOME 
      1818 
      19 CC=gcc 
       19CC=mips-openwrt-linux-gcc 
      2020 
      2121CFLAGS=-O3  -D_LARGEFILE64_SOURCE=1 -DHAVE_HIDDEN 
      2222#CFLAGS=-O -DMAX_WBITS=14 -DMAX_MEM_LEVEL=7 
       
      2727SFLAGS=-O3  -fPIC -D_LARGEFILE64_SOURCE=1 -DHAVE_HIDDEN 
      2828LDFLAGS=  
      2929TEST_LDFLAGS=-L. libz.a 
      30 LDSHARED=gcc -shared -Wl,-soname,libz.so.1,--version-script,zlib.map 
      31 CPP=gcc -E 
       30LDSHARED=mips-openwrt-linux-gcc -shared -Wl,-soname,libz.so.1,--version-script,zlib.map 
       31CPP=mips-openwrt-linux-gcc -E 
      3232 
      3333STATICLIB=libz.a 
      3434SHAREDLIB=libz.so 
       
      3636SHAREDLIBM=libz.so.1 
      3737LIBS=$(STATICLIB) $(SHAREDLIBV) 
      3838 
      39 AR=ar 
       39AR=mips-openwrt-linux-ar 
      4040ARFLAGS=rc 
      41 RANLIB=ranlib 
       41RANLIB=mips-openwrt-linux-ranlib 
      4242LDCONFIG=ldconfig 
      4343LDSHAREDLIBC=-lc 
      4444TAR=tar 
  • mitty@precise:~/openwrt/zlib-1.2.7$ make
  • mitty@precise:~/openwrt/zlib-1.2.7$ make install
    cp libz.a /home/mitty/openwrt/trunk/staging_dir/toolchain-mips_r2_gcc-4.6-linaro_uClibc-0.9.33.2//lib
    chmod 644 /home/mitty/openwrt/trunk/staging_dir/toolchain-mips_r2_gcc-4.6-linaro_uClibc-0.9.33.2//lib/libz.a
    cp libz.so.1.2.7 /home/mitty/openwrt/trunk/staging_dir/toolchain-mips_r2_gcc-4.6-linaro_uClibc-0.9.33.2//lib
    chmod 755 /home/mitty/openwrt/trunk/staging_dir/toolchain-mips_r2_gcc-4.6-linaro_uClibc-0.9.33.2//lib/libz.so.1.2.7
    cp zlib.3 /home/mitty/openwrt/trunk/staging_dir/toolchain-mips_r2_gcc-4.6-linaro_uClibc-0.9.33.2//share/man/man3
    chmod 644 /home/mitty/openwrt/trunk/staging_dir/toolchain-mips_r2_gcc-4.6-linaro_uClibc-0.9.33.2//share/man/man3/zlib.3
    cp zlib.pc /home/mitty/openwrt/trunk/staging_dir/toolchain-mips_r2_gcc-4.6-linaro_uClibc-0.9.33.2//lib/pkgconfig
    chmod 644 /home/mitty/openwrt/trunk/staging_dir/toolchain-mips_r2_gcc-4.6-linaro_uClibc-0.9.33.2//lib/pkgconfig/zlib.pc
    cp zlib.h zconf.h /home/mitty/openwrt/trunk/staging_dir/toolchain-mips_r2_gcc-4.6-linaro_uClibc-0.9.33.2//include
    chmod 644 /home/mitty/openwrt/trunk/staging_dir/toolchain-mips_r2_gcc-4.6-linaro_uClibc-0.9.33.2//include/zlib.h /home/mitty/openwrt/trunk/staging_dir/toolchain-mips_r2_gcc-4.6-linaro_uClibc-0.9.33.2//include/zconf.h
    

openssl

  • mitty@precise:~/openwrt$ wget http://www.openssl.org/source/openssl-1.0.1c.tar.gz
  • mitty@precise:~/openwrt/openssl-1.0.1c$ vim Makefile
    • Makefile

      old new  
      2626# for, say, /usr/ and yet have everything installed to /tmp/somedir/usr/. 
      2727# Normally it is left empty. 
      2828INSTALL_PREFIX= 
      29 INSTALLTOP=/usr/local/ssl 
       29INSTALLTOP=/home/mitty/openwrt/trunk/staging_dir/toolchain-mips_r2_gcc-4.6-linaro_uClibc-0.9.33.2/ 
      3030 
      3131# Do not edit this manually. Use Configure --openssldir=DIR do change this! 
      32 OPENSSLDIR=/usr/local/ssl 
       32OPENSSLDIR=/home/mitty/openwrt/trunk/staging_dir/toolchain-mips_r2_gcc-4.6-linaro_uClibc-0.9.33.2/ 
      3333 
      3434# NO_IDEA - Define to build without the IDEA algorithm 
      3535# NO_RC4  - Define to build without the RC4 algorithm 
       
      5959# equal 4. 
      6060# PKCS1_CHECK - pkcs1 tests. 
      6161 
      62 CC= cc 
       62CC= mips-openwrt-linux-gcc 
      6363CFLAG= -O 
      6464DEPFLAG= -DOPENSSL_NO_EC_NISTP_64_GCC_128 -DOPENSSL_NO_GMP -DOPENSSL_NO_JPAKE -DOPENSSL_NO_MD2 -DOPENSSL_NO_RC5 -DOPENSSL_NO_RFC3779 -DOPENSSL_NO_SCTP -DOPENSSL_NO_STORE 
      6565PEX_LIBS=  
      6666EX_LIBS=  
      6767EXE_EXT=  
      6868ARFLAGS=  
      69 AR= ar $(ARFLAGS) r 
      70 RANLIB= /usr/bin/ranlib 
       69AR= mips-openwrt-linux-ar $(ARFLAGS) r 
       70RANLIB= mips-openwrt-linux-ranlib 
      7171NM= nm 
      7272PERL= /usr/bin/perl 
      7373TAR= tar 
  • mitty@precise:~/openwrt/openssl-1.0.1c$ make
  • mitty@precise:~/openwrt/openssl-1.0.1c$ make install
  • mitty@precise:~$ file openwrt/trunk/staging_dir/toolchain-mips_r2_gcc-4.6-linaro_uClibc-0.9.33.2/bin/openssl
    openwrt/trunk/staging_dir/toolchain-mips_r2_gcc-4.6-linaro_uClibc-0.9.33.2/bin/openssl: ELF 32-bit MSB executable, MIPS, MIPS32 rel2 version 1, dynamically linked (uses shared libs), with unknown capability 0x41000000 = 0xf676e75, with unknown capability 0x10000 = 0x70403, not stripped
    

ncurses

  • mitty@precise:~/openwrt$ wget http://ftp.gnu.org/pub/gnu/ncurses/ncurses-5.9.tar.gz
  • mitty@precise:~/openwrt/ncurses-5.9$ CC=mips-openwrt-linux-gcc ./configure --prefix=$STAGING_DIR
    checking for egrep... grep -E
    Configuring NCURSES 5.9 ABI 5 (Sun Jun 17 21:04:38 JST 2012)
    checking build system type... x86_64-unknown-linux-gnu
    checking host system type... x86_64-unknown-linux-gnu
    checking target system type... x86_64-unknown-linux-gnu
    Configuring for linux-gnu
    checking for prefix... /home/mitty/openwrt/trunk/staging_dir/toolchain-mips_r2_gcc-4.6-linaro_uClibc-0.9.33.2/
    checking for gcc... mips-openwrt-linux-gcc
    checking for C compiler default output... a.out
    checking whether the C compiler works... configure: error: cannot run C compiled programs.
    If you meant to cross compile, use `--host'.
    

configure with host=mips-unknown-linux-gnu

  • mitty@precise:~/openwrt/ncurses-5.9$ CC=mips-openwrt-linux-gcc CXX=mips-openwrt-linux-g++ ./configure --prefix=$STAGING_DIR --host=mips-unknown-linux-gnu
    checking for mips-unknown-linux-gnu-g++... no
    checking for mips-unknown-linux-gnu-c++... no
    checking for mips-unknown-linux-gnu-gpp... no
    checking for mips-unknown-linux-gnu-aCC... no
    checking for mips-unknown-linux-gnu-CC... no
    checking for mips-unknown-linux-gnu-cxx... no
    checking for mips-unknown-linux-gnu-cc++... no
    checking for mips-unknown-linux-gnu-cl... no
    checking for mips-unknown-linux-gnu-FCC... no
    checking for mips-unknown-linux-gnu-KCC... no
    checking for mips-unknown-linux-gnu-RCC... no
    checking for mips-unknown-linux-gnu-xlC_r... no
    checking for mips-unknown-linux-gnu-xlC... no
    checking for g++... g++
    
    • oops

configure with host=mips-openwrt-linux

  • mitty@precise:~/openwrt/ncurses-5.9$ CC=mips-openwrt-linux-gcc CXX=mips-openwrt-linux-g++ ./configure --prefix=$STAGING_DIR --host=mips-openwrt-linux
  • mitty@precise:~/openwrt/ncurses-5.9$ make
    compatibility.cc:(.text._ZNSt13basic_istreamIwSt11char_traitsIwEE6ignoreEi+0x188): undefined reference to `_Unwind_Resume'
    collect2: ld returned 1 exit status
    make[1]: *** [demo] Error 1
    make[1]: Leaving directory `/home/mitty/openwrt/ncurses-5.9/c++'
    make: *** [all] Error 2
    
  • mitty@precise:~/openwrt/ncurses-5.9$ CC=mips-openwrt-linux-gcc CXX=mips-openwrt-linux-g++ ./configure --prefix=$STAGING_DIR --host=mips-openwrt-linux --enable-echo --enable-const --enable-overwrite --disable-rpath --without-ada --without-debug --without-profile --without-progs --disable-big-core --disable-home-terminfo --with-normal --with-shared --with-terminfo-dirs=/usr/share/terminfo --with-default-terminfo-dir=/usr/share/terminfo
  • mitty@precise:~/openwrt/ncurses-5.9$ make
  • mitty@precise:~/openwrt/ncurses-5.9$ make install

readline