]> granicus.if.org Git - php/commitdiff
Fixed linking of extensions that would use a static .lib file (libname_a.lib rather...
authorKalle Sommer Nielsen <kalle@php.net>
Mon, 3 Jan 2011 23:08:47 +0000 (23:08 +0000)
committerKalle Sommer Nielsen <kalle@php.net>
Mon, 3 Jan 2011 23:08:47 +0000 (23:08 +0000)
# This fixes `configure --with-mcrypt=shared' to properly find and
# link against libmcrypt.lib rather than libmcrypt_a.lib

win32/build/confutils.js

index 55dbfc2a665cecb50281cd5abdd1c131af453d31..4539a103d5a7aa22dd2af2637b77766f7d5813b6 100644 (file)
@@ -648,6 +648,9 @@ function CHECK_LIB(libnames, target, path_to_check, common_name)
        // Expand path to include general dirs\r
        path_to_check += ";" + php_usual_lib_suspects;\r
 \r
+       // For static libs\r
+       eval('var static_lib = !PHP_' + common_name.toUpperCase() + '_SHARED;');\r
+\r
        // It is common practice to put libs under one of these dir names\r
        var subdirs = new Array(PHP_DEBUG == "yes" ? "Debug" : (PHP_DEBUG_PACK == "yes"?"Release_Dbg":"Release"), "lib", "libs", "libexec");\r
 \r
@@ -663,6 +666,14 @@ function CHECK_LIB(libnames, target, path_to_check, common_name)
                        name = name.replace(rExp,"_debug.lib");\r
                        libnames.unshift(name);\r
                }\r
+       } else if (!static_lib) {\r
+               var length = libnames.length;\r
+               for (var i = 0; i < length; i++) {\r
+                       var name = new String(libnames[i]);\r
+                       rExp = /_a.lib$/i;\r
+                       name = name.replace(rExp,".lib");\r
+                       libnames.unshift(name);\r
+               }\r
        }\r
 \r
        var i, j, k, libname;\r