主页 > 路由器 > Ubuntu编译entware

Ubuntu编译entware

2017年4月27日 Ubuntu编译entware有1条评论 阅读: 7,072 次

参考:
https://github.com/Entware-ng/Entware-ng/wiki/Compile-packages-from-sources

1、Ubuntu安装依赖包
和openwrt一样安装依赖包:
sudo apt-get install build-essential subversion libncurses5-dev zlib1g-dev gawk gcc-multilib flex git-core gettext libssl-dev mercurial unzip

2、下载Entware-ng
git clone https://github.com/Entware-ng/Entware-ng.git
cd Entware-ng

3、更新package
make package/symlinks
更新的包在~/Entware-ng/feeds/packages目录

4、拷贝配置文件
根据要编译的平台选择配置文件,比如要编译ARM V7平台:
~/Entware-ng$ cp configs/armv7.config .config

5、全部编译
make

6、分步编译
make tools/install
make toolchain/install
make target/compile
make package/compile
最后一行是编译所有包,可以替换成你需要的单个包进行编译

7、单个包编译
make package/squid/compile
查看错误信息:
make package/squid/compile V=s
多核编译
make package/squid/compile -j4

8、编译新包
比如要编译ssr:
https://github.com/ywb94/openwrt-ssr
步骤与openwrt一致
cd ~/Entware-ng
git clone https://github.com/ywb94/openwrt-ssr.git package/openwrt-ssr

make menuconfig
# 选择要编译的包,保存退出
#luci ->3. Applications-> luci-app-shadowsocksR 原始版本
#luci ->3. Applications-> luci-app-shadowsocksR-GFW GFWList版本

make package/openwrt-ssr/compile V=99
编译后生成的IPK在~/Entware-ng/bin/targets/armv7soft/generic-glibc/packages目录

如果本文对你有帮助,请打赏作者,鼓励我们继续写作!

