[solved]Help with custom package compilation

I am trying to compile this software:

for my router (linksys wrt1200ac)

the Readme file says for cross-compiling that I should do this:

# clone the project 
git clone https://github.com/Intika-Linux-Proxy/SNI-SSL-Proxy.git
cd SNI-SSL-Proxy
# setup cross compile tool chain:
export PATH="$PATH:/pato/to/cross/compile/toolchain/bin/"
# build libmill
curl -s -L https://github.com/sustrik/libmill/archive/master.tar.gz | tar -zxf -
mv libmill-master libmill
cd libmill
./configure --enable-shared=false --host=arm-unknown-linux-gnueabihf
make libmill.la
cd ../
# build sniproxy
autoreconf -if
# export CFLAGS=-march=native
export CPPFLAGS=-I$(pwd)/libmill
export LDFLAGS=-L$(pwd)/libmill/.libs
./configure --host=arm-unknown-linux-gnueabihf \
    --prefix=/usr --sysconfdir=/etc

I changed the arm-unknown-linux-gnueabihf to arm-openwrt-linux-muslgnueabi and used the bin path of openwrt-sdk-18.06.4-mvebu-cortexa9_gcc-7.3.0_musl_eabi.Linux-x86_64/staging_dir/toolchain-arm_cortex-a9+vfpv3_gcc-7.3.0_musl_eabi/bin/

but I get errors when I try to compile the libmill .

configure:3504: checking whether the C compiler works
configure:3526: arm-openwrt-linux-muslgnueabi-gcc    conftest.c  >&5
arm-openwrt-linux-muslgnueabi-gcc: warning: environment variable 'STAGING_DIR' not defined
arm-openwrt-linux-muslgnueabi-gcc: warning: environment variable 'STAGING_DIR' not defined
arm-openwrt-linux-muslgnueabi-gcc: warning: environment variable 'STAGING_DIR' not defined
/usr/lib/libgcc_s.so.1: file not recognized: File format not recognized
collect2: error: ld returned 1 exit status
configure:3530: $? = 1
configure:3568: result: no
configure: failed program was:
| /* confdefs.h */
| #define PACKAGE_NAME "libmill"
| #define PACKAGE_TARNAME "libmill"
| #define PACKAGE_VERSION "Unknown"
| #define PACKAGE_STRING "libmill Unknown"
| #define PACKAGE_BUGREPORT "libmill@freelists.org"
| #define PACKAGE_URL "http://libmill.org/"
| #define PACKAGE "libmill"
| #define VERSION "Unknown"
| /* end confdefs.h.  */
| int
| main ()
| {
|   ;
|   return 0;
| }
configure:3573: error: in `/home/me/SNI-SSL-Proxy-master/libmill':
configure:3575: error: C compiler cannot create executables

anyone here have experience with compiling a package with the help of sdk but not using Makefile?

is that possible?

or maybe some help to be able to create a usable makefile for this pacakge (and its library)

@reza I added sniproxy to my openwrt package feed, just include it in your package feeds (openwrt sdk) and update afterwards or use my docker based package builder.

The docker based approach should be the easiest, you just need to get docker installed and create/modify the builder input .txt file based on the other examples.

The sniproxy is under (Network/Routing and Redirection), i did not add a service file so report back if it actually works. I just did a quick qemu test if the binary runs for my arm platform, which worked.

root-mvebu/usr/bin/sniproxy -h
usage: socks5 [options]
  -h, --help            show this help
  -a <addr>             listen address, default:
  -w <num>              number of workers
  --socks5 HOST[:PORT]  SOCKS5 proxy to use

PS: Its not a static build, so make sure libmill is also build/installed if you copy it manually to your device.

as per other thread how did you use qemu.
can you share the commands used for networks and so on?
for the life of me I cant make qemu have network (internet access)

Read the guides on my extra feed + package maker, qemu is not needed.

I understand that part. and thank you for the makefile.
I am asking about that you tested on qemu. I am asking about


Thats qemu in userspace, its not suited to compile stuff (not a full VM), just a way to quickly check if the bin is compatible for the target and all shared libs are present.

is that a qemu vm or not? I dont understand the userspace part. I want to know if that is a qemu virtual machine with a mvebu in the prompt .
it intrigued me.
so can you put the command for it here?

As noted forget about qemu, that's not the way to build for openwrt, just use my package-builder and the package from my feed.

PS: If you have problems setting-up the package-builder, you can give me your openwrt version and target/subtarget (device) so i can build a binary for you.

I used the feed from your githun and after disabling signatures it can build those packages fine.
qemu is for myself emulating a openwrt system.
but thanks again for great help.

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.