aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorsnermolaev <snermolaev@yandex-team.com>2023-11-17 06:58:50 +0300
committersnermolaev <snermolaev@yandex-team.com>2023-11-17 07:26:08 +0300
commitef05dd5da576f90723bf75661c1efcabd9b6a3fd (patch)
tree7a40e460b01ba8012c883fad9827272d19edc575
parent32b5c7f0dc79d7273495e0c99ca3d740c6bd3692 (diff)
downloadydb-ef05dd5da576f90723bf75661c1efcabd9b6a3fd.tar.gz
suport for use of local libaio, libiconv, libidn
-rw-r--r--build/conf/opensource.conf6
-rw-r--r--build/conf/sysincl.conf18
-rw-r--r--build/sysincl/libaio-to-nothing.yml2
-rw-r--r--build/sysincl/libiconv-to-nothing.yml2
-rw-r--r--build/sysincl/libiconv.yml8
-rw-r--r--build/sysincl/libidn-to-nothing.yml9
-rw-r--r--build/sysincl/libidn.yml6
-rw-r--r--build/sysincl/misc.yml17
-rw-r--r--contrib/libs/libaio/ya.make18
-rw-r--r--contrib/libs/libiconv/ya.make56
-rw-r--r--contrib/libs/libidn/ya.make18
-rw-r--r--library/cpp/charset/ya.make2
12 files changed, 105 insertions, 57 deletions
diff --git a/build/conf/opensource.conf b/build/conf/opensource.conf
index a943b26a4f..f7047176d3 100644
--- a/build/conf/opensource.conf
+++ b/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
}
diff --git a/build/conf/sysincl.conf b/build/conf/sysincl.conf
index 8ad19b9964..933bcc3d73 100644
--- a/build/conf/sysincl.conf
+++ b/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
}
diff --git a/build/sysincl/libaio-to-nothing.yml b/build/sysincl/libaio-to-nothing.yml
new file mode 100644
index 0000000000..3658d1ad39
--- /dev/null
+++ b/build/sysincl/libaio-to-nothing.yml
@@ -0,0 +1,2 @@
+- includes:
+ - libaio.h
diff --git a/build/sysincl/libiconv-to-nothing.yml b/build/sysincl/libiconv-to-nothing.yml
new file mode 100644
index 0000000000..8d853cbf5f
--- /dev/null
+++ b/build/sysincl/libiconv-to-nothing.yml
@@ -0,0 +1,2 @@
+- includes:
+ - iconv.h
diff --git a/build/sysincl/libiconv.yml b/build/sysincl/libiconv.yml
new file mode 100644
index 0000000000..839e5ac3d3
--- /dev/null
+++ b/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
diff --git a/build/sysincl/libidn-to-nothing.yml b/build/sysincl/libidn-to-nothing.yml
new file mode 100644
index 0000000000..d6bba20386
--- /dev/null
+++ b/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
diff --git a/build/sysincl/libidn.yml b/build/sysincl/libidn.yml
new file mode 100644
index 0000000000..11dac9f662
--- /dev/null
+++ b/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
diff --git a/build/sysincl/misc.yml b/build/sysincl/misc.yml
index d9dc0a33f9..75aaf54917 100644
--- a/build/sysincl/misc.yml
+++ b/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.
diff --git a/contrib/libs/libaio/ya.make b/contrib/libs/libaio/ya.make
index 1c3137f630..37000691cd 100644
--- a/contrib/libs/libaio/ya.make
+++ b/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()
diff --git a/contrib/libs/libiconv/ya.make b/contrib/libs/libiconv/ya.make
index f8e7fdce5c..629f048083 100644
--- a/contrib/libs/libiconv/ya.make
+++ b/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()
diff --git a/contrib/libs/libidn/ya.make b/contrib/libs/libidn/ya.make
index 1685231bbc..9eaf83a4ba 100644
--- a/contrib/libs/libidn/ya.make
+++ b/contrib/libs/libidn/ya.make
@@ -1,5 +1,7 @@
# Generated by devtools/yamaker from nixpkgs 22.05.
+DEFAULT(USE_IDN ${_USE_IDN})
+
LIBRARY()
WITHOUT_LICENSE_TEXTS()
@@ -19,10 +21,14 @@ IF (EXPORT_CMAKE)
CMAKE_TARGET
IDN::IDN
)
-ELSEIF (USE_DYNAMIC_IDN)
+ELSEIF (USE_IDN == "dynamic")
PEERDIR(
contrib/libs/libidn/dynamic
)
+ELSEIF (USE_IDN == "local")
+ GLOBAL_CFLAGS(${USE_LOCAL_IDN_CFLAGS})
+ DEFAULT(USE_LOCAL_IDN_LDFLAGS -lidn)
+ LDFLAGS(${USE_LOCAL_IDN_LDFLAGS})
ELSE()
PEERDIR(
contrib/libs/libidn/static
@@ -31,7 +37,9 @@ ENDIF()
END()
-RECURSE(
- dynamic
- static
-)
+IF (USE_IDN != "local")
+ RECURSE(
+ dynamic
+ static
+ )
+ENDIF()
diff --git a/library/cpp/charset/ya.make b/library/cpp/charset/ya.make
index 6c03d98450..acb13db400 100644
--- a/library/cpp/charset/ya.make
+++ b/library/cpp/charset/ya.make
@@ -1,6 +1,6 @@
LIBRARY()
-IF (NOT OPENSOURCE)
+IF (NOT OPENSOURCE AND USE_ICONV != "local")
CXXFLAGS(-DUSE_ICONV_EXTENSIONS)
ENDIF()