Skip to content

Commit

Permalink
fix parsing of gcc version greater than 9.
Browse files Browse the repository at this point in the history
because 10 has two digits
  • Loading branch information
miniupnp committed Mar 24, 2021
1 parent 9d8c9cf commit 7e2dd87
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions config.lib
Original file line number Diff line number Diff line change
Expand Up @@ -605,7 +605,7 @@ make_compiler_cflags() {

if [ `basename $1 | cut -c 1-3` = "icc" ]; then
# Enable some things only for certain ICC versions
cc_version=`$1 -dumpversion | cut -c 1-4 | sed s@\\\.@@g`
cc_version=`$1 -dumpversion | cut -d. -f 1-2 | sed s@\\\.@@g`

flags="$flags -rdynamic"
ldflags="$ldflags -rdynamic"
Expand Down Expand Up @@ -736,7 +736,7 @@ make_compiler_cflags() {
ldflags="$ldflags -rdynamic"
else
# Enable some things only for certain GCC versions
cc_version=`$1 -dumpversion | cut -c 1,3`
cc_version=`$1 -dumpversion | cut -d. -f 1-2 | sed s@\\\.@@g`
if [ $(echo -n "$cc_version" | wc -c) -eq 1 ] ; then
# add a 0 if the version had only one digit
cc_version="${cc_version}0"
Expand Down

0 comments on commit 7e2dd87

Please sign in to comment.