summaryrefslogtreecommitdiffstats
path: root/meta-networking
diff options
context:
space:
mode:
authorYi Zhao <yi.zhao@windriver.com>2018-10-12 16:22:34 +0800
committerKhem Raj <raj.khem@gmail.com>2018-10-12 02:07:52 -0700
commit47a9cc6c5397fbc482e2eb895d1139b1b67aa555 (patch)
tree0b403ee2506024d2ce7436efc8a93778c170edaf /meta-networking
parent69e5fa1485aa58ad1d664070b0d9e4db413fdd62 (diff)
downloadmeta-openembedded-47a9cc6c5397fbc482e2eb895d1139b1b67aa555.tar.gz
postfix: add -lnsl and -lresolv to SYSLIBS by default
When building native package, the do_compile function tries to check libnsl.so and libresolv.so on host machine and add -lnsl and -lresolv to SYSLIBS if they exist. But finally it will link the libnsl.so from ${STAGING_LIBDIR_NATIVE}. Actually there is no need to check them since the libnsl2 is specified in DEPENDS and libresolv.so is from c libarary. So add -lnsl and -lresolv to SYSLIBS directly. Signed-off-by: Yi Zhao <yi.zhao@windriver.com> Signed-off-by: Khem Raj <raj.khem@gmail.com>
Diffstat (limited to 'meta-networking')
-rw-r--r--meta-networking/recipes-daemons/postfix/files/0001-makedefs-add-lnsl-and-lresolv-to-SYSLIBS-by-default.patch58
-rw-r--r--meta-networking/recipes-daemons/postfix/postfix.inc18
-rw-r--r--meta-networking/recipes-daemons/postfix/postfix_3.3.1.bb1
3 files changed, 59 insertions, 18 deletions
diff --git a/meta-networking/recipes-daemons/postfix/files/0001-makedefs-add-lnsl-and-lresolv-to-SYSLIBS-by-default.patch b/meta-networking/recipes-daemons/postfix/files/0001-makedefs-add-lnsl-and-lresolv-to-SYSLIBS-by-default.patch
new file mode 100644
index 000000000..565098400
--- /dev/null
+++ b/meta-networking/recipes-daemons/postfix/files/0001-makedefs-add-lnsl-and-lresolv-to-SYSLIBS-by-default.patch
@@ -0,0 +1,58 @@
1From 4caa18feb70f8f3d133657c1250a53f4e292bb42 Mon Sep 17 00:00:00 2001
2From: Yi Zhao <yi.zhao@windriver.com>
3Date: Fri, 12 Oct 2018 12:38:02 +0800
4Subject: [PATCH] makedefs: add -lnsl and -lresolv to SYSLIBS by default
5
6We don't need to check libnsl.so and libresolv.so since the libnsl2 is
7specified in DEPENDS and libresolv.so is from c libarary.
8
9Upstream-Status: Inappropriate [embedded specific]
10
11Signed-off-by: Yi Zhao <yi.zhao@windriver.com>
12---
13 makedefs | 22 ++--------------------
14 1 file changed, 2 insertions(+), 20 deletions(-)
15
16diff --git a/makedefs b/makedefs
17index 2683bce..8f1b3f4 100644
18--- a/makedefs
19+++ b/makedefs
20@@ -484,16 +484,7 @@ case "$SYSTEM.$RELEASE" in
21 SYSLIBS="$SYSLIBS -ldb"
22 ;;
23 esac
24- for name in nsl resolv $GDBM_LIBS
25- do
26- for lib in $BUILD_SYSROOT_NSL_PATH
27- do
28- test -e $lib/lib$name.a -o -e $lib/lib$name.so && {
29- SYSLIBS="$SYSLIBS -l$name"
30- break
31- }
32- done
33- done
34+ SYSLIBS="$SYSLIBS -lnsl -lresolv"
35 # Kernel 2.4 added IPv6
36 case "$RELEASE" in
37 2.[0-3].*) CCARGS="$CCARGS -DNO_IPV6";;
38@@ -561,16 +552,7 @@ EOF
39 SYSLIBS="$SYSLIBS -ldb"
40 ;;
41 esac
42- for name in nsl resolv
43- do
44- for lib in $BUILD_SYSROOT_NSL_PATH
45- do
46- test -e $lib/lib$name.a -o -e $lib/lib$name.so && {
47- SYSLIBS="$SYSLIBS -l$name"
48- break
49- }
50- done
51- done
52+ SYSLIBS="$SYSLIBS -lnsl -lresolv"
53 SYSLIBS="$SYSLIBS -ldl"
54 : ${SHLIB_SUFFIX=.so}
55 : ${SHLIB_CFLAGS=-fPIC}
56--
572.7.4
58
diff --git a/meta-networking/recipes-daemons/postfix/postfix.inc b/meta-networking/recipes-daemons/postfix/postfix.inc
index 882b27b6e..3d4f1df43 100644
--- a/meta-networking/recipes-daemons/postfix/postfix.inc
+++ b/meta-networking/recipes-daemons/postfix/postfix.inc
@@ -97,27 +97,9 @@ do_compile () {
97 "s:\$(SHELL) makedefs):\$(SHELL) makedefs $SYSTEM $RELEASE):" \ 97 "s:\$(SHELL) makedefs):\$(SHELL) makedefs $SYSTEM $RELEASE):" \
98 ${S}/Makefile.in 98 ${S}/Makefile.in
99 export BUILD_SYSROOT="${STAGING_DIR_HOST}" 99 export BUILD_SYSROOT="${STAGING_DIR_HOST}"
100 export BUILD_SYSROOT_NSL_PATH="${STAGING_BASELIBDIR} \
101 ${STAGING_LIBDIR}"
102 else 100 else
103 # native build 101 # native build
104 export BUILD_SYSROOT="${STAGING_DIR_NATIVE}" 102 export BUILD_SYSROOT="${STAGING_DIR_NATIVE}"
105
106 # ubuntu x86 host: /lib/x86_64-linux-gnu(64) /lib/i386-linux-gnu (32)
107 # on 64 bits, 32 libs in i386-linux-gnu
108 # let makedefs finds nsl and resolv libs, host CC will link
109 # the correct libraries
110 BUILD_SYSROOT_NSL_PATH="$(${CC} -print-search-dirs 2>/dev/null | \
111 sed -n '/^libraries: =/s/libraries: =//p' | \
112 sed -e 's/:/\n/g' | xargs -n1 readlink -f | \
113 grep -v 'gcc\|/[0-9.]\+$' | sort -u)"
114 if [ -z "$BUILD_SYSROOT_NSL_PATH" ]; then
115 BUILD_SYSROOT_NSL_PATH="/usr/lib64 /lib64 \
116 /lib/x86_64-linux-gnu \
117 /usr/lib /lib \
118 /lib/i386-linux-gnu"
119 fi
120 export BUILD_SYSROOT_NSL_PATH
121 fi 103 fi
122 104
123 oe_runmake makefiles 105 oe_runmake makefiles
diff --git a/meta-networking/recipes-daemons/postfix/postfix_3.3.1.bb b/meta-networking/recipes-daemons/postfix/postfix_3.3.1.bb
index 960356999..6718b7ef9 100644
--- a/meta-networking/recipes-daemons/postfix/postfix_3.3.1.bb
+++ b/meta-networking/recipes-daemons/postfix/postfix_3.3.1.bb
@@ -3,6 +3,7 @@ require postfix.inc
3SRC_URI += "file://0001-makedefs-Use-native-compiler-to-build-makedefs.test.patch \ 3SRC_URI += "file://0001-makedefs-Use-native-compiler-to-build-makedefs.test.patch \
4 file://postfix-install.patch \ 4 file://postfix-install.patch \
5 file://icu-config.patch \ 5 file://icu-config.patch \
6 file://0001-makedefs-add-lnsl-and-lresolv-to-SYSLIBS-by-default.patch \
6 " 7 "
7 8
8SRC_URI[md5sum] = "4381c6492f415e4a69cf5099d4acea76" 9SRC_URI[md5sum] = "4381c6492f415e4a69cf5099d4acea76"