ntop / n2n

Peer-to-peer VPN
GNU General Public License v3.0
6.29k stars 943 forks source link

compile 3.1 on openwrt ,make error #993

Open mr-jia1994 opened 2 years ago

mr-jia1994 commented 2 years ago

Compiling 3.0 is ok Compiling version 3.1 reported an error Information is as follows

There is no problem with openwrt compiling 3.0, one pass. Recently, I want to change to 3.1, but the compilation error is as follows (the main directory is omitted)

touch /openwrt/....l/n2n-HEAD/.source_dir
touch: cannot touch '/openwrt/..../n2n-HEAD/.source_dir': No such file or directory
make[2]: *** [Makefile:106: /openwrt/...../n2n-HEAD/.prepared] Error 1
make[2]: Leaving directory '/openwrt/package/n2n'
time: package/n2n/prepare#0.10#0.01#0.11
make[1]: *** [package/Makefile:113: package/n2n/prepare] Error 2
make[1]: Leaving directory '/openwrt'
make: *** [/openwrt/include/toplevel.mk:227:package/n2n/prepare] 错误 2
Logan007 commented 2 years ago

Please stick to English as common forum language.

hamishcoleman commented 2 years ago

We have a documented openwrt build process that is currently successfully building the latest dev version of n2n against the latest openwrt

See: https://github.com/ntop/n2n/blob/dev/packages/openwrt/README.md https://github.com/ntop/n2n/actions/workflows/openwrt.yml

If you are experiencing issues, can you first replicate them using our build process and clearly show all your build steps in any issue.

felix-git-hub commented 2 years ago

I used docker to compile for openwrt or alpine, the file that static compiled in alpine can also be used in openwrt.

-----------using openwrt docker sudo docker run --rm -v ~/tmp/:/home/ -it openwrtorg/rootfs:21.02.0 # there is no gcc package in 22 somehow cd n2n opkg update && opkg install autoconf automake gcc bash make ./autogen.sh ./configure CFLAGS='-static' #static building although is not recommended by the author, can be ignored make make install

-----------using alpine docker

sudo docker run --rm -v ~/tmp/:/home/ -it alpine apk add --update autoconf automake gcc bash make linux-headers libc-dev ./autogen.sh ./configure CFLAGS='-static' #if you want to used in openwrt, this option is mandatory make make install

Logan007 commented 2 years ago

So, is this still an issue?

helwod commented 3 days ago

安装下 opkg install coreutils-install 就可以解决