瀏覽代碼

improve openssl

ruki 3 年之前
父節點
當前提交
4077094898
共有 1 個文件被更改,包括 15 次插入1 次删除
  1. 15 1
      packages/o/openssl/xmake.lua

+ 15 - 1
packages/o/openssl/xmake.lua

@@ -78,7 +78,20 @@ package("openssl")
         import("package.tools.make").install(package)
     end)
 
-    on_install("macosx", "linux", "cross", "android", function (package)
+    on_install("linux", "macosx", function (package)
+        -- https://wiki.openssl.org/index.php/Compilation_and_Installation#PREFIX_and_OPENSSLDIR
+        local buildenvs = import("package.tools.autoconf").buildenvs(package)
+        local configs = {"--openssldir=" .. package:installdir(),
+                         "--prefix=" .. package:installdir()}
+        if package:debug() then
+            table.insert(configs, "--debug")
+        end
+        os.vrunv("./config", configs, {envs = buildenvs})
+        local makeconfigs = {CFLAGS = buildenvs.CFLAGS, ASFLAGS = buildenvs.ASFLAGS}
+        import("package.tools.make").install(package, makeconfigs)
+    end)
+
+    on_install("cross", "android", function (package)
 
         local target_arch = "generic32"
         if package:is_arch("x86_64") then
@@ -104,6 +117,7 @@ package("openssl")
                          "-DOPENSSL_NO_HEARTBEATS",
                          "no-shared",
                          "no-threads",
+                         "--openssldir=" .. package:installdir(),
                          "--prefix=" .. package:installdir()}
         local buildenvs = import("package.tools.autoconf").buildenvs(package)
         os.vrunv("./Configure", configs, {envs = buildenvs})