Skip to content

Commit

Permalink
Support configure for generic linux. v5.0.145, v6.0.32 (#3445)
Browse files Browse the repository at this point in the history
If your OS is not CentOS, Ubuntu, macOS, cygwin64, run of configure will fail with:

```
Your OS Linux is not supported.
```

For other linux systems, we should support an option:

```
./configure --generic-linux=on
```

Please note that you might still fail for other issues while configuring or building.

PICK b31940a

-------

Co-authored-by: chundonglinlin <[email protected]>
Co-authored-by: ChenGH <[email protected]>
  • Loading branch information
3 people committed Mar 7, 2023
1 parent 36a7228 commit 47aa42f
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 4 deletions.
11 changes: 8 additions & 3 deletions trunk/auto/depends.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,14 @@
#####################################################################################
# Check OS and CPU architectures.
#####################################################################################
if [[ $OS_IS_UBUNTU != YES && $OS_IS_CENTOS != YES && $OS_IS_OSX != YES && $SRS_CROSS_BUILD != YES && $SRS_CYGWIN64 != YES ]]; then
echo "Your OS `uname -s` is not supported."
exit 1
if [[ $OS_IS_UBUNTU != YES && $OS_IS_CENTOS != YES && $OS_IS_OSX != YES && $SRS_CYGWIN64 != YES ]]; then
if [[ $SRS_CROSS_BUILD != YES && $SRS_GENERIC_LINUX != YES ]]; then
echo "Your OS `uname -s` is not supported."
if [[ $(uname -s) == "Linux" ]]; then
echo "Please try --generic-linux=on for other Linux systems."
fi
exit 1
fi
fi

# The absolute path of SRS_OBJS, for prefix and PKG_CONFIG_PATH
Expand Down
9 changes: 9 additions & 0 deletions trunk/auto/options.sh
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ SRS_GPROF=NO # Performance test: gprof
#
################################################################
# Preset options
SRS_GENERIC_LINUX= # Try to run as generic linux, not CentOS or Ubuntu.
SRS_OSX= #For OSX/macOS/Darwin PC.
SRS_CYGWIN64= # For Cygwin64 for Windows PC or servers.
SRS_CROSS_BUILD= #For cross build, for example, on Ubuntu.
Expand Down Expand Up @@ -145,6 +146,10 @@ function apply_system_options() {
if [[ $OS_IS_LINUX == YES || $OS_IS_CYGWIN == YES ]]; then
SRS_JOBS=$(grep -c ^processor /proc/cpuinfo 2>/dev/null || echo 1)
fi

if [[ $OS_IS_UBUNTU != YES && $OS_IS_CENTOS != YES && $OS_IS_OSX != YES && $SRS_CYGWIN64 != YES ]]; then
echo "Warning: Your OS is not Ubuntu(no apt-get), CentOS(no yum), maxOS(not Darwin), Windows(not CYGWIN)"
fi
}
apply_system_options

Expand Down Expand Up @@ -223,6 +228,7 @@ Experts:
--log-trace=on|off Whether enable the log trace level. Default: $(value2switch $SRS_LOG_TRACE)
--log-level_v2=on|off Whether use v2.0 log level definition, see log4j specs. Default: $(value2switch $SRS_LOG_LEVEL_V2)
--backtrace=on|off Whether show backtrace when crashing. Default: $(value2switch $SRS_BACKTRACE)
--generic-linux=on|off Whether run as generic linux, if not CentOS or Ubuntu. Default: $(value2switch $SRS_GENERIC_LINUX)
Deprecated:
--hds=on|off Whether build the hds streaming, mux RTMP to F4M/F4V files. Default: $(value2switch $SRS_HDS)
Expand Down Expand Up @@ -404,6 +410,8 @@ function parse_user_option() {
--debug) SRS_DEBUG=$(switch2value $value) ;;
--debug-stats) SRS_DEBUG_STATS=$(switch2value $value) ;;

--generic-linux) SRS_GENERIC_LINUX=$(switch2value $value) ;;

# Alias for --arm, cross build.
--cross-build) SRS_CROSS_BUILD=YES ;;
--enable-cross-compile) SRS_CROSS_BUILD=YES ;;
Expand Down Expand Up @@ -652,6 +660,7 @@ function regenerate_options() {
SRS_AUTO_CONFIGURE="${SRS_AUTO_CONFIGURE} --sanitizer-log=$(value2switch $SRS_SANITIZER_LOG)"
SRS_AUTO_CONFIGURE="${SRS_AUTO_CONFIGURE} --cygwin64=$(value2switch $SRS_CYGWIN64)"
SRS_AUTO_CONFIGURE="${SRS_AUTO_CONFIGURE} --single-thread=$(value2switch $SRS_SINGLE_THREAD)"
SRS_AUTO_CONFIGURE="${SRS_AUTO_CONFIGURE} --generic-linux=$(value2switch $SRS_GENERIC_LINUX)"
if [[ $SRS_CROSS_BUILD_ARCH != "" ]]; then SRS_AUTO_CONFIGURE="$SRS_AUTO_CONFIGURE --arch=$SRS_CROSS_BUILD_ARCH"; fi
if [[ $SRS_CROSS_BUILD_CPU != "" ]]; then SRS_AUTO_CONFIGURE="$SRS_AUTO_CONFIGURE --cpu=$SRS_CROSS_BUILD_CPU"; fi
if [[ $SRS_CROSS_BUILD_HOST != "" ]]; then SRS_AUTO_CONFIGURE="$SRS_AUTO_CONFIGURE --host=$SRS_CROSS_BUILD_HOST"; fi
Expand Down
1 change: 1 addition & 0 deletions trunk/doc/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ The changelog for SRS.

## SRS 5.0 Changelog

* v5.0, 2023-03-06, Merge [#3445](https://github.com/ossrs/srs/pull/3445): Support configure for generic linux. v5.0.145 (#3445)
* v5.0, 2023-03-04, Merge [#3105](https://github.com/ossrs/srs/pull/3105): Kickoff publisher when stream is idle, which means no players. v5.0.144 (#3105)
* v5.0, 2023-02-25, Merge [#3424](https://github.com/ossrs/srs/pull/3424): API: Add service_id for http_hooks, which identify the process. v5.0.143 (#3424)
* v5.0, 2023-02-22, Compatible with legacy RTMP URL. v5.0.142
Expand Down
2 changes: 1 addition & 1 deletion trunk/src/core/srs_core_version5.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@

#define VERSION_MAJOR 5
#define VERSION_MINOR 0
#define VERSION_REVISION 144
#define VERSION_REVISION 145

#endif

0 comments on commit 47aa42f

Please sign in to comment.