From 2b9925c1bf961379e7540009abf75280084d32c5 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Franti=C5=A1ek=20Dvo=C5=99=C3=A1k?= Date: Wed, 29 Apr 2009 08:35:59 +0000 Subject: [PATCH] Search so-library in both places - mysql and mysql-devel. Move the script from Makefile to the separate file to easier debugging. --- org.glite.lbjp-common.db/Makefile | 2 +- org.glite.lbjp-common.db/project/get_soname.sh | 21 +++++++++++++++++++++ 2 files changed, 22 insertions(+), 1 deletion(-) create mode 100755 org.glite.lbjp-common.db/project/get_soname.sh diff --git a/org.glite.lbjp-common.db/Makefile b/org.glite.lbjp-common.db/Makefile index 1d0ce81..265a056 100644 --- a/org.glite.lbjp-common.db/Makefile +++ b/org.glite.lbjp-common.db/Makefile @@ -32,7 +32,7 @@ ifeq (${host_cpu},x86_64) archlib:=lib64 endif -MYSQL_SONAME:=$(shell lib=""; for dir in ${archlib} ${archlib}/mysql lib lib/mysql; do l=`find ${mysql-devel_prefix}/$$dir -maxdepth 1 -name libmysqlclient.so* | head -n 1`; if [ -f "$$l" ]; then lib=$$l; break; fi ; done; if [ x != x$$lib ]; then readelf -d $$lib | grep SONAME | sed 's/.*\(libmysqlclient.so.[0-9]\{1,\}\).*/\1/'; else echo notfound; fi ) +MYSQL_SONAME:=$(shell ../project/get_soname.sh ${mysql-devel_prefix}/${archlib} ${mysql_prefix}/${archlib} ${mysql-devel_prefix}/lib ${mysql_prefix}/lib) MYSQL_CPPFLAGS:=-I${mysql-devel_prefix}/include -I${mysql-devel_prefix}/include/mysql -DMYSQL_SONAME=\"${MYSQL_SONAME}\" MYSQL_LIBS=-lz diff --git a/org.glite.lbjp-common.db/project/get_soname.sh b/org.glite.lbjp-common.db/project/get_soname.sh new file mode 100755 index 0000000..d5f41b3 --- /dev/null +++ b/org.glite.lbjp-common.db/project/get_soname.sh @@ -0,0 +1,21 @@ +#! /bin/sh + +lib="" +for prefix in $@; do + for dir in "$prefix" "$prefix/mysql"; do + l=`find $dir -maxdepth 1 -name libmysqlclient.so* | head -n 1` + if [ -f "$l" ]; then + lib=$l + break + fi + done + if [ x"" != x"$lib" ]; then + break + fi +done + +if [ x"" != x"$lib" ]; then + readelf -d $lib | grep SONAME | sed 's/.*\(libmysqlclient.so.[0-9]\{1,\}\).*/\1/' +else + echo notfound +fi -- 1.8.2.3