From 192c0b406d19b488fe83b055ced358f41de0ccc5 Mon Sep 17 00:00:00 2001 From: Roger Pau Monne Date: Thu, 1 Mar 2012 16:59:33 +0000 Subject: build: autoconf: fix libdir detection If user specifies a libdir it is used, if no libdir is specified configure checks if $exec_prefix/lib64 is a directory and uses that, if not lib is used. $prefix is set by passing the command line option or by default when calling AC_OUTPUT, but since AC_OUTPUT is called at the end, this is not really helpful, so we have to set $exec_prefix manually to the correct value, either $prefix if different than NONE or $ac_default_prefix. Signed-off-by: Roger Pau Monne Committed-by: Ian Jackson --- tools/m4/default_lib.m4 | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) (limited to 'tools/m4') diff --git a/tools/m4/default_lib.m4 b/tools/m4/default_lib.m4 index b551619205..2e986836d8 100644 --- a/tools/m4/default_lib.m4 +++ b/tools/m4/default_lib.m4 @@ -1,8 +1,14 @@ AC_DEFUN([AX_DEFAULT_LIB], -[AS_IF([test -d "$prefix/lib64"], [ - LIB_PATH="lib64" -],[ - LIB_PATH="lib" +[AS_IF([test "\${exec_prefix}/lib" = "$libdir"], + [AS_IF([test "$exec_prefix" = "NONE" && test "$prefix" != "NONE"], + [exec_prefix=$prefix]) + AS_IF([test "$exec_prefix" = "NONE"], [exec_prefix=$ac_default_prefix]) + AS_IF([test -d "${exec_prefix}/lib64"], [ + LIB_PATH="lib64" + ],[ + LIB_PATH="lib" + ]) +], [ + LIB_PATH="${libdir:`expr length "$exec_prefix" + 1`}" ]) AC_SUBST(LIB_PATH)]) - -- cgit v1.2.3