Login · Register
September 05 2010 10:14:50

Interesting Websites

Compiling flvstreamer for use on Unslung Linux


Modifying The Makefile

As all Linux distributions are different, they all require slightly different makefiles. In this case, the compilers have the standard names. However, the MakefileARM makefile assumes that your compilers have architecture specific names (eg. arm-linux-gcc). Therefore we need to modify this.

Also, we need to tell the compiler where it can find the C++ library we downloaded earlier. This can also be done in the makefile.

I am providing my makefile but I can only guarantee that it works for version 1.8k. Please download it from here.

First, we need to open the makefile using nano.

Code
nano MakefileARM




This will bring up a window that looks similar to the following:







At the top, you have the title bar which displays the version of nano being used, as well as the name of the file you are currently editing. Below that, the contents of the file is displayed. At the very bottom of the screen you have a list of the commands which you can use.

Commands can be run by pressing the CTRL button and the letter shown before the command. For example, to WriteOut (save) you press CTRL and O. This will bring up a prompt asking for the file name you wish to save as. Pressing enter at this stage will save the file under that name.

The green square that can be seen is the cursor. This can be moved around the screen in just the same way that you can move the cursor is almost any other text processing application; using the arrow keys.

Right, back to editing the makefile. Move the cursor to the right (using the arrow keys) and then delete "arm-linux-". Then delete "arm-linux-" on the two lines below that. Your screen should then look like this:







Then we just need to make one more change to the makefile. We need to tell the compiler where it can find the C++ library. To do this, go down to the line that says "LDFLAGS=" and change it to "LDFLAGS=-Wl,-rpath=/opt/lib". Your screen should now look like this:







And your modified makefile should look like this:

CC=gcc

CXX=g++

LD=ld



CFLAGS=-Wall -D_FILE_OFFSET_BITS=64

CXXFLAGS=-Wall -D_FILE_OFFSET_BITS=64

LDFLAGS=-Wall -D_FILE_OFFSET_BITS=64



CXXFLAGS=

LDFLAGS=-Wl,-rpath=/opt/lib



all: flvstreamer



clean:

rm -f *.o



streams: bytes.o log.o rtmp.o AMFObject.o rtmppacket.o streams.o parseurl.o handshake.o

$(CXX) $(LDFLAGS) $(ARMFLAGS) $^ -o $@_arm -lpthread



flvstreamer: bytes.o log.o rtmp.o AMFObject.o rtmppacket.o flvstreamer.o parseurl.o handshake.o

$(CXX) $(LDFLAGS) $(ARMFLAGS) $^ -o $@_arm



bytes.o: bytes.cpp bytes.h Makefile

log.o: log.cpp log.h Makefile

rtmp.o: rtmp.cpp rtmp.h log.h AMFObject.h Makefile

AMFObject.o: AMFObject.cpp AMFObject.h log.h rtmp.h Makefile

rtmppacket.o: rtmppacket.cpp rtmppacket.h log.h Makefile

flvstreamer.o: flvstreamer.cpp rtmp.h log.h AMFObject.h Makefile

parseurl.o: parseurl.cpp parseurl.h log.h Makefile

streams.o: streams.cpp log.h Makefile

handshake.o: handshake.cpp log.h Makefile


Now, press CTRL and O and then press Enter. This will save the file under the same file name. Now, exit nano by pressing CTRL and X. Next, we compile flvstreamer.

Ratings
Rating is available to Members only.

Please login or register to vote.

No Ratings have been Posted.