357314b906789a0a749bed5bb4f5da3ea5484eea
[manu/libnss-mysql-bg.git] / debian / patches / 05_fix_acinclude
1 Index: libnss-mysql-bg-1.5/acinclude.m4
2 ===================================================================
3 --- libnss-mysql-bg-1.5.orig/acinclude.m4       2012-04-18 10:20:01.205313859 +0200
4 +++ libnss-mysql-bg-1.5/acinclude.m4    2012-04-18 11:18:19.681344131 +0200
5 @@ -50,6 +50,7 @@
6  fi
7  
8  AC_MSG_CHECKING([for MySQL libraries])
9 +
10  dnl Check for share first, then static, such that static
11  dnl will take precedence
12  for f in $baselist; do
13 @@ -80,6 +81,19 @@
14      fi
15  done
16  
17 +dnl Get dir from mysql_config (for multi-arch libs)
18 +MYSQL_CONFIG=`which mysql_config`
19 +if test -n "$MYSQL_CONFIG" -a -x "$MYSQL_CONFIG"
20 +then
21 +    MYSQL_LIB_DIR=`$MYSQL_CONFIG --variable=pkglibdir`
22 +dnl Old versions of mysql_config does not have "--variable" option
23 +    if test $? -ne 0
24 +    then
25 +        MYSQL_LIB_DIR=`mysql_config --libs | sed 's/^.*-L\([^ ]\+\).*$/\1/'`
26 +    fi
27 +fi
28 +
29 +
30  if test -n "$MYSQL_LIB_DIR"
31  then
32      AC_MSG_RESULT([$MYSQL_LIB_DIR])