[x264-devel] [PATCH v2 7/8] configure: remove bash-specific pattern substitution

Ethan Sommer e5ten.arch at gmail.com
Thu Jan 16 22:23:41 CET 2020


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

diff --git a/configure b/configure
index ae89850a..56364c17 100755
--- a/configure
+++ b/configure
@@ -105,7 +105,7 @@ cc_cflags() {
 
 cl_ldflags() {
     for arg in $*; do
-        arg=${arg/LIBPATH/libpath}
+        [ "${arg#*LIBPATH}" = "$arg" ] || arg="${arg%%LIBPATH*}libpath${arg#*LIBPATH}"
         [ "${arg#-libpath:}" = "$arg" ] && [ "${arg#-l}" != "$arg" ] && arg=${arg#-l}.lib
         [ "${arg#-L}" != "$arg" ] && arg=-libpath:${arg#-L}
         [ "$arg" = -Wl,--large-address-aware ] && arg=-largeaddressaware
@@ -117,7 +117,7 @@ cl_ldflags() {
         [ "$arg" = -Wmaybe-uninitialized ] && arg=
         [ "${arg#-Qdiag-error}" = "$arg" ] || arg=
 
-        arg=${arg/pthreadGC/pthreadVC}
+        [ "${arg#*pthreadGC}" = "$arg" ] || arg="${arg%%pthreadGC*}pthreadVC${arg#*pthreadGC}"
         [ "$arg" = avifil32.lib ] && arg=vfw32.lib
         [ "$arg" = gpac_static.lib ] && arg=libgpac_static.lib
         [ "$arg" = x264.lib ] && arg=libx264.lib
-- 
2.25.0



More information about the x264-devel mailing list