diff options
author | Dwayne Boone <dwayne@zeroc.com> | 2015-03-19 11:57:54 -0230 |
---|---|---|
committer | Dwayne Boone <dwayne@zeroc.com> | 2015-03-19 11:57:54 -0230 |
commit | cc94d6b0d68bb45bb4c22a24f7e166918023da9c (patch) | |
tree | 53b23b855bf52441d0a14cb000fd5a92de57ae0e | |
parent | Removed protobuf demos (diff) | |
download | ice-cc94d6b0d68bb45bb4c22a24f7e166918023da9c.tar.bz2 ice-cc94d6b0d68bb45bb4c22a24f7e166918023da9c.tar.xz ice-cc94d6b0d68bb45bb4c22a24f7e166918023da9c.zip |
ICE-6374 Ensure source build works if ICE_HOME is set
-rw-r--r-- | config/Make.common.rules | 23 | ||||
-rw-r--r-- | config/Make.common.rules.mak | 15 | ||||
-rw-r--r-- | java/gradle/ice.gradle | 11 |
3 files changed, 36 insertions, 13 deletions
diff --git a/config/Make.common.rules b/config/Make.common.rules index 3e8ffdb7c82..74e5d1b6a2d 100644 --- a/config/Make.common.rules +++ b/config/Make.common.rules @@ -185,17 +185,24 @@ ifndef ice_bin_dist # by ICE_HOME. # ifneq ($(ICE_HOME),) - ifdef slice_translator - ifneq ($(shell test -f $(ICE_HOME)/$(binsubdir)/$(slice_translator) && echo 0), 0) + ifeq ($(shell test -d $(ICE_HOME)/cpp/bin && echo 0), 0) + # + # ICE_HOME is pointing at the source distribution, so we just ignore it. + # + ice_cpp_dir = $(ice_dir)/cpp + else + ifdef slice_translator + ifneq ($(shell test -f $(ICE_HOME)/$(binsubdir)/$(slice_translator) && echo 0), 0) $(error Unable to find $(slice_translator) in $(ICE_HOME)/$(binsubdir), please verify ICE_HOME is properly configured and Ice is correctly installed.) - endif - ifeq ($(shell test -f $(ice_dir)/cpp/bin/$(slice_translator) && echo 0), 0) + endif + ifeq ($(shell test -f $(ice_dir)/cpp/bin/$(slice_translator) && echo 0), 0) $(warning Found $(slice_translator) in both ICE_HOME/bin and $(ice_dir)/cpp/bin, ICE_HOME/bin/$(slice_translator) will be used!) - endif - ice_cpp_dir = $(ICE_HOME) - else + endif + ice_cpp_dir = $(ICE_HOME) + else $(warning Ignoring ICE_HOME environment variable to build current source tree.) - ice_cpp_dir = $(ice_dir)/cpp + ice_cpp_dir = $(ice_dir)/cpp + endif endif else ice_cpp_dir = $(ice_dir)/cpp diff --git a/config/Make.common.rules.mak b/config/Make.common.rules.mak index 302ae3c04a5..2d0c2c6f19e 100644 --- a/config/Make.common.rules.mak +++ b/config/Make.common.rules.mak @@ -84,7 +84,7 @@ ice_bin_dist_dir = $(PROGRAMFILES)\ZeroC\Ice-$(VERSION) # # -# First, check if we're building a source distribution. +# First, check if we're building a source distribution. # # If building from a source distribution, ice_dir is defined to the # top-level directory of the source distribution and ice_cpp_dir is @@ -97,13 +97,20 @@ ice_dir = $(top_srcdir)\.. ice_src_dist = 1 # -# When building a source distribution, if ICE_HOME is specified, it takes precedence over -# the source tree for building the language mappings. For example, this can be used to +# When building a source distribution, if ICE_HOME is specified, it takes precedence over +# the source tree for building the language mappings. For example, this can be used to # build the Python language mapping using the translators from the distribution specified # by ICE_HOME. # !if "$(ICE_HOME)" != "" +!if exist ("$(ICE_HOME)\cpp\bin") + +# ICE_HOME is pointing at the source distribution, so we just ignore it. +ice_cpp_dir = $(ice_dir)\cpp + +!else + !if "$(slice_translator)" != "" !if !exist ("$(ICE_HOME)\bin$(x64suffix)\$(slice_translator)") !error Unable to find $(slice_translator) in $(ICE_HOME)\bin$(x64suffix), please verify ICE_HOME is properly configured and Ice is correctly installed. @@ -117,6 +124,8 @@ ice_cpp_dir = $(ICE_HOME) ice_cpp_dir = $(ice_dir)\cpp !endif +!endif + !else ice_cpp_dir = $(ice_dir)\cpp diff --git a/java/gradle/ice.gradle b/java/gradle/ice.gradle index 58d25962d7e..be8c6f03bf2 100644 --- a/java/gradle/ice.gradle +++ b/java/gradle/ice.gradle @@ -68,8 +68,15 @@ def iceHome = env['ICE_HOME'] if (iceHome != null && iceHome.length() > 0) { def translator = new File("$iceHome/bin/$slice2java") if (!translator.exists()) { - throw new GradleException("Unable to find $slice2java in $iceHome, please verify ICE_HOME is " + - "properly configured and Ice is correctly installed.") + // + // Make sure ICE_HOME is not just pointing to the source distribution + // + translator = new File("$iceHome/cpp/bin/$slice2java") + if (!translator.exists()) { + throw new GradleException("Unable to find $slice2java in $iceHome, please verify ICE_HOME is " + + "properly configured and Ice is correctly installed.") + } + iceHome = null } } |