1595f6308SAndrew GeisslerFrom 9000ee4d8bb5c5e0bcc588e9bec86eb56f4285e1 Mon Sep 17 00:00:00 2001 2595f6308SAndrew GeisslerFrom: Li xin <lixin.fnst@cn.fujitsu.com> 3595f6308SAndrew GeisslerDate: Fri, 19 Jun 2015 16:45:54 +0900 4595f6308SAndrew GeisslerSubject: [PATCH] Fix makedefs 5595f6308SAndrew Geissler 6595f6308SAndrew Geissler1)remove RANLIB, SYSLIBS, AR and get them from env. 7595f6308SAndrew Geissler2)reference sysroot when searching header files 8595f6308SAndrew Geissler3)include sysroot path instead of absolute include path 9595f6308SAndrew Geisslerfor Linux2 and Linux3 systems. 10595f6308SAndrew Geissler4)for non-native build, search STAGING_BASELIBDIR/LIBDIR 11595f6308SAndrew Geissler native build, search host library path for nsl and resolv library 12595f6308SAndrew Geissler which comes from libc 13595f6308SAndrew Geissler 14*520786ccSPatrick WilliamsUpstream-Status: Inappropriate [embedded specific] 15595f6308SAndrew Geissler 16595f6308SAndrew GeisslerSigned-off-by: Yao Zhao <yao.zhao@windriver.com> 17595f6308SAndrew Geissler--- 18595f6308SAndrew Geissler makedefs | 27 +++++++++++---------------- 19595f6308SAndrew Geissler 1 file changed, 11 insertions(+), 16 deletions(-) 20595f6308SAndrew Geissler 21595f6308SAndrew Geisslerdiff --git a/makedefs b/makedefs 22595f6308SAndrew Geisslerindex 3448c1e..78e0717 100644 23595f6308SAndrew Geissler--- a/makedefs 24595f6308SAndrew Geissler+++ b/makedefs 25595f6308SAndrew Geissler@@ -197,9 +197,6 @@ echo "# pie=$pie" 26595f6308SAndrew Geissler 27595f6308SAndrew Geissler # Defaults for most sane systems 28595f6308SAndrew Geissler 29595f6308SAndrew Geissler-RANLIB=ranlib 30595f6308SAndrew Geissler-SYSLIBS= 31595f6308SAndrew Geissler-AR=ar 32595f6308SAndrew Geissler ARFL=rv 33595f6308SAndrew Geissler 34595f6308SAndrew Geissler # Ugly function to make our error message more visible among the 35595f6308SAndrew Geissler@@ -492,12 +489,12 @@ case "$SYSTEM.$RELEASE" in 36595f6308SAndrew Geissler case "$CCARGS" in 37595f6308SAndrew Geissler *-DNO_DB*) ;; 38595f6308SAndrew Geissler *-DHAS_DB*) ;; 39595f6308SAndrew Geissler- *) if [ -f /usr/include/db.h ] 40595f6308SAndrew Geissler+ *) if [ -f "$BUILD_SYSROOT"/usr/include/db.h ] 41595f6308SAndrew Geissler then 42595f6308SAndrew Geissler : we are all set 43595f6308SAndrew Geissler- elif [ -f /usr/include/db/db.h ] 44595f6308SAndrew Geissler+ elif [ -f "$BUILD_SYSROOT"/usr/include/db/db.h ] 45595f6308SAndrew Geissler then 46595f6308SAndrew Geissler- CCARGS="$CCARGS -I/usr/include/db" 47595f6308SAndrew Geissler+ CCARGS="$CCARGS -I"$BUILD_SYSROOT"/usr/include/db" 48595f6308SAndrew Geissler else 49595f6308SAndrew Geissler # No, we're not going to try db1 db2 db3 etc. 50595f6308SAndrew Geissler # On a properly installed system, Postfix builds 51595f6308SAndrew Geissler@@ -506,12 +503,12 @@ case "$SYSTEM.$RELEASE" in 52595f6308SAndrew Geissler echo "Install the appropriate db*-devel package first." 1>&2 53595f6308SAndrew Geissler exit 1 54595f6308SAndrew Geissler fi 55595f6308SAndrew Geissler- SYSLIBS="-ldb" 56595f6308SAndrew Geissler+ SYSLIBS="$SYSLIBS -ldb" 57595f6308SAndrew Geissler ;; 58595f6308SAndrew Geissler esac 59595f6308SAndrew Geissler for name in nsl resolv $GDBM_LIBS 60595f6308SAndrew Geissler do 61595f6308SAndrew Geissler- for lib in /usr/lib64 /lib64 /usr/lib /lib 62595f6308SAndrew Geissler+ for lib in $BUILD_SYSROOT_NSL_PATH 63595f6308SAndrew Geissler do 64595f6308SAndrew Geissler test -e $lib/lib$name.a -o -e $lib/lib$name.so && { 65595f6308SAndrew Geissler SYSLIBS="$SYSLIBS -l$name" 66595f6308SAndrew Geissler@@ -531,7 +528,7 @@ case "$SYSTEM.$RELEASE" in 67595f6308SAndrew Geissler if [ `expr "X$CCARGS" : "X.*-DNO_EPOLL"` -gt 0 ] 68595f6308SAndrew Geissler then 69595f6308SAndrew Geissler : 70595f6308SAndrew Geissler- elif [ ! -e /usr/include/sys/epoll.h ] 71595f6308SAndrew Geissler+ elif [ ! -e "$BUILD_SYSROOT"/usr/include/sys/epoll.h ] 72595f6308SAndrew Geissler then 73595f6308SAndrew Geissler echo CCARGS="$CCARGS -DNO_EPOLL" 74595f6308SAndrew Geissler else 75595f6308SAndrew Geissler@@ -555,8 +552,6 @@ int main(int argc, char **argv) 76595f6308SAndrew Geissler } 77595f6308SAndrew Geissler EOF 78595f6308SAndrew Geissler ${CC-gcc} -o makedefs.test makedefs.test.c || exit 1 79595f6308SAndrew Geissler- ./makedefs.test 2>/dev/null || 80595f6308SAndrew Geissler- CCARGS="$CCARGS -DNO_EPOLL" 81595f6308SAndrew Geissler rm -f makedefs.test makedefs.test.[co] 82595f6308SAndrew Geissler fi;; 83595f6308SAndrew Geissler esac 84595f6308SAndrew Geissler@@ -572,12 +567,12 @@ EOF 85595f6308SAndrew Geissler case "$CCARGS" in 86595f6308SAndrew Geissler *-DNO_DB*) ;; 87595f6308SAndrew Geissler *-DHAS_DB*) ;; 88595f6308SAndrew Geissler- *) if [ -f /usr/include/db.h ] 89595f6308SAndrew Geissler+ *) if [ -f "$BUILD_SYSROOT"/usr/include/db.h ] 90595f6308SAndrew Geissler then 91595f6308SAndrew Geissler : we are all set 92595f6308SAndrew Geissler- elif [ -f /usr/include/db/db.h ] 93595f6308SAndrew Geissler+ elif [ -f "$BUILD_SYSROOT"/usr/include/db/db.h ] 94595f6308SAndrew Geissler then 95595f6308SAndrew Geissler- CCARGS="$CCARGS -I/usr/include/db" 96595f6308SAndrew Geissler+ CCARGS="$CCARGS -I"$BUILD_SYSROOT"/usr/include/db" 97595f6308SAndrew Geissler else 98595f6308SAndrew Geissler # On a properly installed system, Postfix builds 99595f6308SAndrew Geissler # by including <db.h> and by linking with -ldb 100595f6308SAndrew Geissler@@ -585,12 +580,12 @@ EOF 101595f6308SAndrew Geissler echo "Install the appropriate db*-devel package first." 1>&2 102595f6308SAndrew Geissler exit 1 103595f6308SAndrew Geissler fi 104595f6308SAndrew Geissler- SYSLIBS="-ldb" 105595f6308SAndrew Geissler+ SYSLIBS="$SYSLIBS -ldb" 106595f6308SAndrew Geissler ;; 107595f6308SAndrew Geissler esac 108595f6308SAndrew Geissler for name in nsl resolv 109595f6308SAndrew Geissler do 110595f6308SAndrew Geissler- for lib in /usr/lib64 /lib64 /usr/lib /usr/lib/* /lib /lib/* 111595f6308SAndrew Geissler+ for lib in $BUILD_SYSROOT_NSL_PATH 112595f6308SAndrew Geissler do 113595f6308SAndrew Geissler test -e $lib/lib$name.a -o -e $lib/lib$name.so && { 114595f6308SAndrew Geissler SYSLIBS="$SYSLIBS -l$name" 115595f6308SAndrew Geissler-- 116595f6308SAndrew Geissler2.17.1 117595f6308SAndrew Geissler 118