评论:1

  1. 子说 回复
    2019年8月21日 于 上午11:28

    大佬,我在编译PHP7的时候,提示需要编译ICU,但是IUC这个库死活编译不成功,大佬能执导一下么?错误代码如下:

    make[2]: Entering directory `/home/Entware-ng/feeds/packages/libs/icu'
    CFLAGS="-O2 -I/home/Entware-ng/staging_dir/host/include -I/home/Entware-ng/staging_dir/host/usr/include -I/home/Entware-ng/staging_dir/hostpkg/include -I/home/Entware-ng/staging_dir/target-arm_cortex-a9_glibc-2.23_eabi/host/include" CPPFLAGS="-I/home/Entware-ng/staging_dir/host/include -I/home/Entware-ng/staging_dir/host/usr/include -I/home/Entware-ng/staging_dir/hostpkg/include -I/home/Entware-ng/staging_dir/target-arm_cortex-a9_glibc-2.23_eabi/host/include" CXXFLAGS="" LDFLAGS="-L/home/Entware-ng/staging_dir/host/lib -L/home/Entware-ng/staging_dir/host/usr/lib -L/home/Entware-ng/staging_dir/hostpkg/lib -L/home/Entware-ng/staging_dir/target-arm_cortex-a9_glibc-2.23_eabi/host/lib" make -j1 -C /home/Entware-ng/build_dir/hostpkg/icu4c-60.2
    make[3]: Entering directory `/home/Entware-ng/build_dir/hostpkg/icu4c-60.2'
    Note: rebuild with "make VERBOSE=1 " to show all compiler parameters.
    make[3]: Making `all' in `stubdata'
    make[4]: Entering directory `/home/Entware-ng/build_dir/hostpkg/icu4c-60.2/stubdata'
    g++ ... stubdata.cpp
    In file included from ../common/unicode/utypes.h:38:0,
    from stubdata.cpp:22:
    ../common/unicode/umachine.h:347:13: error: 'char16_t' does not name a type
    In file included from ../common/unicode/utypes.h:39:0,
    from stubdata.cpp:22:
    ../common/unicode/uversion.h:167:55: error: 'UChar' does not name a type
    ../common/unicode/uversion.h:167:62: error: ISO C++ forbids declaration of 'versionString' with no type [-fpermissive]
    In file included from ../common/unicode/udata.h:23:0,
    from stubdata.cpp:23:
    ../common/unicode/localpointer.h:221:34: error: expected ',' or '...' before '&&' token
    ../common/unicode/localpointer.h:221:39: error: invalid constructor; you probably meant 'icu_60::LocalPointer (const icu_60::LocalPointer&)'
    ../common/unicode/localpointer.h:238:48: error: expected ',' or '...' before '&&' token
    ../common/unicode/localpointer.h: In member function 'icu_60::LocalPointer& icu_60::LocalPointer::operator=(icu_60::LocalPointer)':
    ../common/unicode/localpointer.h:239:25: error: 'src' was not declared in this scope
    ../common/unicode/localpointer.h: At global scope:
    ../common/unicode/localpointer.h:366:30: error: expected ',' or '...' before '&&' token
    ../common/unicode/localpointer.h:366:35: error: invalid constructor; you probably meant 'icu_60::LocalArray (const icu_60::LocalArray&)'
    ../common/unicode/localpointer.h:383:44: error: expected ',' or '...' before '&&' token
    ../common/unicode/localpointer.h: In member function 'icu_60::LocalArray& icu_60::LocalArray::operator=(icu_60::LocalArray)':
    ../common/unicode/localpointer.h:384:25: error: 'src' was not declared in this scope
    In file included from stubdata.cpp:23:0:
    ../common/unicode/udata.h: At global scope:
    ../common/unicode/udata.h:280:1: error: expected ',' or '...' before '&&' token
    ../common/unicode/udata.h:280:1: error: invalid constructor; you probably meant 'icu_60::LocalUDataMemoryPointer (const icu_60::LocalUDataMemoryPointer&)'
    ../common/unicode/udata.h:280:1: error: expected ',' or '...' before '&&' token
    ../common/unicode/udata.h: In member function 'icu_60::LocalUDataMemoryPointer& icu_60::LocalUDataMemoryPointer::operator=(icu_60::LocalUDataMemoryPointer)':
    ../common/unicode/udata.h:280:1: error: 'src' was not declared in this scope
    stubdata.cpp: At global scope:
    stubdata.cpp:58:16: error: 'UChar' was not declared in this scope
    *** Failed compilation command follows: ----------------------------------------------------------
    g++ -D_REENTRANT -DU_HAVE_ELF_H=1 -DU_HAVE_ATOMIC=0 -DU_HAVE_STRTOD_L=1 -DU_HAVE_XLOCALE_H=1 -I../common -DU_ATTRIBUTE_DEPRECATED= -O3 -W -Wall -pedantic -Wpointer-arith -Wwrite-strings -Wno-long-long -c -o stubdata.ao stubdata.cpp
    --- ( rebuild with "make VERBOSE=1 all" to show all parameters ) --------
    make[4]: *** [stubdata.ao] Error 1
    make[4]: Leaving directory `/home/Entware-ng/build_dir/hostpkg/icu4c-60.2/stubdata'
    make[3]: *** [all-recursive] Error 2
    make[3]: Leaving directory `/home/Entware-ng/build_dir/hostpkg/icu4c-60.2'
    make[2]: *** [/home/Entware-ng/build_dir/hostpkg/icu4c-60.2/.built] Error 2
    make[2]: Leaving directory `/home/Entware-ng/feeds/packages/libs/icu'
    make[1]: *** [package/feeds/packages/icu/host/compile] Error 2
    make[1]: Leaving directory `/home/Entware-ng'
    make: *** [package/php7/compile] Error 2

发表评论

电子邮件地址不会被公开。 必填项已用*标注