Просмотр исходного кода

suport for use of local libaio, libiconv, libidn

snermolaev 1 год назад
Родитель
Сommit
ef05dd5da5

+ 3 - 3
build/conf/opensource.conf

@@ -20,9 +20,9 @@ when ($OPENSOURCE == "yes") {
     SO_OUTPUTS=yes
     UDF_NO_PROBE=yes
     USE_ASMLIB=no
-    USE_DYNAMIC_AIO=yes
-    USE_DYNAMIC_ICONV=yes
-    USE_DYNAMIC_IDN=yes
+    _USE_AIO=dynamic
+    _USE_ICONV=dynamic
+    _USE_IDN=dynamic
     USE_MKL=no
     NON_FATAL_ADDINCL_TO_MISSING=yes
 }

+ 18 - 0
build/conf/sysincl.conf

@@ -15,6 +15,24 @@ SYSINCL+=build/sysincl/unsorted.yml
 # FIXME: Make SWIG_IMPLICIT_INCLUDES more granular and get rid of swig.yml
 SYSINCL+=build/sysincl/swig.yml
 
+when ($USE_AIO == "local" || $USE_AIO == "" && $_USE_AIO == "local") {
+    SYSINCL+=build/sysincl/libaio-to-nothing.yml
+}
+
+when ($USE_ICONV == "local" || $USE_ICONV == "" && $_USE_ICONV == "local") {
+    SYSINCL+=build/sysincl/libiconv-to-nothing.yml
+}
+otherwise {
+    SYSINCL+=build/sysincl/libiconv.yml
+}
+
+when ($USE_IDN == "local" || $USE_IDN == "" && $_USE_IDN == "local") {
+    SYSINCL+=build/sysincl/libidn-to-nothing.yml
+}
+otherwise {
+    SYSINCL+=build/sysincl/libidn.yml
+}
+
 when ($USE_SYSTEM_JDK) {
     SYSINCL+=build/sysincl/system-jdk.yml
 }

+ 2 - 0
build/sysincl/libaio-to-nothing.yml

@@ -0,0 +1,2 @@
+- includes:
+  - libaio.h

+ 2 - 0
build/sysincl/libiconv-to-nothing.yml

@@ -0,0 +1,2 @@
+- includes:
+  - iconv.h

+ 8 - 0
build/sysincl/libiconv.yml

@@ -0,0 +1,8 @@
+# We have lots of ADDINCLs to contrib/libs/libiconv all around the repo
+# so we need to add it to sysincl for consistent resolving.
+# We can go the other way here and remove iconv.h from all sysincl configs
+# and try to fix all places where we really need iconv.h from libc
+# Btw: seems that this ADDINCL should be made global and removed from projects
+# that use this header
+- includes:
+  - iconv.h:       contrib/libs/libiconv/include/iconv.h

+ 9 - 0
build/sysincl/libidn-to-nothing.yml

@@ -0,0 +1,9 @@
+- source_filter: "^(?!contrib/libs/libuv/)"
+  includes:
+  - idn-free.h
+  - idn-int.h
+  - idna.h
+  - pr29.h
+  - punycode.h
+  - stringprep.h
+  - tld.h

+ 6 - 0
build/sysincl/libidn.yml

@@ -0,0 +1,6 @@
+# libidn uses gnulib, allow overriding libc includes
+- source_filter: "^contrib/libs/libidn/"
+  includes:
+    - alloca.h:     contrib/libs/libidn/gl/alloca.h
+    - error.h:      contrib/libs/libidn/gl/error.h
+    - iconv.h:      contrib/libs/libidn/lib/gl/iconv.h

+ 0 - 17
build/sysincl/misc.yml

@@ -7,16 +7,6 @@
   # DB2_ODBC_CLI
   - sqlcli1.h
 
-
-# We have lots of ADDINCLs to contrib/libs/libiconv all around the repo
-# so we need to add it to sysincl for consistent resolving.
-# We can go the other way here and remove iconv.h from all sysincl configs
-# and try to fix all places where we really need iconv.h from libc
-# Btw: seems that this ADDINCL should be made global and removed from projects
-# that use this header
-- includes:
-    - iconv.h:       contrib/libs/libiconv/include/iconv.h
-
 - includes:
   - cudnn.h:         contrib/libs/nvidia/cudnn/cudnn.h
 
@@ -32,13 +22,6 @@
   includes:
   - Python.h:        contrib/libs/python/Include/Python.h
 
