Skip to content

Commit

Permalink
Configure location of DIA-SDK needed by PdbScanner
Browse files Browse the repository at this point in the history
Location of DIA-SDK can be:
- specified explicitly via OMR_DIASDK_HOME configuration variable
- or found relative to cl.exe.

Relocate addition of DIASDK_HOME to include path so it is available
for all code of ddr tools.

Simplify compound configure tests.

Signed-off-by: Keith W. Campbell <keithc@ca.ibm.com>
  • Loading branch information
keithc-ca committed Apr 30, 2018
1 parent c1b8960 commit de6dd93
Show file tree
Hide file tree
Showing 5 changed files with 205 additions and 41 deletions.
141 changes: 129 additions & 12 deletions configure 100644 → 100755
Expand Up @@ -628,6 +628,7 @@ objext
arlibext
solibext
exeext
DIASDK_HOME
enable_DDR
enable_tracegen
enable_fvtest_agent
Expand Down Expand Up @@ -658,6 +659,8 @@ CCLINK
OMR_CROSS_COMPILE
OMR_VALGRIND_MEMCHECK
OMR_GC_IDLE_HEAP_MANAGER
VS_CL_PATH
OMR_DIASDK_HOME
OMRTHREAD_LIB_UNIX
OMRTHREAD_LIB_ZOS
OMRTHREAD_LIB_WIN32
Expand Down Expand Up @@ -914,7 +917,8 @@ CPPFLAGS
CPP
CXX
CXXFLAGS
CCC'
CCC
OMR_DIASDK_HOME'


