Merged features/mp-sched -r8915:9335 into the trunk. The trunk now
[debian/gnuradio] / config / gr_lib64.m4
1 dnl
2 dnl Copyright 2005,2008 Free Software Foundation, Inc.
3 dnl 
4 dnl This file is part of GNU Radio
5 dnl 
6 dnl GNU Radio is free software; you can redistribute it and/or modify
7 dnl it under the terms of the GNU General Public License as published by
8 dnl the Free Software Foundation; either version 3, or (at your option)
9 dnl any later version.
10 dnl 
11 dnl GNU Radio is distributed in the hope that it will be useful,
12 dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
13 dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14 dnl GNU General Public License for more details.
15 dnl 
16 dnl You should have received a copy of the GNU General Public License
17 dnl along with GNU Radio; see the file COPYING.  If not, write to
18 dnl the Free Software Foundation, Inc., 51 Franklin Street,
19 dnl Boston, MA 02110-1301, USA.
20 dnl 
21
22 # GR_LIB64()
23 #
24 # Checks to see if we're on a x86_64 or powerpc64 machine, and if so, detemine
25 # if libdir should end in "64" or not.
26
27 # May append "64" to libdir.
28 # Sets gr_libdir_suffix to "" or "64"
29 #
30 AC_DEFUN([GR_LIB64],[
31   AC_REQUIRE([AC_CANONICAL_HOST])
32   AC_REQUIRE([AC_PROG_CXX])
33
34   # If we're using g++, extract the first SEARCH_DIR("...") entry from the linker script
35   # and see if it contains a suffix after the final .../lib part of the path.
36   # (This works because the linker script varies depending on whether we're generating
37   # 32-bit or 64-bit executables)
38
39   AC_MSG_CHECKING([libdir suffix])
40   if test "$ac_cv_cxx_compiler_gnu" = "yes";
41   then
42     gr_libdir_suffix=`$CXX -Wl,--verbose 2>/dev/null | sed -n -e '/SEARCH_DIR/{s/;.*$//; s,^.*/,,; s/".*$//; s/^lib//; p}'`
43   fi
44   AC_MSG_RESULT([$gr_libdir_suffix])
45   AC_SUBST(gr_libdir_suffix)
46
47   if test "$host_cpu" = "x86_64" || test "$host_cpu" = "powerpc64" ; then
48     AC_MSG_CHECKING([libdir for lib64 suffix])
49     t=${libdir##*/lib}
50     if test "$t" != 64 && test "$gr_libdir_suffix" = "64"; then
51       libdir=${libdir}64
52       AC_MSG_RESULT([no. Setting libdir to $libdir])
53     else
54       AC_MSG_RESULT([yes])
55     fi
56   fi
57 ])