-# libidn uses gnulib, allow overriding libc includes
-- source_filter: "^contrib/libs/libidn/"
-  includes:
-    - alloca.h:     contrib/libs/libidn/gl/alloca.h
-    - error.h:      contrib/libs/libidn/gl/error.h
-    - iconv.h:      contrib/libs/libidn/lib/gl/iconv.h
-
 # Same as libunistring - lftp has own libc header wrappers/replacements.
 # However here we have GLOBAL ADDINCL to contrib/libs/lftp{,/trio,/lib}
 # that can poison resolving in PEERDIRing projects.

+ 13 - 5
contrib/libs/libaio/ya.make

@@ -1,5 +1,7 @@
 # Generated by devtools/yamaker from nixpkgs 22.05.
 
+DEFAULT(USE_AIO ${_USE_AIO})
+
 LIBRARY()
 
 WITHOUT_LICENSE_TEXTS()
@@ -17,10 +19,14 @@ IF (EXPORT_CMAKE)
         CMAKE_TARGET
         AIO::aio
     )
-ELSEIF (USE_DYNAMIC_AIO)
+ELSEIF (USE_AIO == "dynamic")
     PEERDIR(
         contrib/libs/libaio/dynamic
     )
+ELSEIF (USE_AIO == "local")
+    GLOBAL_CFLAGS(${USE_LOCAL_AIO_CFLAGS})
+    DEFAULT(USE_LOCAL_AIO_LDFLAGS -laio)
+    LDFLAGS(${USE_LOCAL_AIO_LDFLAGS})
 ELSE()
     PEERDIR(
         contrib/libs/libaio/static
@@ -29,7 +35,9 @@ ENDIF()
 
 END()
 
-RECURSE(
-    dynamic
-    static
-)
+IF (USE_AIO != "local")
+    RECURSE(
+        dynamic
+        static
+    )
+ENDIF()

+ 30 - 26
contrib/libs/libiconv/ya.make

@@ -8,35 +8,39 @@ WITHOUT_LICENSE_TEXTS()
 
 NO_RUNTIME()
 
-IF (OS_WINDOWS)
-    OPENSOURCE_EXPORT_REPLACEMENT(
-        CMAKE
-        Iconv
-        CMAKE_TARGET
-        Iconv::Iconv
-        CONAN
-        libiconv/1.15
-        CONAN_OPTIONS
-        libiconv:shared=True
-    )
-ELSE()
-    # Opensource code is compatible with libc provided iconv API on major linux distributions and macos.
-    #  * We prefere to avoid vendoring LGPL libraries in our opensouce project
-    #  * Major distributions do not provide GNU libiconv as separate package
-    #  * Shared lib dependencies from conan overcomplicate final artefacts distribution
-    DISABLE(OPENSOURCE_EXPORT)
-ENDIF()
-
-IF (NOT EXPORT_CMAKE)
-    IF (USE_DYNAMIC_ICONV)
-        PEERDIR(
-            contrib/libs/libiconv/dynamic
+DEFAULT(USE_ICONV ${_USE_ICONV})
+
+IF (EXPORT_CMAKE)
+    IF (OS_WINDOWS)
+        OPENSOURCE_EXPORT_REPLACEMENT(
+            CMAKE
+            Iconv
+            CMAKE_TARGET
+            Iconv::Iconv
+            CONAN
+            libiconv/1.15
+            CONAN_OPTIONS
+            libiconv:shared=True
         )
     ELSE()
-        PEERDIR(
-            contrib/libs/libiconv/static
-        )
+        # Opensource code is compatible with libc provided iconv API on major linux distributions and macos.
+        #  * We prefere to avoid vendoring LGPL libraries in our opensouce project
+        #  * Major distributions do not provide GNU libiconv as separate package
+        #  * Shared lib dependencies from conan overcomplicate final artefacts distribution
+        DISABLE(OPENSOURCE_EXPORT)
     ENDIF()
+ELSEIF (USE_ICONV == "dynamic")
+    PEERDIR(
+        contrib/libs/libiconv/dynamic
+    )
+ELSEIF (USE_ICONV == "local")
+    GLOBAL_CFLAGS(${USE_LOCAL_ICONV_CFLAGS})
+
+    # Opensource code is compatible with libc provided iconv API on major linux distributions and macos.
+ELSE()
+    PEERDIR(
+        contrib/libs/libiconv/static
+    )
 ENDIF()
 
 END()

Некоторые файлы не были показаны из-за большого количества измененных файлов