[x264-devel] configure: Simplify cygwin/mingw/msys code

Henrik Gramner git at videolan.org
Sun Jan 17 22:17:55 CET 2016


x264 | branch: master | Henrik Gramner <henrik at gramner.com> | Tue Nov  3 17:55:08 2015 +0100| [cc652c158c1fa65bfeafb6446b5be855850065d0] | committer: Henrik Gramner

configure: Simplify cygwin/mingw/msys code

Avoids some code duplication.

Also drop the -mno-cygwin check since that option was removed back in 2008.

> http://git.videolan.org/gitweb.cgi/x264.git/?a=commit;h=cc652c158c1fa65bfeafb6446b5be855850065d0
---

 configure |   19 ++++---------------
 1 file changed, 4 insertions(+), 15 deletions(-)

diff --git a/configure b/configure
index 84bbf9d..50d4f53 100755
--- a/configure
+++ b/configure
@@ -601,29 +601,18 @@ case $host_os in
         define HAVE_MALLOC_H
         libm="-lm"
         ;;
-    cygwin*)
+    cygwin*|mingw*|msys*)
         EXE=".exe"
-        if [ $compiler_style = GNU ] && cc_check "" -mno-cygwin; then
-            CFLAGS="$CFLAGS -mno-cygwin"
-            LDFLAGS="$LDFLAGS -mno-cygwin"
-        fi
-        if cpp_check "" "" "defined(__CYGWIN__)" ; then
-            define HAVE_MALLOC_H
+        if [[ $host_os = cygwin* ]] && cpp_check "" "" "defined(__CYGWIN__)" ; then
             SYS="CYGWIN"
+            define HAVE_MALLOC_H
         else
             SYS="WINDOWS"
             DEVNULL="NUL"
             LDFLAGSCLI="$LDFLAGSCLI -lshell32"
-            RC="${RC-${cross_prefix}windres}"
+            [ $compiler = GNU ] && RC="${RC-${cross_prefix}windres}" || RC="${RC-rc}"
         fi
         ;;
-    mingw*)
-        SYS="WINDOWS"
-        EXE=".exe"
-        DEVNULL="NUL"
-        LDFLAGSCLI="$LDFLAGSCLI -lshell32"
-        [ $compiler = GNU ] && RC="${RC-${cross_prefix}windres}" || RC="${RC-rc}"
-        ;;
     sunos*|solaris*)
         SYS="SunOS"
         define HAVE_MALLOC_H



More information about the x264-devel mailing list