diff options
author | Jose <jose@zeroc.com> | 2013-01-30 19:32:48 +0100 |
---|---|---|
committer | Jose <jose@zeroc.com> | 2013-01-30 19:32:48 +0100 |
commit | 431858c0383347b2ab91d2f55adeeca7d598eb1f (patch) | |
tree | 9b77e53e9765af30f505067b105e6c720c7852e5 | |
parent | ICE-5091 - Remove Java configuration from demo/IceGrid/secure (diff) | |
download | ice-431858c0383347b2ab91d2f55adeeca7d598eb1f.tar.bz2 ice-431858c0383347b2ab91d2f55adeeca7d598eb1f.tar.xz ice-431858c0383347b2ab91d2f55adeeca7d598eb1f.zip |
Added C++11 libraries/binaries to OS X binary distribution
27 files changed, 131 insertions, 59 deletions
diff --git a/config/Make.common.rules b/config/Make.common.rules index b6c81422f70..b61c1da56ad 100644 --- a/config/Make.common.rules +++ b/config/Make.common.rules @@ -69,16 +69,26 @@ ifeq ($(UNAME),Linux) endif endif +ifeq ($(UNAME),Darwin) + ifeq ($(CPP11),yes) + cpp11suffix = /c++11 + endif +endif + ifneq ($(findstring MINGW,$(UNAME)),) UNAME := MINGW endif ifeq ($(LP64),yes) - libsubdir := lib$(lp64suffix) + libsubdir := lib$(lp64suffix) binsubdir := bin$(lp64binsuffix) + tp_libsubdir := $(libsubdir) + tp_binsubdir := $(binsubdir) else - libsubdir := lib - binsubdir := bin + libsubdir := lib$(cpp11suffix) + binsubdir := bin$(cpp11suffix) + tp_libsubdir := lib + tp_binsubdir := bin endif # @@ -234,9 +244,9 @@ install_slicedir = $(prefix)/slice ifneq ($(ice_dir), /usr) ifdef ice_src_dist ifeq ($(ice_cpp_dir), $(ice_dir)/cpp) - ice_lib_dir = $(ice_cpp_dir)/lib + ice_lib_dir = $(ice_cpp_dir)/lib$(cpp11suffix) else - ice_lib_dir = $(ice_cpp_dir)/$(libsubdir) + ice_lib_dir = $(ice_cpp_dir)/$(libsubdir) endif else ice_lib_dir = $(ice_dir)/$(libsubdir) diff --git a/cpp/bin/c++11/.gitignore b/cpp/bin/c++11/.gitignore new file mode 100644 index 00000000000..39af5887579 --- /dev/null +++ b/cpp/bin/c++11/.gitignore @@ -0,0 +1 @@ +# Dummy file, so that git retains this otherwise empty directory. diff --git a/cpp/config/Make.rules b/cpp/config/Make.rules index f3e35be7b44..83c9b68191d 100644 --- a/cpp/config/Make.rules +++ b/cpp/config/Make.rules @@ -161,8 +161,8 @@ else include $(top_srcdir)/../config/Make.common.rules endif -bindir = $(top_srcdir)/bin -libdir = $(top_srcdir)/lib +bindir = $(top_srcdir)/bin$(cpp11suffix) +libdir = $(top_srcdir)/lib$(cpp11suffix) headerdir = $(top_srcdir)/include # @@ -198,56 +198,56 @@ endif OPENSSL_FLAGS += $(if $(OPENSSL_HOME),-I$(OPENSSL_HOME)/include) ifeq ($(OPENSSL_LIBS),) - OPENSSL_LIBS = $(if $(OPENSSL_HOME),-L$(OPENSSL_HOME)/$(libsubdir)) -lssl -lcrypto + OPENSSL_LIBS = $(if $(OPENSSL_HOME),-L$(OPENSSL_HOME)/$(tp_libsubdir)) -lssl -lcrypto endif -OPENSSL_RPATH_LINK = $(if $(OPENSSL_HOME),$(call rpathlink,$(OPENSSL_HOME)/$(libsubdir))) +OPENSSL_RPATH_LINK = $(if $(OPENSSL_HOME),$(call rpathlink,$(OPENSSL_HOME)/$(tp_libsubdir))) BZIP2_FLAGS = $(if $(BZIP2_HOME),-I$(BZIP2_HOME)/include) ifeq ($(BZIP2_LIBS),) - BZIP2_LIBS = $(if $(BZIP2_HOME),-L$(BZIP2_HOME)/$(libsubdir)) -lbz2 + BZIP2_LIBS = $(if $(BZIP2_HOME),-L$(BZIP2_HOME)/$(tp_libsubdir)) -lbz2 endif -BZIP2_RPATH_LINK = $(if $(BZIP2_HOME),$(call rpathlink,$(BZIP2_HOME)/$(libsubdir))) +BZIP2_RPATH_LINK = $(if $(BZIP2_HOME),$(call rpathlink,$(BZIP2_HOME)/$(tp_libsubdir))) ifeq ($(ICONV_LIBS),) - ICONV_LIBS = $(if $(ICONV_HOME),-L$(ICONV_HOME)/$(libsubdir)) $(ICONV_LIB) + ICONV_LIBS = $(if $(ICONV_HOME),-L$(ICONV_HOME)/$(tp_libsubdir)) $(ICONV_LIB) endif ifneq ($(DB_HOME),) DB_FLAGS = -I$(DB_HOME)/include ifeq ($(DB_LIBS),) - DB_LIBS = -L$(DB_HOME)/$(libsubdir) -ldb_cxx$(CPP11LIBSUFFIX) + DB_LIBS = -L$(DB_HOME)/$(libsubdir) -ldb_cxx endif DB_RPATH_LINK = $(call rpathlink,$(DB_HOME)/$(libsubdir)) else ifeq ($(shell if [ -d /usr/include/db53 -a -d /usr/$(libsubdir)/db53 ] ; then echo yes; fi), yes) DB_FLAGS = -I/usr/include/db53 - DB_LIBS = -L/usr/$(libsubdir)/db53 -ldb_cxx$(CPP11LIBSUFFIX) + DB_LIBS = -L/usr/$(tp_libsubdir)/db53 -ldb_cxx else ifeq ($(shell if [ -d /usr/local/include/db53 -a -d /usr/local/$(libsubdir)/db53 ] ; then echo yes; fi), yes) DB_FLAGS = -I/usr/local/include/db53 - DB_LIBS = -L/usr/local/$(libsubdir)/db53 -ldb_cxx$(CPP11LIBSUFFIX) + DB_LIBS = -L/usr/local/$(libsubdir)/db53 -ldb_cxx else - DB_LIBS = -ldb_cxx$(CPP11LIBSUFFIX) + DB_LIBS = -ldb_cxx endif endif endif EXPAT_FLAGS = $(if $(EXPAT_HOME),-I$(EXPAT_HOME)/include) ifeq ($(EXPAT_LIBS),) - EXPAT_LIBS = $(if $(EXPAT_HOME),-L$(EXPAT_HOME)/$(libsubdir)) -lexpat + EXPAT_LIBS = $(if $(EXPAT_HOME),-L$(EXPAT_HOME)/$(tp_libsubdir)) -lexpat endif -EXPAT_RPATH_LINK = $(if $(EXPAT_HOME),$(call rpathlink,$(EXPAT_HOME)/$(libsubdir))) +EXPAT_RPATH_LINK = $(if $(EXPAT_HOME),$(call rpathlink,$(EXPAT_HOME)/$(tp_libsubdir))) ifeq ($(MCPP_LIBS),) - MCPP_LIBS = $(if $(MCPP_HOME),-L$(MCPP_HOME)/$(libsubdir)) -lmcpp + MCPP_LIBS = $(if $(MCPP_HOME),-L$(MCPP_HOME)/$(tp_libsubdir)) -lmcpp endif -MCPP_RPATH_LINK = $(if $(MCPP_HOME),$(call rpathlink,$(MCPP_HOME)/$(libsubdir))) +MCPP_RPATH_LINK = $(if $(MCPP_HOME),$(call rpathlink,$(MCPP_HOME)/$(tp_libsubdir))) ifeq ($(PLATFORM_HAS_READLINE),yes) ifeq ($(USE_READLINE),yes) READLINE_FLAGS = -DHAVE_READLINE $(if $(READLINE_HOME),-I$(READLINE_HOME)/include) - READLINE_LIBS = $(if $(READLINE_HOME),-L$(READLINE_HOME)/$(libsubdir)) -lreadline -lncurses + READLINE_LIBS = $(if $(READLINE_HOME),-L$(READLINE_HOME)/$(tp_libsubdir)) -lreadline -lncurses endif endif diff --git a/cpp/config/Make.rules.Darwin b/cpp/config/Make.rules.Darwin index 2bddfd9e689..928c60140d6 100644 --- a/cpp/config/Make.rules.Darwin +++ b/cpp/config/Make.rules.Darwin @@ -11,7 +11,7 @@ # This file is included by Make.rules when uname is Darwin. # -CXX ?= xcrun clang++ +CXX = xcrun clang++ CXXFLAGS = -Wall -Werror -D_REENTRANT @@ -31,7 +31,6 @@ ifeq ($(CPP11), yes) ifeq ($(CXX), xcrun clang++) CPPFLAGS += --std=c++11 CXXFLAGS += --stdlib=libc++ - CPP11LIBSUFFIX = -c++11 endif endif diff --git a/cpp/lib/c++11/.gitignore b/cpp/lib/c++11/.gitignore new file mode 100644 index 00000000000..39af5887579 --- /dev/null +++ b/cpp/lib/c++11/.gitignore @@ -0,0 +1 @@ +# Dummy file, so that git retains this otherwise empty directory. diff --git a/cpp/src/FreezeScript/Makefile b/cpp/src/FreezeScript/Makefile index b64c57e8118..55cab10a8a2 100644 --- a/cpp/src/FreezeScript/Makefile +++ b/cpp/src/FreezeScript/Makefile @@ -9,8 +9,8 @@ top_srcdir = ../.. -TRANSFORMDB = $(top_srcdir)/bin/transformdb -DUMPDB = $(top_srcdir)/bin/dumpdb +TRANSFORMDB = $(bindir)/transformdb +DUMPDB = $(bindir)/dumpdb TARGETS = $(TRANSFORMDB) $(DUMPDB) diff --git a/cpp/src/Glacier2/Makefile b/cpp/src/Glacier2/Makefile index 610885c5045..54d695202b3 100644 --- a/cpp/src/Glacier2/Makefile +++ b/cpp/src/Glacier2/Makefile @@ -9,7 +9,7 @@ top_srcdir = ../.. -ROUTER = $(top_srcdir)/bin/glacier2router +ROUTER = $(bindir)/glacier2router TARGETS = $(ROUTER) OBJS = Blobject.o \ diff --git a/cpp/src/IceBox/Makefile b/cpp/src/IceBox/Makefile index 41384624dd0..9039c7a0c52 100644 --- a/cpp/src/IceBox/Makefile +++ b/cpp/src/IceBox/Makefile @@ -13,8 +13,8 @@ LIBFILENAME = $(call mklibfilename,IceBox,$(VERSION)) SONAME = $(call mksoname,IceBox,$(SOVERSION)) LIBNAME = $(call mklibname,IceBox) -SERVER = $(top_srcdir)/bin/icebox -ADMIN = $(top_srcdir)/bin/iceboxadmin +SERVER = $(bindir)/icebox +ADMIN = $(bindir)/iceboxadmin LIBTARGETS = $(call mklibtargets,$(libdir)/$(LIBFILENAME),$(libdir)/$(SONAME),$(libdir)/$(LIBNAME)) TARGETS = $(LIBTARGETS) $(SERVER) $(ADMIN) diff --git a/cpp/src/IceGrid/Makefile b/cpp/src/IceGrid/Makefile index b4593c58dfd..49fc81d4ae6 100644 --- a/cpp/src/IceGrid/Makefile +++ b/cpp/src/IceGrid/Makefile @@ -9,9 +9,9 @@ top_srcdir = ../.. -ADMIN = $(top_srcdir)/bin/icegridadmin -NODE_SERVER = $(top_srcdir)/bin/icegridnode -REGISTRY_SERVER = $(top_srcdir)/bin/icegridregistry +ADMIN = $(bindir)/icegridadmin +NODE_SERVER = $(bindir)/icegridnode +REGISTRY_SERVER = $(bindir)/icegridregistry TARGETS = $(NODE_SERVER) $(REGISTRY_SERVER) $(ADMIN) diff --git a/cpp/src/IcePatch2/Makefile b/cpp/src/IcePatch2/Makefile index f5a2680f4c6..1af3f6a3f96 100644 --- a/cpp/src/IcePatch2/Makefile +++ b/cpp/src/IcePatch2/Makefile @@ -9,9 +9,9 @@ top_srcdir = ../.. -SERVER = $(top_srcdir)/bin/icepatch2server -CLIENT = $(top_srcdir)/bin/icepatch2client -CALC = $(top_srcdir)/bin/icepatch2calc +SERVER = $(bindir)/icepatch2server +CLIENT = $(bindir)/icepatch2client +CALC = $(bindir)/icepatch2calc TARGETS = $(SERVER) $(CLIENT) $(CALC) diff --git a/cpp/src/IceStorm/FreezeDB/Makefile b/cpp/src/IceStorm/FreezeDB/Makefile index 853db781e8e..a40b8b060b8 100644 --- a/cpp/src/IceStorm/FreezeDB/Makefile +++ b/cpp/src/IceStorm/FreezeDB/Makefile @@ -13,7 +13,7 @@ LIBFILENAME = $(call mklibfilename,IceStormFreezeDB,$(VERSION)) SONAME = $(call mksoname,IceStormFreezeDB,$(SOVERSION)) LIBNAME = $(call mklibname,IceStormFreezeDB) -MIGRATE = $(top_srcdir)/bin/icestormmigrate +MIGRATE = $(bindir)/icestormmigrate TARGETS = $(call mklibtargets,$(libdir)/$(LIBFILENAME),$(libdir)/$(SONAME),$(libdir)/$(LIBNAME)) $(MIGRATE) diff --git a/cpp/src/IceStorm/Makefile b/cpp/src/IceStorm/Makefile index af2b258aae2..486feda466c 100644 --- a/cpp/src/IceStorm/Makefile +++ b/cpp/src/IceStorm/Makefile @@ -13,7 +13,7 @@ LIBFILENAME = $(call mklibfilename,IceStormService,$(VERSION)) SONAME = $(call mksoname,IceStormService,$(SOVERSION)) LIBNAME = $(call mklibname,IceStormService) -ADMIN = $(top_srcdir)/bin/icestormadmin +ADMIN = $(bindir)/icestormadmin LIBTARGETS = $(call mklibtargets,$(libdir)/$(LIBFILENAME),$(libdir)/$(SONAME),$(libdir)/$(LIBNAME)) TARGETS = $(LIBTARGETS) $(ADMIN) diff --git a/cpp/src/ca/Makefile b/cpp/src/ca/Makefile index e4696729241..a1eda45b738 100644 --- a/cpp/src/ca/Makefile +++ b/cpp/src/ca/Makefile @@ -13,12 +13,12 @@ CA_FILES = iceca CLASS_FILES = ImportKey.class -TARGETS = $(top_srcdir)/bin/iceca \ +TARGETS = $(bindir)/iceca \ $(top_srcdir)/lib/ImportKey.class include $(top_srcdir)/config/Make.rules -$(top_srcdir)/bin/iceca: iceca +$(bindir)/iceca: iceca cp iceca $@ $(top_srcdir)/lib/ImportKey.class: ImportKey.class diff --git a/cpp/src/slice2confluence/Makefile b/cpp/src/slice2confluence/Makefile index bf617791faa..9f208b78d42 100644 --- a/cpp/src/slice2confluence/Makefile +++ b/cpp/src/slice2confluence/Makefile @@ -9,7 +9,7 @@ top_srcdir = ../.. -NAME = $(top_srcdir)/bin/slice2confluence +NAME = $(bindir)/slice2confluence TARGETS = $(NAME) diff --git a/cpp/src/slice2cpp/Makefile b/cpp/src/slice2cpp/Makefile index 85df19ac217..23878a96552 100644 --- a/cpp/src/slice2cpp/Makefile +++ b/cpp/src/slice2cpp/Makefile @@ -9,7 +9,7 @@ top_srcdir = ../.. -NAME = $(top_srcdir)/bin/slice2cpp$(EXE_EXT) +NAME = $(bindir)/slice2cpp$(EXE_EXT) TARGETS = $(NAME) diff --git a/cpp/src/slice2cs/Makefile b/cpp/src/slice2cs/Makefile index 594b421e61c..80fe27c260d 100644 --- a/cpp/src/slice2cs/Makefile +++ b/cpp/src/slice2cs/Makefile @@ -9,7 +9,7 @@ top_srcdir = ../.. -NAME = $(top_srcdir)/bin/slice2cs +NAME = $(bindir)/slice2cs TARGETS = $(NAME) diff --git a/cpp/src/slice2freeze/Makefile b/cpp/src/slice2freeze/Makefile index 38750f627e0..fd2bbf3d914 100644 --- a/cpp/src/slice2freeze/Makefile +++ b/cpp/src/slice2freeze/Makefile @@ -9,7 +9,7 @@ top_srcdir = ../.. -NAME = $(top_srcdir)/bin/slice2freeze +NAME = $(bindir)/slice2freeze TARGETS = $(NAME) diff --git a/cpp/src/slice2freezej/Makefile b/cpp/src/slice2freezej/Makefile index a65bda333a8..cd08aef06fb 100644 --- a/cpp/src/slice2freezej/Makefile +++ b/cpp/src/slice2freezej/Makefile @@ -9,7 +9,7 @@ top_srcdir = ../.. -NAME = $(top_srcdir)/bin/slice2freezej +NAME = $(bindir)/slice2freezej TARGETS = $(NAME) diff --git a/cpp/src/slice2html/Makefile b/cpp/src/slice2html/Makefile index 2caeaa9a23e..db66645c7e6 100644 --- a/cpp/src/slice2html/Makefile +++ b/cpp/src/slice2html/Makefile @@ -9,7 +9,7 @@ top_srcdir = ../.. -NAME = $(top_srcdir)/bin/slice2html +NAME = $(bindir)/slice2html TARGETS = $(NAME) diff --git a/cpp/src/slice2java/Makefile b/cpp/src/slice2java/Makefile index c39eb6c9375..e21e18b0d27 100644 --- a/cpp/src/slice2java/Makefile +++ b/cpp/src/slice2java/Makefile @@ -9,7 +9,7 @@ top_srcdir = ../.. -NAME = $(top_srcdir)/bin/slice2java +NAME = $(bindir)/slice2java TARGETS = $(NAME) diff --git a/cpp/src/slice2php/Makefile b/cpp/src/slice2php/Makefile index 0610db0ffc6..a897e731637 100644 --- a/cpp/src/slice2php/Makefile +++ b/cpp/src/slice2php/Makefile @@ -9,7 +9,7 @@ top_srcdir = ../.. -NAME = $(top_srcdir)/bin/slice2php +NAME = $(bindir)/slice2php TARGETS = $(NAME) diff --git a/cpp/src/slice2py/Makefile b/cpp/src/slice2py/Makefile index 1a549ecbdd1..caff4973fe4 100644 --- a/cpp/src/slice2py/Makefile +++ b/cpp/src/slice2py/Makefile @@ -9,7 +9,7 @@ top_srcdir = ../.. -NAME = $(top_srcdir)/bin/slice2py +NAME = $(bindir)/slice2py TARGETS = $(NAME) diff --git a/cpp/src/slice2rb/Makefile b/cpp/src/slice2rb/Makefile index ea0104d1bec..7e91e778da1 100644 --- a/cpp/src/slice2rb/Makefile +++ b/cpp/src/slice2rb/Makefile @@ -9,7 +9,7 @@ top_srcdir = ../.. -NAME = $(top_srcdir)/bin/slice2rb$(EXE_EXT) +NAME = $(bindir)/slice2rb$(EXE_EXT) TARGETS = $(NAME) diff --git a/demoscript/Util.py b/demoscript/Util.py index 601fd93b73a..2d2efda917b 100644 --- a/demoscript/Util.py +++ b/demoscript/Util.py @@ -35,6 +35,7 @@ import Expect keepGoing = False iceHome = None x64 = False +cpp11 = False preferIPv4 = False serviceDir = None demoErrors = [] @@ -134,10 +135,14 @@ def configurePaths(): libDir = None if not isWin32(): libDir = os.path.join(getIceDir("cpp"), "lib") + if isDarwin() and cpp11: + libDir = os.path.join(libDir, "c++11") # 64-bits binaries are located in a subdirectory with binary # distributions. binDir = os.path.join(getIceDir("cpp"), "bin") + if isDarwin(): + binDir = os.path.join(binDir, "c++11") addenv("PATH", binDir) if iceHome: if isWin32(): @@ -388,6 +393,7 @@ def run(demos, protobufDemos = [], root = False): --continue Keep running when a demo fails." --ice-home=<path> Use the binary distribution from the given path." --x64 Binary distribution is 64-bit." + --cpp11 Binary distribution is C++11." --preferIPv4 Prefer IPv4 stack (java only)." --fast Run an abbreviated version of the demos." --script Generate a script to run the demos. @@ -401,7 +407,7 @@ def run(demos, protobufDemos = [], root = False): try: opts, args = getopt.getopt(sys.argv[1:], "lr:R:", [ "filter=", "rfilter=", "start=", "loop", "fast", "trace=", "debug", "host=", "mode=", - "continue", "ice-home=", "x64", "preferIPv4", "env", "noenv", "script", "protobuf", "service-dir="]) + "continue", "ice-home=", "x64", "preferIPv4", "env", "noenv", "script", "protobuf", "service-dir=", "cpp11"]) except getopt.GetoptError: usage() @@ -421,6 +427,10 @@ def run(demos, protobufDemos = [], root = False): global x64 x64 = True arg += " " + o + elif o == "--cpp11": + global cpp11 + cpp11 = True + arg += " " + o elif o == "--preferIPv4": global preferIPv4 preferIPv4 = True @@ -649,10 +659,10 @@ def addLdPath(libpath): def processCmdLine(): def usage(): - print("usage: " + sys.argv[0] + " --x64 --preferIPv4 --env --noenv --fast --trace=output --debug --host host --mode=[debug|release] --ice-home=<dir> --service-dir=<dir>") + print("usage: " + sys.argv[0] + " --x64 --preferIPv4 --env --noenv --fast --trace=output --debug --host host --mode=[debug|release] --ice-home=<dir> --service-dir=<dir>", "--cpp11") sys.exit(2) try: - opts, args = getopt.getopt(sys.argv[1:], "", ["env", "noenv", "x64", "preferIPv4", "fast", "trace=", "debug", "host=", "mode=", "ice-home=", "--servicedir="]) + opts, args = getopt.getopt(sys.argv[1:], "", ["env", "noenv", "x64", "preferIPv4", "fast", "trace=", "debug", "host=", "mode=", "ice-home=", "--servicedir=", "cpp11"]) except getopt.GetoptError: usage() @@ -660,6 +670,7 @@ def processCmdLine(): global tracefile global buildmode global x64 + global cpp11 global preferIPv4 global debug global host @@ -671,6 +682,7 @@ def processCmdLine(): trace = False buildmode = None x64 = False + cpp11 = False tracefile = None env = False noenv = False @@ -693,6 +705,9 @@ def processCmdLine(): fast = True if o == "--x64": x64 = True + if o == "--cpp11": + + cpp11 = True if o == "--preferIPv4": preferIPv4 = True if o == "--ice-home": diff --git a/distribution/bin/makebindist.py b/distribution/bin/makebindist.py index 0c8bdac0355..664c19f3c8c 100755 --- a/distribution/bin/makebindist.py +++ b/distribution/bin/makebindist.py @@ -164,6 +164,12 @@ if forceclean or not os.path.exists(srcDir) or not os.path.exists(buildDir): sys.exit(1) os.rename("Ice-" + version, srcDir + "-64") + if "cpp-11" in buildLanguages: + if os.system("gunzip -c " + os.path.join(cwd, "Ice-" + version + ".tar.gz") + " | tar x" + quiet + "f -"): + print sys.argv[0] + ": failed to unpack ./Ice-" + version + ".tar.gz" + sys.exit(1) + os.rename("Ice-" + version, srcDir + "-11") + os.chdir(cwd) print "ok" @@ -177,10 +183,12 @@ for l in buildLanguages: print "============= Building " + l + " sources =============" print - if l != "cpp-64": - os.chdir(os.path.join(srcDir, l)) - else: + if l == "cpp-64": os.chdir(os.path.join(srcDir + "-64", "cpp")) + elif l == "cpp-11": + os.chdir(os.path.join(srcDir + "-11", "cpp")) + else: + os.chdir(os.path.join(srcDir, l)) if l != "java": diff --git a/distribution/lib/DistUtils.py b/distribution/lib/DistUtils.py index 49aeba1118a..f5764bc595f 100644 --- a/distribution/lib/DistUtils.py +++ b/distribution/lib/DistUtils.py @@ -16,7 +16,7 @@ from stat import * # languages = { \ 'SunOS' : ['cpp', 'cpp-64', 'java'], \ - 'Darwin' : ['cpp', 'java', 'py'], \ + 'Darwin' : ['cpp', 'cpp-11', 'java', 'py'], \ 'Linux' : ['cpp', 'java', 'cs', 'py', 'rb', 'php'], \ } @@ -596,6 +596,7 @@ class ThirdParty : def getFiles(self, platform): files = self.getFilesFromSubDirs(platform, "bin", "lib", False) + files = self.getFilesFromSubDirs(platform, "bin/c++11", "lib/c++11", False) if platform.lp64subdir: files += self.getFilesFromSubDirs(platform, \ os.path.join("bin", platform.lp64subdir), \ @@ -773,6 +774,10 @@ class Darwin(Platform): if not os.environ.has_key("CXXARCHFLAGS"): envs += " CXXARCHFLAGS=\"-arch i386 -arch x86_64\""; envs += " embedded_runpath_prefix=\"/Library/Developer/Ice-" + mmversion + "\"" + + if language == "cpp-11": + envs += " CPP11=yes" + return envs def getMakeOptions(self): @@ -780,6 +785,13 @@ class Darwin(Platform): def completeDistribution(self, buildDir, version): + print "Remove c++11 executables other than icebox", + for root, dirnames, filenames in os.walk(os.path.join(buildDir, "bin", "c++11")): + for f in filenames: + if f != "icebox": + os.remove(os.path.join(buildDir, "bin", "c++11", f)) + print "ok" + print "Fixing install names...", sys.stdout.flush() @@ -817,6 +829,19 @@ class Darwin(Platform): for f in binFiles: os.system('install_name_tool -change ' + oldName + ' ' + newName + ' ' + f) + # + # Fix C++11 binaries and libraries + # + binFiles = [ f for f in glob.glob(os.path.join(buildDir, "bin", "c++11", "*")) if isExe(f)] + binFiles += [ f for f in glob.glob(os.path.join(buildDir, "lib", "c++11", "*")) if isLib(f)] + + for oldName in oldInstallNames: + libName = os.path.basename(oldName) + newName = '/Library/Developer/Ice-' + mmversion + '/lib/c++11/' + libName + os.system('install_name_tool -id ' + newName + ' ' + buildDir + '/lib/c++11/' + libName) + for f in binFiles: + os.system('install_name_tool -change ' + oldName + ' ' + newName + ' ' + f) + print "ok" print "Fixing python location" @@ -921,7 +946,7 @@ class SunOS(Platform): class BerkeleyDB(ThirdParty): def __init__(self, platform): global berkeleydb, berkeleydbjar - ThirdParty.__init__(self, platform, "BerkeleyDB", berkeleydb, ["cpp", "cpp-64", "java"], None, "DB_HOME") + ThirdParty.__init__(self, platform, "BerkeleyDB", berkeleydb, ["cpp", "cpp-11", "cpp-64", "java"], None, "DB_HOME") if not self.location: # BerkeleyDB is installed with the system (Linux) self.languages = ["java"] self.location = berkeleydbjar.get(str(platform), None) diff --git a/scripts/TestUtil.py b/scripts/TestUtil.py index 69e8627a1b7..1c8e59a4caa 100755 --- a/scripts/TestUtil.py +++ b/scripts/TestUtil.py @@ -20,6 +20,7 @@ keepGoing = False # Set to True to have the tests continue on fail ipv6 = False # Default to use IPv4 only iceHome = None # Binary distribution to use (None to use binaries from source distribution) x64 = False # Binary distribution is 64-bit +cpp11 = False # Binary distribution is c++ 11 javaCmd = "java" # Default java loader valgrind = False # Set to True to use valgrind for C++ executables. appverifier = False # Set to True to use appverifier for C++ executables, This is windows only feature @@ -271,6 +272,7 @@ def run(tests, root = False): --no-ipv6 Don't use IPv6 addresses. --ice-home=<path> Use the binary distribution from the given path. --x64 Binary distribution is 64-bit. + --cpp11 Binary distribution is C++11. --cross=lang Run cross language test. --client-home=<dir> Run cross test clients from the given Ice source distribution. --script Generate a script to run the tests. @@ -296,7 +298,7 @@ def run(tests, root = False): "debug", "protocol=", "compress", "valgrind", "host=", "serialize", "continue", "ipv6", "no-ipv6", "ice-home=", "cross=", "client-home=", "x64", "script", "env", "sql-type=", "sql-db=", "sql-host=", "sql-port=", "sql-user=", "sql-passwd=", - "service-dir=", "appverifier", "compact", "silverlight", "winrt", "server", "mx"]) + "service-dir=", "appverifier", "compact", "silverlight", "winrt", "server", "mx", "cpp11"]) except getopt.GetoptError: usage() @@ -362,7 +364,7 @@ def run(tests, root = False): if o in ( "--cross", "--protocol", "--host", "--debug", "--compress", "--valgrind", "--serialize", "--ipv6", \ "--ice-home", "--x64", "--env", "--sql-type", "--sql-db", "--sql-host", "--sql-port", "--sql-user", \ "--sql-passwd", "--service-dir", "--appverifier", "--compact", "--silverlight", "--winrt", \ - "--server", "--mx", "--client-home"): + "--server", "--mx", "--client-home", "--cpp11"): arg += " " + o if len(a) > 0: arg += " " + a @@ -739,6 +741,7 @@ class DriverConfig: overrides = None ipv6 = False x64 = False + cpp11 = False sqlType = None sqlDbName = None sqlHost = None @@ -758,6 +761,7 @@ class DriverConfig: global appverifier global ipv6 global x64 + global cpp11 global sqlType global sqlDbName global sqlHost @@ -779,6 +783,7 @@ class DriverConfig: self.type = type self.ipv6 = ipv6 self.x64 = x64 + self.cpp11 = cpp11 self.sqlType = sqlType self.sqlDbName = sqlDbName self.sqlHost = sqlHost @@ -1404,6 +1409,8 @@ def createConfig(path, lines, enc=None): def getCppBinDir(lang = None): binDir = os.path.join(getIceDir("cpp"), "bin") + if isDarwin() and cpp11: + binDir = os.path.join(binDir, "c++11") if iceHome: if lang == None: lang = getDefaultMapping() @@ -1461,6 +1468,8 @@ def getTestEnv(lang, testdir): libDir = getCppBinDir(lang) else: libDir = os.path.join(getIceDir("cpp", testdir), "lib") + if isDarwin() and cpp11: + libDir = os.path.join(libDir, "c++11") if iceHome and x64: if isSolaris(): if isSparc(): @@ -1593,6 +1602,7 @@ def processCmdLine(): --ipv6 Use IPv6 addresses. --ice-home=<path> Use the binary distribution from the given path. --x64 Binary distribution is 64-bit. + --cpp11 Binary distribution is c++11. --env Print important environment variables. --cross=lang Run cross language test. --client-home=<dir> Run cross test clients from the given Ice source distribution. @@ -1616,7 +1626,7 @@ def processCmdLine(): sys.argv[1:], "", ["debug", "trace=", "protocol=", "compress", "valgrind", "host=", "serialize", "ipv6", \ "ice-home=", "x64", "cross=", "client-home=", "env", "sql-type=", "sql-db=", \ "sql-host=", "sql-port=", "sql-user=", "sql-passwd=", "service-dir=", "appverifier", \ - "compact", "silverlight", "winrt", "server", "mx"]) + "compact", "silverlight", "winrt", "server", "mx", "cpp11"]) except getopt.GetoptError: usage() @@ -1644,6 +1654,9 @@ def processCmdLine(): elif o == "--x64": global x64 x64 = True + elif o == "--cpp11": + global cpp11 + cpp11 = True elif o == "--compress": global compress compress = True |