[FFmpeg-devel] [PATCH 1/2] configure: do not fork off grep subprocess in probe_cc

Ganesh Ajjanagadde gajjanagadde at gmail.com
Mon Aug 24 21:38:18 CEST 2015


grep is not required for the functionality in this instance.
This avoids an unnecessary fork, and also avoids a duplicated dumpversion call.
Furthermore, it also corrects behavior when no minor version number is present, see e.g
https://github.com/joyent/node/pull/25671.

Signed-off-by: Ganesh Ajjanagadde <gajjanagadde at gmail.com>
---
 configure | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/configure b/configure
index e67ddf6..f92b526 100755
--- a/configure
+++ b/configure
@@ -3566,9 +3566,9 @@ probe_cc(){
         gcc_pkg_ver=$(expr "$gcc_version" : '[^ ]* \(([^)]*)\)')
         gcc_ext_ver=$(expr "$gcc_version" : ".*$gcc_pkg_ver $gcc_basever \\(.*\\)")
         _ident=$(cleanws "gcc $gcc_basever $gcc_pkg_ver $gcc_ext_ver")
-        if ! $_cc -dumpversion | grep -q '^2\.'; then
-            _depflags='-MMD -MF $(@:.o=.d) -MT $@'
-        fi
+        case $gcc_basever in
+            2*) _depflags='-MMD -MF $(@:.o=.d) -MT $@' ;;
+        esac
         _cflags_speed='-O3'
         _cflags_size='-Os'
     elif $_cc --version 2>/dev/null | grep -q ^icc; then
-- 
2.5.0



More information about the ffmpeg-devel mailing list