blob: 98d5f7ed60ab2542d312caf9fcc73c317c96d6e8 [file] [log] [blame]
Patrick Williamsb48b7b42016-08-17 15:04:38 -05001From 4f49e2ce420fb3c17415937530493158ef312733 Mon Sep 17 00:00:00 2001
2From: Li xin <lixin.fnst@cn.fujitsu.com>
3Date: Fri, 19 Jun 2015 16:45:54 +0900
4Subject: [PATCH] 1)remove RANLIB, SYSLIBS, AR and get them from env.
5
62)reference sysroot when searching header files
73)include sysroot path instead of absolute include path
8for Linux2 and Linux3 systems.
94)for non-native build, search STAGING_BASELIBDIR/LIBDIR
10 native build, search host library path for nsl and resolv library
11 which comes from libc
12
13Upstreamstatus: Inappropriate [embedded specific]
14
15Signed-off-by: Yao Zhao <yao.zhao@windriver.com>
16---
17 makedefs | 27 +++++++++++----------------
18 1 file changed, 11 insertions(+), 16 deletions(-)
19
20diff --git a/makedefs b/makedefs
21index 8b84e47..893fb0d 100644
22--- a/makedefs
23+++ b/makedefs
24@@ -170,9 +170,6 @@ echo "# pie=$pie"
25
26 # Defaults for most sane systems
27
28-RANLIB=ranlib
29-SYSLIBS=
30-AR=ar
31 ARFL=rv
32
33 # Ugly function to make our error message more visible among the
34@@ -424,12 +421,12 @@ case "$SYSTEM.$RELEASE" in
35 case "$CCARGS" in
36 *-DNO_DB*) ;;
37 *-DHAS_DB*) ;;
38- *) if [ -f /usr/include/db.h ]
39+ *) if [ -f "$BUILD_SYSROOT"/usr/include/db.h ]
40 then
41 : we are all set
42- elif [ -f /usr/include/db/db.h ]
43+ elif [ -f "$BUILD_SYSROOT"/usr/include/db/db.h ]
44 then
45- CCARGS="$CCARGS -I/usr/include/db"
46+ CCARGS="$CCARGS -I"$BUILD_SYSROOT"/usr/include/db"
47 else
48 # No, we're not going to try db1 db2 db3 etc.
49 # On a properly installed system, Postfix builds
50@@ -438,12 +435,12 @@ case "$SYSTEM.$RELEASE" in
51 echo "Install the appropriate db*-devel package first." 1>&2
52 exit 1
53 fi
54- SYSLIBS="-ldb"
55+ SYSLIBS="$SYSLIBS -ldb"
56 ;;
57 esac
58 for name in nsl resolv $GDBM_LIBS
59 do
60- for lib in /usr/lib64 /lib64 /usr/lib /lib
61+ for lib in $BUILD_SYSROOT_NSL_PATH
62 do
63 test -e $lib/lib$name.a -o -e $lib/lib$name.so && {
64 SYSLIBS="$SYSLIBS -l$name"
65@@ -463,7 +460,7 @@ case "$SYSTEM.$RELEASE" in
66 if [ `expr "X$CCARGS" : "X.*-DNO_EPOLL"` -gt 0 ]
67 then
68 :
69- elif [ ! -e /usr/include/sys/epoll.h ]
70+ elif [ ! -e "$BUILD_SYSROOT"/usr/include/sys/epoll.h ]
71 then
72 echo CCARGS="$CCARGS -DNO_EPOLL"
73 else
74@@ -487,8 +484,6 @@ int main(int argc, char **argv)
75 }
76 EOF
77 ${CC-gcc} -o makedefs.test makedefs.test.c || exit 1
78- ./makedefs.test 2>/dev/null ||
79- CCARGS="$CCARGS -DNO_EPOLL"
80 rm -f makedefs.test makedefs.test.[co]
81 fi;;
82 esac
83@@ -504,12 +499,12 @@ EOF
84 case "$CCARGS" in
85 *-DNO_DB*) ;;
86 *-DHAS_DB*) ;;
87- *) if [ -f /usr/include/db.h ]
88+ *) if [ -f "$BUILD_SYSROOT"/usr/include/db.h ]
89 then
90 : we are all set
91- elif [ -f /usr/include/db/db.h ]
92+ elif [ -f "$BUILD_SYSROOT"/usr/include/db/db.h ]
93 then
94- CCARGS="$CCARGS -I/usr/include/db"
95+ CCARGS="$CCARGS -I"$BUILD_SYSROOT"/usr/include/db"
96 else
97 # On a properly installed system, Postfix builds
98 # by including <db.h> and by linking with -ldb
99@@ -517,12 +512,12 @@ EOF
100 echo "Install the appropriate db*-devel package first." 1>&2
101 exit 1
102 fi
103- SYSLIBS="-ldb"
104+ SYSLIBS="$SYSLIBS -ldb"
105 ;;
106 esac
107 for name in nsl resolv
108 do
109- for lib in /usr/lib64 /lib64 /usr/lib /usr/lib/* /lib /lib/*
110+ for lib in $BUILD_SYSROOT_NSL_PATH
111 do
112 test -e $lib/lib$name.a -o -e $lib/lib$name.so && {
113 SYSLIBS="$SYSLIBS -l$name"
114--
1151.8.4.2
116