@@ -1856,6 +1856,40 @@ AC_DEFUN([AX_PROG_DYNINST],
18561856 CPPFLAGS="${CPPFLAGS} -I${DYNINST_INCLUDES} -I${BOOST_HOME}/include"
18571857 AC_CHECK_HEADERS ( [ BPatch.h] , [ ] , [ DYNINST_INSTALLED="no"] )
18581858
1859+ AC_MSG_CHECKING ( [ whether DynInst uses Instruction::Ptr] )
1860+ AC_COMPILE_IFELSE (
1861+ [ AC_LANG_PROGRAM (
1862+ [ [ #include <InstructionDecoder.h>] ] ,
1863+ [ [
1864+ InstructionAPI::InstructionDecoder dec((unsigned char*)nullptr,0,Arch_x86);
1865+ InstructionAPI::Instruction insn = dec.decode();
1866+ insn.isValid();
1867+ ] ]
1868+ )
1869+ ] ,
1870+ [ dyninst_decode_returns_instr_ptr="no"] ,
1871+ [ AC_COMPILE_IFELSE (
1872+ [ AC_LANG_PROGRAM (
1873+ [ [ #include <InstructionDecoder.h>] ] ,
1874+ [ [
1875+ InstructionAPI::InstructionDecoder dec((unsigned char*)nullptr,0,Arch_x86);
1876+ InstructionAPI::Instruction::Ptr insn = dec.decode();
1877+ insn->isValid();
1878+ ] ]
1879+ )
1880+ ] ,
1881+ [ dyninst_decode_returns_instr_ptr="yes"] ,
1882+ [ dyninst_decode_returns_instr_ptr="unknown"]
1883+ )
1884+ ]
1885+ )
1886+ AC_MSG_RESULT ( [ $dyninst_decode_returns_instr_ptr] )
1887+ AS_IF ( [ test "$dyninst_decode_returns_instr_ptr" = "yes"] ,
1888+ [ AC_DEFINE ( [ DYNINST_DECODE_RETURNS_PTR] , 1 , [ Define to 1 if DYNINST decoder's function decode() return value is of type Intruction::Ptr] ) ] ,
1889+ [ test "$dyninst_decode_returns_instr_ptr" = "unknown"] ,
1890+ [ AC_MSG_ERROR ( [ Unable to determine whether DynInst uses Instruction::Ptr or not] ) ]
1891+ )
1892+
18591893 AC_SUBST ( DYNINST_CXXFLAGS )
18601894 AC_SUBST ( DYNINST_CPPFLAGS )
18611895
0 commit comments