# Initialize some variables set by options.
Expand Down Expand Up @@ -1726,6 +1730,8 @@ Some influential environment variables:
CPP C preprocessor
CXX C++ compiler command
CXXFLAGS C++ compiler flags
OMR_DIASDK_HOME
The directory where the DIA SDK can be found. (Default: )
Use these variables to override the choices made by `configure' or to help
it to find libraries and programs with nonstandard names/locations.
Expand Down Expand Up @@ -2926,7 +2932,6 @@ else
fi
###
### Build environment configuration
###
Expand Down Expand Up @@ -4361,7 +4366,6 @@ $as_echo "$OMR_TOOLCHAIN" >&6; }
# Default OMRGLUE to example/glue if it was not specified
OMRGLUE=${OMRGLUE:-"./example/glue"}
## Default Variables
# Set program defaults if they are undefined
Expand Down Expand Up @@ -6838,7 +6842,7 @@ fi
if test "$OMR_CROSS_CONFIGURE" != yes && test "$OMR_PORT_NUMA_SUPPORT" = 1 && test "$OMR_HOST_OS" = linux; then :
if test "$OMR_CROSS_CONFIGURE" != yes -a "$OMR_PORT_NUMA_SUPPORT" = 1 -a "$OMR_HOST_OS" = linux; then :
fi
Expand Down Expand Up @@ -7069,10 +7073,122 @@ fi
if test "x$enable_DDR" = "xyes" && test "$cross_compiling" != "yes" && test "$OMR_HOST_OS" != osx && test "$OMR_HOST_OS" != aix; then :
# Look for libdwarf
for ac_header in dwarf.h libdwarf/dwarf.h libdwarf.h libdwarf/libdwarf.h
if test "$enable_DDR" = yes -a "$cross_compiling" != "yes"; then :
case $OMR_HOST_OS in #(
aix) :
;; #(
osx) :
;; #(
win) :
# a user-supplied path wins
DIASDK_HOME="$OMR_DIASDK_HOME"
# otherwise if VSINSTALLDIR is set, use the DIA SDK found there
if test "x$DIASDK_HOME" = "x" -a "x$VSINSTALLDIR" != "x"; then :
DIASDK_HOME="$VSINSTALLDIR/DIA SDK"
fi
# next, look relative to the location of the Visual Studio compiler
if test "x$DIASDK_HOME" = "x" -a "$OMR_TOOLCHAIN" = msvc; then :
# Extract the first word of "cl.exe", so it can be a program name with args.
set dummy cl.exe; ac_word=$2
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; }
if ${ac_cv_path_VS_CL_PATH+:} false; then :
$as_echo_n "(cached) " >&6
else
case $VS_CL_PATH in
[\\/]* | ?:[\\/]*)
ac_cv_path_VS_CL_PATH="$VS_CL_PATH" # Let the user override the test with a path.
;;
*)
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_path_VS_CL_PATH="$as_dir/$ac_word$ac_exec_ext"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
fi
done
done
IFS=$as_save_IFS
;;
esac
fi
VS_CL_PATH=$ac_cv_path_VS_CL_PATH
if test -n "$VS_CL_PATH"; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $VS_CL_PATH" >&5
$as_echo "$VS_CL_PATH" >&6; }
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
fi
if test "x$VS_CL_PATH" != x; then :
# this should yield .../VC/bin/cl.exe or .../VC/bin/amd64/cl.exe
vc_bin_dir=$($as_dirname -- "$VS_CL_PATH" ||
$as_expr X"$VS_CL_PATH" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
X"$VS_CL_PATH" : 'X\(//\)[^/]' \| \
X"$VS_CL_PATH" : 'X\(//\)$' \| \
X"$VS_CL_PATH" : 'X\(/\)' \| . 2>/dev/null ||
$as_echo X"$VS_CL_PATH" |
sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
s//\1/
q
}
/^X\(\/\/\)[^/].*/{
s//\1/
q
}
/^X\(\/\/\)$/{
s//\1/
q
}
/^X\(\/\).*/{
s//\1/
q
}
s/.*/./; q')
diasdk_dir="$vc_bin_dir/../../DIA SDK"
if test -f "$diasdk_dir/include/dia2.h"
DIASDK_HOME="$(cygpath -a -w "$diasdk_dir")"; then :
diasdk_dir="$vc_bin_dir/../../../DIA SDK"
if test -f "$diasdk_dir/include/dia2.h"; then :
DIASDK_HOME="$(cygpath -a -w "$diasdk_dir")"
fi
fi
fi
fi
# fail if none of the above
if test "x$DIASDK_HOME" = "x"; then :
as_fn_error $? "--enable-DDR requires the DIA SDK; set VSINSTALLDIR or OMR_DIASDK_HOME" "$LINENO" 5
fi
# use forward slashes instead of backslashes; remove any duplicate slashes
DIASDK_HOME=$(echo "$DIASDK_HOME" | sed -e 's:\\:/:g' -e 's://:/:'g)
;; #(
*) :
# other host types: look for DWARF support
for ac_header in dwarf.h libdwarf/dwarf.h libdwarf.h libdwarf/libdwarf.h
do :
as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
Expand All @@ -7085,8 +7201,7 @@ fi
done
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing dwarf_init" >&5
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing dwarf_init" >&5
$as_echo_n "checking for library containing dwarf_init... " >&6; }
if ${ac_cv_search_dwarf_init+:} false; then :
$as_echo_n "(cached) " >&6
Expand Down Expand Up @@ -7142,7 +7257,7 @@ if test "$ac_res" != no; then :
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing dwarf_init" >&5
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing dwarf_init" >&5
$as_echo_n "checking for library containing dwarf_init... " >&6; }
if ${ac_cv_search_dwarf_init+:} false; then :
$as_echo_n "(cached) " >&6
Expand Down Expand Up @@ -7198,7 +7313,7 @@ if test "$ac_res" != no; then :
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing elf_begin" >&5
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing elf_begin" >&5
$as_echo_n "checking for library containing elf_begin... " >&6; }
if ${ac_cv_search_elf_begin+:} false; then :
$as_echo_n "(cached) " >&6
Expand Down Expand Up @@ -7255,6 +7370,8 @@ if test "$ac_res" != no; then :
fi
;;
esac
fi
Expand Down Expand Up @@ -7355,6 +7472,7 @@ CC=$BUILD_CC
###
Expand Down Expand Up @@ -8788,4 +8906,3 @@ if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then
$as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;}
fi

0 comments on commit de6dd93

Please sign in to comment.