Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Cross Compile UPnP for Mipsel - Thingino
- # download compiler
- sudo apt install gcc-mipsel-linux-gnu g++-mipsel-linux-gnu
- # download and extract source code
- url="https://github.com/miniupnp/miniupnp/releases/download/miniupnpc_2_3_3/miniupnpc-2.3.3.tar.gz"
- wget "$url" -O miniupnpc.tar.gz
- tar xzvf miniupnpc.tar.gz
- cd "$(ls -d miniupnpc*/)"
- # set these variables
- export CC=mipsel-linux-gnu-gcc
- export AR=mipsel-linux-gnu-ar
- export LD=mipsel-linux-gnu-ld
- # find the following line in the Makefile
- $(BUILD)/upnpc-static:> $(BUILD)/upnpc.o $(LIBRARY)
- $(CC) $(LDFLAGS) -o $@ $^ $(LOADLIBES) $(LDLIBS)
- # and change it to this
- $(BUILD)/upnpc-static:> $(BUILD)/upnpc.o $(LIBRARY)
- $(CC) $(LDFLAGS) -static -o $@ $^ $(LOADLIBES) $(LDLIBS)
- # or just run this after make
- mipsel-linux-gnu-gcc -static -o build/upnpc-static build/upnpc.o build/libminiupnpc.a
- # now run make
- make
- # check and make sure that the binary is "statically linked"
- file build/upnpc-static
- # copy upnpc-static to device
- # you might need to put this somewhere other then root because of size
- # ram disk - /tmp
- # rename to upnpc and
- # make it executable
- chmod +x upnpc
- # example useage
- # add port forwarding
- upnpc -u http://192.168.1.1:1900/afdit/rootDesc.xml -a 192.168.1.30 554 554 tcp
- # delete port forwarding
- upnpc -u http://192.168.1.1:1900/afdit/rootDesc.xml -d 554 tcp
- # More info at https://gitlab.com/metalx1000/Thingino-Camera-Notes
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement