aboutsummaryrefslogtreecommitdiffstats
path: root/meta-networking/recipes-daemons/postfix/files/makedefs.patch
blob: ea1e994b03c573077f577d720f290f3eed02e427 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
1)remove RANLIB, SYSLIBS, AR and get them from env.

2)reference sysroot when searching header files
3)include sysroot path instead of absolute include path
for Linux2 and Linux3 systems.
4)for non-native build, search STAGING_BASELIBDIR/LIBDIR
  native build, search host library path for nsl and resolv library
  which comes from libc

Upstreamstatus: Inappropriate [embedded specific]

Signed-off-by: Yao Zhao <yao.zhao@windriver.com>

5)add Linux 4.0 support

--- a/makedefs	2015-05-30 13:38:50.346033228 +0200
+++ b/makedefs	2015-05-30 13:40:19.375364795 +0200
@@ -87,9 +87,6 @@

 # Defaults for most sane systems

-RANLIB=ranlib
-SYSLIBS=
-AR=ar
 ARFL=rv

 # Ugly function to make our error message more visible among the
@@ -293,12 +290,12 @@ case "$SYSTEM.$RELEASE" in
 		case "$CCARGS" in
 		 *-DNO_DB*) ;;
 		 *-DHAS_DB*) ;;
-		 *) if [ -f /usr/include/db.h ]
+		 *) if [ -f "$BUILD_SYSROOT"/usr/include/db.h ]
 		    then
 			: we are all set
-		    elif [ -f /usr/include/db/db.h ]
+		    elif [ -f "$BUILD_SYSROOT"/usr/include/db/db.h ]
 		    then
-			CCARGS="$CCARGS -I/usr/include/db"
+			CCARGS="$CCARGS -I"$BUILD_SYSROOT"/usr/include/db"
 		    else
 			# No, we're not going to try db1 db2 db3 etc.
 			# On a properly installed system, Postfix builds
@@ -307,12 +304,12 @@ case "$SYSTEM.$RELEASE" in
 			echo "Install the appropriate db*-devel package first." 1>&2
 			exit 1
 		    fi
-		    SYSLIBS="-ldb"
+		    SYSLIBS="$SYSLIBS -ldb"
 		    ;;
 		esac
 		for name in nsl resolv $GDBM_LIBS
 		do
-		    for lib in /usr/lib64 /lib64 /usr/lib /lib
+		    for lib in $BUILD_SYSROOT_NSL_PATH
 		    do
 			test -e $lib/lib$name.a -o -e $lib/lib$name.so && {
 			    SYSLIBS="$SYSLIBS -l$name"
@@ -332,7 +329,7 @@ case "$SYSTEM.$RELEASE" in
 		       if [ `expr "X$CCARGS" : "X.*-DNO_EPOLL"` -gt 0 ]
 		       then
 			   :
-		       elif [ ! -e /usr/include/sys/epoll.h ]
+		       elif [ ! -e "$BUILD_SYSROOT"/usr/include/sys/epoll.h ]
 		       then
 			   echo CCARGS="$CCARGS -DNO_EPOLL"
 		       else
@@ -356,22 +353,20 @@
 }
 EOF
 			   ${CC-gcc} -o makedefs.test makedefs.test.c || exit 1
-			   ./makedefs.test 2>/dev/null ||
-				CCARGS="$CCARGS -DNO_EPOLL"
 			   rm -f makedefs.test makedefs.test.[co]
 		       fi;;
 		esac
 		;;
-    Linux.3*)	SYSTYPE=LINUX3
+    Linux.3*|Linux.4*)	SYSTYPE=LINUX3
 		case "$CCARGS" in
 		 *-DNO_DB*) ;;
 		 *-DHAS_DB*) ;;
-		 *) if [ -f /usr/include/db.h ]
+		 *) if [ -f "$BUILD_SYSROOT"/usr/include/db.h ]
 		    then
 			: we are all set
-		    elif [ -f /usr/include/db/db.h ]
+		    elif [ -f "$BUILD_SYSROOT"/usr/include/db/db.h ]
 		    then
-			CCARGS="$CCARGS -I/usr/include/db"
+			CCARGS="$CCARGS -I"$BUILD_SYSROOT"/usr/include/db"
 		    else
 			# On a properly installed system, Postfix builds
 			# by including <db.h> and by linking with -ldb
@@ -379,7 +374,7 @@ EOF
 			echo "Install the appropriate db*-devel package first." 1>&2
 			exit 1
 		    fi
-		    SYSLIBS="-ldb"
+		    SYSLIBS="$SYSLIBS -ldb"
 		    ;;
 		esac
 		for name in nsl resolv
@@ -415,7 +410,7 @@ EOF
 		esac
 		for name in nsl resolv
 		do
-		    for lib in /usr/lib64 /lib64 /usr/lib /lib
+		    for lib in $BUILD_SYSROOT_NSL_PATH
 		    do
 			test -e $lib/lib$name.a -o -e $lib/lib$name.so && {
 			    SYSLIBS="$SYSLIBS -l$name"