From: Maynard J. <may...@us...> - 2007-05-31 15:33:20
|
Update of /cvsroot/oprofile/oprofile/m4 In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv8295/oprofile/m4 Modified Files: cellspubfdsupport.m4 Log Message: Fixups for compile failures on older Linux distributions Index: cellspubfdsupport.m4 =================================================================== RCS file: /cvsroot/oprofile/oprofile/m4/cellspubfdsupport.m4,v retrieving revision 1.1 retrieving revision 1.2 diff -u -p -d -r1.1 -r1.2 --- cellspubfdsupport.m4 10 May 2007 23:33:07 -0000 1.1 +++ cellspubfdsupport.m4 31 May 2007 15:33:18 -0000 1.2 @@ -5,29 +5,38 @@ AC_DEFUN([AX_CELL_SPU], # SPU profiles. To parse embedded SPU ELF on Cell BE, OProfile requires a # version of bfd_openr_iovec that supports the elf32-spu target. # This version of the function also has a 7th parameter that's been added. -# We use a temporary test program below that passes 7 arguments to +# First, we check for existence of the base bfd_openr_iovec. If it exists, +# we then use a temporary test program below that passes 7 arguments to # bfd_openr_iovec; if it compiles OK, we assume we have the right BFD # library to support Cell BE SPU profiling. -AC_MSG_CHECKING([whether bfd_openr_iovec has seven parameters]) +AC_LANG_PUSH(C) SAVE_LIBS=$LIBS LIBS=" -lbfd -liberty " -AC_LANG_PUSH(C) -AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include <bfd.h> - #include <stdlib.h> -], - [[struct bfd *nbfd = bfd_openr_iovec("some-file", "elf32-spu", - NULL, NULL, NULL, NULL, NULL); - return 0; -]])], -[AC_DEFINE([HAVE_BFD_OPENR_IOVEC_WITH_7PARMS], - [], - [Defined if you have the version of bfd_openr_iovec with 7 parameters]) -bfd_open_iovec_7="yes" -AC_MSG_RESULT([yes])], -[AC_MSG_RESULT([no])] + +AC_CHECK_LIB(bfd, bfd_openr_iovec, + [bfd_openr_iovec_exists="yes"], + [bfd_openr_iovec_exists="no"] ) +if test "$bfd_openr_iovec_exists" = "yes"; then + AC_MSG_CHECKING([whether bfd_openr_iovec has seven parameters]) + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include <bfd.h> + #include <stdlib.h> + ], + [[struct bfd *nbfd = bfd_openr_iovec("some-file", "elf32-spu", + NULL, NULL, NULL, NULL, NULL); + return 0; + ]])], + [AC_DEFINE([HAVE_BFD_OPENR_IOVEC_WITH_7PARMS], + [], + [Defined if you have the version of bfd_openr_iovec with 7 parameters]) + bfd_open_iovec_7="yes" + AC_MSG_RESULT([yes])], + [AC_MSG_RESULT([no])] + ) +fi + AC_LANG_POP(C) LIBS=$SAVE_LIBS |