Skip to content

Commit

Permalink
for #485, support cross build for arm
Browse files Browse the repository at this point in the history
  • Loading branch information
winlinvip committed Sep 23, 2015
1 parent 16730ea commit f6e6553
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 23 deletions.
23 changes: 0 additions & 23 deletions trunk/auto/auto_headers.sh
Original file line number Diff line number Diff line change
Expand Up @@ -43,29 +43,6 @@ echo "" >> $SRS_AUTO_HEADERS_H
#####################################################################################
# generate auto headers file, depends on the finished of options.sh
#####################################################################################
if [ $SRS_ARM_UBUNTU12 = YES ]; then
__SrsArmCC="arm-linux-gnueabi-gcc";
__SrsArmGCC="arm-linux-gnueabi-gcc";
__SrsArmCXX="arm-linux-gnueabi-g++";
__SrsArmAR="arm-linux-gnueabi-ar";
__SrsArmLD="arm-linux-gnueabi-ld";
__SrsArmRANDLIB="arm-linux-gnueabi-ranlib";
fi
if [ $SRS_MIPS_UBUNTU12 = YES ]; then
__SrsArmCC="mipsel-openwrt-linux-gcc";
__SrsArmGCC="mipsel-openwrt-linux-gcc";
__SrsArmCXX="mipsel-openwrt-linux-g++";
__SrsArmAR="mipsel-openwrt-linux-ar";
__SrsArmLD="mipsel-openwrt-linux-ld";
__SrsArmRANDLIB="mipsel-openwrt-linux-ranlib";
fi
# the arm-ubuntu12 options for make for depends
if [[ -z $SrsArmCC ]]; then SrsArmCC=$__SrsArmCC; fi
if [[ -z $SrsArmGCC ]]; then SrsArmGCC=$__SrsArmGCC; fi
if [[ -z $SrsArmCXX ]]; then SrsArmCXX=$__SrsArmCXX; fi
if [[ -z $SrsArmAR ]]; then SrsArmAR=$__SrsArmAR; fi
if [[ -z $SrsArmLD ]]; then SrsArmLD=$__SrsArmLD; fi
if [[ -z $SrsArmRANDLIB ]]; then SrsArmRANDLIB=$__SrsArmRANDLIB; fi
# write to source file
if [ $SRS_CROSS_BUILD = YES ]; then
echo "cc=$SrsArmCC gcc=$SrsArmGCC g++=$SrsArmCXX ar=$SrsArmAR ld=$SrsArmLD randlib=$SrsArmRANDLIB"
Expand Down
30 changes: 30 additions & 0 deletions trunk/auto/setup_variables.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
#!/bin/bash

# when options parsed, setup some variables, then build the depends.

# when arm specified, setup the cross build variables.
if [ $SRS_ARM_UBUNTU12 = YES ]; then
__SrsArmCC="arm-linux-gnueabi-gcc";
__SrsArmGCC="arm-linux-gnueabi-gcc";
__SrsArmCXX="arm-linux-gnueabi-g++";
__SrsArmAR="arm-linux-gnueabi-ar";
__SrsArmLD="arm-linux-gnueabi-ld";
__SrsArmRANDLIB="arm-linux-gnueabi-ranlib";
fi

if [ $SRS_MIPS_UBUNTU12 = YES ]; then
__SrsArmCC="mipsel-openwrt-linux-gcc";
__SrsArmGCC="mipsel-openwrt-linux-gcc";
__SrsArmCXX="mipsel-openwrt-linux-g++";
__SrsArmAR="mipsel-openwrt-linux-ar";
__SrsArmLD="mipsel-openwrt-linux-ld";
__SrsArmRANDLIB="mipsel-openwrt-linux-ranlib";
fi

# the arm-ubuntu12 options for make for depends
if [[ -z $SrsArmCC ]]; then SrsArmCC=$__SrsArmCC; fi
if [[ -z $SrsArmGCC ]]; then SrsArmGCC=$__SrsArmGCC; fi
if [[ -z $SrsArmCXX ]]; then SrsArmCXX=$__SrsArmCXX; fi
if [[ -z $SrsArmAR ]]; then SrsArmAR=$__SrsArmAR; fi
if [[ -z $SrsArmLD ]]; then SrsArmLD=$__SrsArmLD; fi
if [[ -z $SrsArmRANDLIB ]]; then SrsArmRANDLIB=$__SrsArmRANDLIB; fi
3 changes: 3 additions & 0 deletions trunk/configure
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ BLACK="\\033[0m"
# parse options, exit with error when parse options invalid.
. auto/options.sh

# setup variables when options parsed.
. auto/setup_variables.sh

# clean the exists, when not export srs-librtmp.
# do this only when the options is ok.
if [[ -f Makefile ]]; then
Expand Down
2 changes: 2 additions & 0 deletions trunk/ide/srs_xcode/srs_xcode.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -352,6 +352,7 @@
3C689F9B1AB6AAC800C9CEEE /* sched.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = sched.c; path = "../../objs/st-1.9/sched.c"; sourceTree = "<group>"; };
3C689F9C1AB6AAC800C9CEEE /* stk.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = stk.c; path = "../../objs/st-1.9/stk.c"; sourceTree = "<group>"; };
3C689F9D1AB6AAC800C9CEEE /* sync.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = sync.c; path = "../../objs/st-1.9/sync.c"; sourceTree = "<group>"; };
3CB25C281BB2596300C97A63 /* setup_variables.sh */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; name = setup_variables.sh; path = ../../../auto/setup_variables.sh; sourceTree = "<group>"; };
3CC52DCA1ACE4023006FEB01 /* srs_utest_amf0.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = srs_utest_amf0.cpp; path = ../../src/utest/srs_utest_amf0.cpp; sourceTree = "<group>"; };
3CC52DCB1ACE4023006FEB01 /* srs_utest_amf0.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = srs_utest_amf0.hpp; path = ../../src/utest/srs_utest_amf0.hpp; sourceTree = "<group>"; };
3CC52DCC1ACE4023006FEB01 /* srs_utest_config.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = srs_utest_config.cpp; path = ../../src/utest/srs_utest_config.cpp; sourceTree = "<group>"; };
Expand Down Expand Up @@ -632,6 +633,7 @@
3C1232C31AAE827E00CE8F6C /* local_ip.sh */,
3C1232C41AAE827E00CE8F6C /* modules.sh */,
3C1232C51AAE827E00CE8F6C /* options.sh */,
3CB25C281BB2596300C97A63 /* setup_variables.sh */,
3C1232C61AAE827E00CE8F6C /* summary.sh */,
3C1232C71AAE827E00CE8F6C /* utest.sh */,
);
Expand Down

0 comments on commit f6e6553

Please sign in to comment.