diff --git a/CMakeLists.txt b/CMakeLists.txt index 2641f1bda..01ad02aa1 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -286,14 +286,11 @@ if ("x${CMAKE_BUILD_TYPE}" STREQUAL "x") set(CMAKE_BUILD_TYPE "Release") endif () -# Default TARGET_PLATFORM to "linux". -set(TARGET_PLATFORM CACHE STRING "linux") +# Default TARGET_PLATFORM to ${CMAKE_SYSTEM} +# change this once we support cross compiling +set(TARGET_PLATFORM CACHE STRING ${CMAKE_SYSTEM}) if ("x${TARGET_PLATFORM}" STREQUAL "x") - if (WIN32) - set(TARGET_PLATFORM "windows") - else () - set(TARGET_PLATFORM "linux") - endif () + set(TARGET_PLATFORM ${CMAKE_SYSTEM}) endif () include(EthDependencies) @@ -326,10 +323,7 @@ message("-- EVMJIT Build LLVM-based JIT EVM (experimental!) ${EVMJIT}" message("------------------------------------------------------------------------") message("") - -if ("${TARGET_PLATFORM}" STREQUAL "linux") - set(CMAKE_THREAD_LIBS_INIT pthread) -endif () +set(CMAKE_THREAD_LIBS_INIT pthread) include(EthCompilerSettings) message("-- CXXFLAGS: ${CMAKE_CXX_FLAGS}") diff --git a/extdep/CMakeLists.txt b/extdep/CMakeLists.txt deleted file mode 100644 index 8ec381330..000000000 --- a/extdep/CMakeLists.txt +++ /dev/null @@ -1,50 +0,0 @@ -cmake_minimum_required(VERSION 2.8.12) - -include(ExternalProject) -include(CMakeParseArguments) -include(eth_download.cmake) - -# all dependencies will be installed into this directory, separated by platform -string(TOLOWER ${CMAKE_SYSTEM_NAME} _system_name) -set(ETH_DEPENDENCY_INSTALL_DIR "${CMAKE_CURRENT_SOURCE_DIR}/install/${_system_name}") -set(ETH_DEPENDENCY_SERVER "https://build.ethdev.com/builds/${_system_name}-precompiled") -file(MAKE_DIRECTORY ${ETH_DEPENDENCY_INSTALL_DIR}/lib) -file(MAKE_DIRECTORY ${ETH_DEPENDENCY_INSTALL_DIR}/include) -file(MAKE_DIRECTORY ${ETH_DEPENDENCY_INSTALL_DIR}/bin) - -if (ETH_COMPILE) - # json-rpc-cpp and its dependencies - include(compile/jsoncpp.cmake) - include(compile/argtable2.cmake) - include(compile/curl.cmake) - include(compile/json-rpc-cpp.cmake) - - # qt and its dependencies - include(compile/icu.cmake) - include(compile/jom.cmake) - include(compile/qt.cmake) - - # leveldb and its dependencies - include(compile/snappy.cmake) - include(compile/leveldb.cmake) - - # cryptopp - include(compile/cryptopp.cmake) - - # boost - include(compile/boost.cmake) -else() - eth_download(boost VERSION 1.55.0) - eth_download(cryptopp VERSION 5.6.2) - eth_download(curl VERSION 7.4.2) - eth_download(jsoncpp VERSION 1.6.2) - eth_download(json-rpc-cpp VERSION 0.5.0) - eth_download(leveldb VERSION 1.2) - eth_download(microhttpd VERSION 0.9.2) - eth_download(qt VERSION 5.4.1) -endif() - -# will be re-eanbled later -# include(miniupnpc.cmake) -# if install phase of extep fails, even if libs are already created, the ethereum install will fail - diff --git a/extdep/Readme.md b/extdep/Readme.md deleted file mode 100644 index 1706f1fb9..000000000 --- a/extdep/Readme.md +++ /dev/null @@ -1,16 +0,0 @@ -# cpp-ethereum external dependencies - -**This is Work-in-Progress!** - -This directory hosts the external libraries that are needed to build cpp-ethereum. - -To automatically download, build, and link libraries, do -``` -cd extdep; mkdir build; cd build; cmake ..; make -``` -this will take some time. - - -To check which libraries are already included, check `CMakeLists.txt`. Other libraries still need to be fetched via the system's package manager. - -Libraries will be installed in `cpp-ethereum/extdep/install/` diff --git a/extdep/cmake/FindCURL.cmake b/extdep/cmake/FindCURL.cmake deleted file mode 100644 index 22d51591c..000000000 --- a/extdep/cmake/FindCURL.cmake +++ /dev/null @@ -1,9 +0,0 @@ -# hacky way to resolve nested dependencies - needed for json-rpc-cpp -find_library(CURL_LIBRARY NAMES curl - PATHS - ${ETH_DEPENDENCY_INSTALL_DIR}/lib - ) - -set(CURL_LIBRARIES ${CURL_LIBRARY}) -set(CURL_INCLUDE_DIRS ${ETH_DEPENDENCY_INSTALL_DIR}/include) - diff --git a/extdep/compile/argtable2.cmake b/extdep/compile/argtable2.cmake deleted file mode 100644 index 778d6a299..000000000 --- a/extdep/compile/argtable2.cmake +++ /dev/null @@ -1,13 +0,0 @@ -if (APPLE) - -elseif (WIN32) -ExternalProject_Add(argtable2 - GIT_REPOSITORY https://github.com/debris/argtable.git - GIT_TAG master - BINARY_DIR argtable2-prefix/src/argtable2 - CONFIGURE_COMMAND cmake . - BUILD_COMMAND devenv argtable2.sln /build release - INSTALL_COMMAND cmd /c cp src/Release/argtable2.lib ${ETH_DEPENDENCY_INSTALL_DIR}/lib && cp src/argtable2.h ${ETH_DEPENDENCY_INSTALL_DIR}/include -) -else() -endif() diff --git a/extdep/compile/boost.cmake b/extdep/compile/boost.cmake deleted file mode 100644 index 7449cf47b..000000000 --- a/extdep/compile/boost.cmake +++ /dev/null @@ -1,19 +0,0 @@ -if (APPLE) - -elseif (WIN32) -set(boost_address_model) -# on windows 64: -# set(boost_address_model address-model=64) - -set(boost_targets --with-filesystem --with-system --with-thread --with-date_time --with-regex --with-test --with-chrono --with-program_options) -ExternalProject_Add(boost - URL http://downloads.sourceforge.net/project/boost/boost/1.55.0/boost_1_55_0.tar.gz - BINARY_DIR boost-prefix/src/boost - CONFIGURE_COMMAND ./bootstrap.bat - BUILD_COMMAND ./b2.exe -j4 --build-type=complete link=static runtime-link=shared variant=debug,release threading=multi ${boost_addressModel} ${boost_targets} install --prefix=${ETH_DEPENDENCY_INSTALL_DIR} - INSTALL_COMMAND cmake -E rename ${ETH_DEPENDENCY_INSTALL_DIR}/include/boost-1_55/boost ${ETH_DEPENDENCY_INSTALL_DIR}/include/boost - ) -else() - -endif() - diff --git a/extdep/compile/cryptopp.cmake b/extdep/compile/cryptopp.cmake deleted file mode 100644 index a7e65d6c6..000000000 --- a/extdep/compile/cryptopp.cmake +++ /dev/null @@ -1,33 +0,0 @@ -# CryptoPP does not have good cross-platform support, there exist several different other projects to make it work ... - -# TODO the OS X build throws a lot of warnings, but compiles fine -if (APPLE) - ExternalProject_Add(cryptopp - URL https://downloads.sourceforge.net/project/cryptopp/cryptopp/5.6.2/cryptopp562.zip - BINARY_DIR cryptopp-prefix/src/cryptopp - CONFIGURE_COMMAND "" - BUILD_COMMAND make CXX=clang++ CXXFLAGS=-DCRYPTOPP_DISABLE_ASM - INSTALL_COMMAND make install PREFIX=${ETH_DEPENDENCY_INSTALL_DIR} - ) -elseif (WIN32) - file(MAKE_DIRECTORY ${ETH_DEPENDENCY_INSTALL_DIR}/include/cryptopp) - - ExternalProject_Add(cryptopp - SVN_REPOSITORY http://svn.code.sf.net/p/cryptopp/code/trunk/c5 - SVN_REVISION -r "541" - BINARY_DIR cryptopp-prefix/src/cryptopp - CONFIGURE_COMMAND devenv cryptest.sln /upgrade - BUILD_COMMAND devenv cryptest.sln /build release - INSTALL_COMMAND cmd /c cp Win32/DLL_Output/Release/cryptopp.dll ${ETH_DEPENDENCY_INSTALL_DIR}/lib && cp Win32/DLL_Output/Release/cryptopp.lib ${ETH_DEPENDENCY_INSTALL_DIR}/lib && cp *.h ${ETH_DEPENDENCY_INSTALL_DIR}/include/cryptopp - ) -# on Linux, the default Makefile does not work. -else() - ExternalProject_Add(cryptopp - URL https://github.com/mmoss/cryptopp/archive/v5.6.2.zip - BINARY_DIR cryptopp-prefix/src/cryptopp - CONFIGURE_COMMAND "" - BUILD_COMMAND scons --shared --prefix=${ETH_DEPENDENCY_INSTALL_DIR} - INSTALL_COMMAND "" - ) -endif() - diff --git a/extdep/compile/curl.cmake b/extdep/compile/curl.cmake deleted file mode 100644 index 64f253d43..000000000 --- a/extdep/compile/curl.cmake +++ /dev/null @@ -1,29 +0,0 @@ -if (APPLE) - ExternalProject_Add(curl - URL http://curl.haxx.se/download/curl-7.38.0.tar.bz2 - BINARY_DIR curl-prefix/src/curl - CONFIGURE_COMMAND ./configure --with-darwinssl --prefix=${ETH_DEPENDENCY_INSTALL_DIR} --exec-prefix=${ETH_DEPENDENCY_INSTALL_DIR} - BUILD_COMMAND make -j 3 - INSTALL_COMMAND make install - ) -elseif (WIN32) - ExternalProject_Add(curl - GIT_REPOSITORY https://github.com/debris/libcurl-7.29 - GIT_TAG master - BINARY_DIR curl-prefix/src/curl - CONFIGURE_COMMAND "" - BUILD_COMMAND "" - INSTALL_COMMAND cmd /c cp lib/release/libcurl.lib ${ETH_DEPENDENCY_INSTALL_DIR}/lib && cp -R include/curl ${ETH_DEPENDENCY_INSTALL_DIR}/include - ) - -else() - ExternalProject_Add(curl - URL http://curl.haxx.se/download/curl-7.38.0.tar.bz2 - BINARY_DIR curl-prefix/src/curl - CONFIGURE_COMMAND CONFIG_CMD ./configure --prefix=${ETH_DEPENDENCY_INSTALL_DIR} --exec-prefix=${ETH_DEPENDENCY_INSTALL_DIR} - BUILD_COMMAND make -j 3 - INSTALL_COMMAND make install - ) - -endif() - diff --git a/extdep/compile/icu.cmake b/extdep/compile/icu.cmake deleted file mode 100644 index ba3f3a9f0..000000000 --- a/extdep/compile/icu.cmake +++ /dev/null @@ -1,17 +0,0 @@ -if (APPLE) - -elseif (WIN32) - ExternalProject_Add(icu - GIT_REPOSITORY https://github.com/debris/icu-win32.git - GIT_TAG master - BINARY_DIR icu-prefix/src/icu - CONFIGURE_COMMAND "" - BUILD_COMMAND "" - INSTALL_COMMAND cmake -E copy_directory . ${ETH_DEPENDENCY_INSTALL_DIR} - ) - -else() - -endif() - - diff --git a/extdep/compile/jom.cmake b/extdep/compile/jom.cmake deleted file mode 100644 index f300fb2ad..000000000 --- a/extdep/compile/jom.cmake +++ /dev/null @@ -1,16 +0,0 @@ -if (APPLE) - - -elseif (WIN32) - ExternalProject_Add(jom - URL http://download.qt-project.org/official_releases/jom/jom.zip - BINARY_DIR jom-prefix/src/jom - CONFIGURE_COMMAND "" - BUILD_COMMAND "" - INSTALL_COMMAND cmake -E copy jom.exe ${ETH_DEPENDENCY_INSTALL_DIR}/bin - ) - -else() - -endif() - diff --git a/extdep/compile/json-rpc-cpp.cmake b/extdep/compile/json-rpc-cpp.cmake deleted file mode 100644 index 9d56b0dac..000000000 --- a/extdep/compile/json-rpc-cpp.cmake +++ /dev/null @@ -1,40 +0,0 @@ -# json-rpc-cpp is under heavy development, not yet stable, and multiplatform builds are not yet available. -# DO NOT MESS WITH THESE SETTINGS! IF YOU HAVE TO MAKE CHANGES HERE, CONSULT sven@ethdev.com BEFOREHAND!! - -# DO NOT CHANGE ANYTHING HERE! -if(APPLE) - ExternalProject_Add(json-rpc-cpp - # DEPENDS argtable2 jsoncpp - # DEPENDS curl # re-enable later, when we build curl again - GIT_REPOSITORY https://github.com/cinemast/libjson-rpc-cpp.git - GIT_TAG v0.3.2 - BINARY_DIR json-rpc-cpp-prefix/src/json-rpc-cpp - CONFIGURE_COMMAND cmake -DCMAKE_INSTALL_PREFIX=${ETH_DEPENDENCY_INSTALL_DIR} -DCMAKE_MODULE_PATH:PATH=${CMAKE_CURRENT_SOURCE_DIR}/cmake -DETH_DEPENDENCY_INSTALL_DIR:PATH=${ETH_DEPENDENCY_INSTALL_DIR} -DCMAKE_BUILD_TYPE=None -DCMAKE_FIND_FRAMEWORK=LAST -Wno-dev . - BUILD_COMMAND make -j 3 - INSTALL_COMMAND make install && ${CMAKE_CURRENT_SOURCE_DIR}/scripts/json-rpc-cpp_osx.sh . ${ETH_DEPENDENCY_INSTALL_DIR} - ) - -elseif (WIN32) - ExternalProject_Add(json-rpc-cpp - DEPENDS argtable2 jsoncpp curl - GIT_REPOSITORY https://github.com/debris/libjson-rpc-cpp.git - GIT_TAG windows - BINARY_DIR json-rpc-cpp-prefix/src/json-rpc-cpp - CONFIGURE_COMMAND cmake -DCMAKE_PREFIX_PATH=${ETH_DEPENDENCY_INSTALL_DIR} -DCURL_LIBRARIES=${ETH_DEPENDENCY_INSTALL_DIR}/lib/libcurl.lib . - BUILD_COMMAND devenv libjson-rpc-cpp.sln /build release - INSTALL_COMMAND cmd /c cp lib/Release/* ${ETH_DEPENDENCY_INSTALL_DIR}/lib && cp -R src/jsonrpccpp ${ETH_DEPENDENCY_INSTALL_DIR}/include - ) -else() - ExternalProject_Add(json-rpc-cpp - # DEPENDS argtable2 jsoncpp - # DEPENDS curl # re-enable later, when we build curl again - GIT_REPOSITORY https://github.com/cinemast/libjson-rpc-cpp.git - GIT_TAG v0.3.2 - BINARY_DIR json-rpc-cpp-prefix/src/json-rpc-cpp - CONFIGURE_COMMAND cmake -DCMAKE_INSTALL_PREFIX=${ETH_DEPENDENCY_INSTALL_DIR} -DCMAKE_MODULE_PATH:PATH=${CMAKE_CURRENT_SOURCE_DIR}/cmake -DETH_DEPENDENCY_INSTALL_DIR:PATH=${ETH_DEPENDENCY_INSTALL_DIR} -DCMAKE_BUILD_TYPE=None -DCMAKE_FIND_FRAMEWORK=LAST . - BUILD_COMMAND make -j 3 - INSTALL_COMMAND make install - ) - -endif() - diff --git a/extdep/compile/jsoncpp.cmake b/extdep/compile/jsoncpp.cmake deleted file mode 100644 index c0d6c97cd..000000000 --- a/extdep/compile/jsoncpp.cmake +++ /dev/null @@ -1,16 +0,0 @@ -if (APPLE) - -elseif (WIN32) - - file(MAKE_DIRECTORY ${ETH_DEPENDENCY_INSTALL_DIR}/include/jsoncpp) - ExternalProject_Add(jsoncpp - GIT_REPOSITORY https://github.com/open-source-parsers/jsoncpp - GIT_TAG svn-import - BINARY_DIR jsoncpp-prefix/src/jsoncpp - CONFIGURE_COMMAND cmake . - BUILD_COMMAND devenv jsoncpp.sln /build release - INSTALL_COMMAND cmd /c cp lib/Release/jsoncpp.lib ${ETH_DEPENDENCY_INSTALL_DIR}/lib && cp -R include/json ${ETH_DEPENDENCY_INSTALL_DIR}/include/jsoncpp - ) - -else() -endif() diff --git a/extdep/compile/leveldb.cmake b/extdep/compile/leveldb.cmake deleted file mode 100644 index 2f5388c14..000000000 --- a/extdep/compile/leveldb.cmake +++ /dev/null @@ -1,23 +0,0 @@ -if (APPLE) - ExternalProject_Add(leveldb - #DEPENDS snappy - URL https://leveldb.googlecode.com/files/leveldb-1.15.0.tar.gz - BINARY_DIR leveldb-prefix/src/leveldb - #CONFIGURE_COMMAND patch < ${CMAKE_CURRENT_SOURCE_DIR}/compile/leveldb_osx.patch - CONFIGURE_COMMAND "" - BUILD_COMMAND export ETH_DEPENDENCY_INSTALL_DIR=${ETH_DEPENDENCY_INSTALL_DIR} && make -j 3 - INSTALL_COMMAND cp -rf include/leveldb ${ETH_DEPENDENCY_INSTALL_DIR}/include/ && cp libleveldb.a ${ETH_DEPENDENCY_INSTALL_DIR}/lib && cp libleveldb.dylib.1.15 ${ETH_DEPENDENCY_INSTALL_DIR}/lib/libleveldb.dylib - ) -elseif (WIN32) - ExternalProject_Add(leveldb - GIT_REPOSITORY https://github.com/debris/leveldb-win32.git - GIT_TAG master - BINARY_DIR leveldb-prefix/src/leveldb - CONFIGURE_COMMAND "" - BUILD_COMMAND "" - INSTALL_COMMAND cmd /c cp lib/LibLevelDB.lib ${ETH_DEPENDENCY_INSTALL_DIR}/lib/leveldb.lib && cp -R include/leveldb ${ETH_DEPENDENCY_INSTALL_DIR}/include - ) -else() - -endif() - diff --git a/extdep/compile/leveldb_osx.patch b/extdep/compile/leveldb_osx.patch deleted file mode 100644 index ac9e8f528..000000000 --- a/extdep/compile/leveldb_osx.patch +++ /dev/null @@ -1,18 +0,0 @@ ---- Makefile 2014-11-07 00:54:05.000000000 +0100 -+++ MakefilePatch 2014-11-07 00:56:59.000000000 +0100 -@@ -17,11 +17,11 @@ - # this file is generated by the previous line to set build flags and sources - include build_config.mk - --CFLAGS += -I. -I./include $(PLATFORM_CCFLAGS) $(OPT) --CXXFLAGS += -I. -I./include $(PLATFORM_CXXFLAGS) $(OPT) -+CFLAGS += -I. -I./include $(PLATFORM_CCFLAGS) $(OPT) -+CXXFLAGS += -I. -I./include $(PLATFORM_CXXFLAGS) $(OPT) -DSNAPPY -I$(ETH_DEPENDENCY_INSTALL_DIR)/include - --LDFLAGS += $(PLATFORM_LDFLAGS) --LIBS += $(PLATFORM_LIBS) -+LDFLAGS += $(PLATFORM_LDFLAGS) -L$(ETH_DEPENDENCY_INSTALL_DIR)/lib -+LIBS += $(PLATFORM_LIBS) -lsnappy - - LIBOBJECTS = $(SOURCES:.cc=.o) - MEMENVOBJECTS = $(MEMENV_SOURCES:.cc=.o) diff --git a/extdep/compile/qt.cmake b/extdep/compile/qt.cmake deleted file mode 100644 index 5fb8a1440..000000000 --- a/extdep/compile/qt.cmake +++ /dev/null @@ -1,32 +0,0 @@ -if (APPLE) - ExternalProject_add(qt - URL http://qtmirror.ics.com/pub/qtproject/official_releases/qt/5.3/5.3.2/single/qt-everywhere-opensource-src-5.3.2.tar.gz - BINARY_DIR qt-prefix/src/qt - PATCH_COMMAND patch -d qtmultimedia/src/plugins/avfoundation/mediaplayer < ${CMAKE_CURRENT_SOURCE_DIR}/compile/qt_osx.patch - CONFIGURE_COMMAND ./configure -prefix ${ETH_DEPENDENCY_INSTALL_DIR} -system-zlib -qt-libpng -qt-libjpeg -confirm-license -opensource -nomake tests -release -nomake examples -no-xcb -arch x86_64 - BUILD_COMMAND make - INSTALL_COMMAND make install - ) -elseif(WIN32) - ExternalProject_Add(qt - DEPENDS icu jom - URL http://qtmirror.ics.com/pub/qtproject/official_releases/qt/5.3/5.3.2/single/qt-everywhere-opensource-src-5.3.2.tar.gz - BINARY_DIR qt-prefix/src/qt - UPDATE_COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/compile/qt_tools.bat - #PATCH_COMMAND cmake -E copy ${CMAKE_CURRENT_SOURCE_DIR}/compile/qt_configure.bat qtbase/configure.bat - CONFIGURE_COMMAND configure -prefix ${ETH_DEPENDENCY_INSTALL_DIR} -opensource -confirm-license -release -opengl desktop -platform win32-msvc2013 -icu -I ${ETH_DEPENDENCY_INSTALL_DIR}/include -L ${ETH_DEPENDENCY_INSTALL_DIR}/lib -nomake tests -nomake examples - BUILD_COMMAND nmake - INSTALL_COMMAND nmake install - ) - - ExternalProject_Add_Step(qt configure_paths - COMMAND set PATH=${ETH_DEPENDENCY_INSTALL_DIR}/bin;%cd%/gnuwin32/bin;%cd%/qtbase/bin;%PATH% - DEPENDEES patch - DEPENDERS configure - ) - -else() - -endif() - - diff --git a/extdep/compile/qt_configure.bat b/extdep/compile/qt_configure.bat deleted file mode 100644 index bd810938a..000000000 --- a/extdep/compile/qt_configure.bat +++ /dev/null @@ -1,111 +0,0 @@ -::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: -:: -:: Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). -:: Contact: http://www.qt-project.org/legal -:: -:: This file is part of the tools applications of the Qt Toolkit. -:: -:: $QT_BEGIN_LICENSE:LGPL$ -:: Commercial License Usage -:: Licensees holding valid commercial Qt licenses may use this file in -:: accordance with the commercial license agreement provided with the -:: Software or, alternatively, in accordance with the terms contained in -:: a written agreement between you and Digia. For licensing terms and -:: conditions see http://qt.digia.com/licensing. For further information -:: use the contact form at http://qt.digia.com/contact-us. -:: -:: GNU Lesser General Public License Usage -:: Alternatively, this file may be used under the terms of the GNU Lesser -:: General Public License version 2.1 as published by the Free Software -:: Foundation and appearing in the file LICENSE.LGPL included in the -:: packaging of this file. Please review the following information to -:: ensure the GNU Lesser General Public License version 2.1 requirements -:: will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -:: -:: In addition, as a special exception, Digia gives you certain additional -:: rights. These rights are described in the Digia Qt LGPL Exception -:: version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -:: -:: GNU General Public License Usage -:: Alternatively, this file may be used under the terms of the GNU -:: General Public License version 3.0 as published by the Free Software -:: Foundation and appearing in the file LICENSE.GPL included in the -:: packaging of this file. Please review the following information to -:: ensure the GNU General Public License version 3.0 requirements will be -:: met: http://www.gnu.org/copyleft/gpl.html. -:: -:: -:: $QT_END_LICENSE$ -:: -::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: - -@echo off -set QTSRC=%~dp0 -set QTDIR=%CD% -::if not exist %QTSRC%\.gitignore goto sconf -echo Please wait while bootstrapping configure ... - -for %%C in (cl.exe icl.exe g++.exe perl.exe) do set %%C=%%~$PATH:C - -if "%perl.exe%" == "" ( - echo Perl not found in PATH. Aborting. >&2 - exit /b 1 -) -if not exist mkspecs ( - md mkspecs - if errorlevel 1 goto exit -) -perl %QTSRC%bin\syncqt.pl -minimal -module QtCore -outdir %QTDIR% %QTSRC% -if errorlevel 1 goto exit - -if not exist tools\configure ( - md tools\configure - if errorlevel 1 goto exit -) -cd tools\configure -if errorlevel 1 goto exit - -echo #### Generated by configure.bat - DO NOT EDIT! ####> Makefile -echo/>> Makefile -for /f "tokens=3 usebackq" %%V in (`findstr QT_VERSION_STR %QTSRC%\src\corelib\global\qglobal.h`) do @echo QTVERSION = %%~V>> Makefile -if not "%cl.exe%" == "" ( - echo CXX = cl>>Makefile - echo EXTRA_CXXFLAGS =>>Makefile - rem This must have a trailing space. - echo QTSRC = %QTSRC% >> Makefile - set tmpl=win32 - set make=nmake -) else if not "%icl.exe%" == "" ( - echo CXX = icl>>Makefile - echo EXTRA_CXXFLAGS = /Zc:forScope>>Makefile - rem This must have a trailing space. - echo QTSRC = %QTSRC% >> Makefile - set tmpl=win32 - set make=nmake -) else if not "%g++.exe%" == "" ( - echo CXX = g++>>Makefile - echo EXTRA_CXXFLAGS =>>Makefile - rem This must NOT have a trailing space. - echo QTSRC = %QTSRC:\=/%>> Makefile - set tmpl=mingw - set make=mingw32-make -) else ( - echo No suitable compiler found in PATH. Aborting. >&2 - cd ..\.. - exit /b 1 -) -echo/>> Makefile -type %QTSRC%tools\configure\Makefile.%tmpl% >> Makefile - -%make% -if errorlevel 1 (cd ..\.. & exit /b 1) - -cd ..\.. - -:conf -configure.exe -srcdir %QTSRC% %* -goto exit - -:sconf -%QTSRC%\configure.exe %* -:exit diff --git a/extdep/compile/qt_osx.patch b/extdep/compile/qt_osx.patch deleted file mode 100644 index 7900f6094..000000000 --- a/extdep/compile/qt_osx.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- avfmediaplayersession.mm 2014-09-11 12:48:26.000000000 +0200 -+++ avfmediaplayersessionPatch.mm 2014-12-01 12:53:14.000000000 +0100 -@@ -295,7 +295,7 @@ - //AVPlayerItem "status" property value observer. - if (context == AVFMediaPlayerSessionObserverStatusObservationContext) - { -- AVPlayerStatus status = [[change objectForKey:NSKeyValueChangeNewKey] integerValue]; -+ AVPlayerStatus status = (AVPlayerStatus)[[change objectForKey:NSKeyValueChangeNewKey] integerValue]; - switch (status) - { - //Indicates that the status of the player is not yet known because diff --git a/extdep/compile/qt_tools.bat b/extdep/compile/qt_tools.bat deleted file mode 100644 index bd588c480..000000000 --- a/extdep/compile/qt_tools.bat +++ /dev/null @@ -1,2 +0,0 @@ -rem : import VC environment vars -call "%VS120COMNTOOLS%\..\..\VC\vcvarsall.bat" x86 \ No newline at end of file diff --git a/extdep/compile/snappy.cmake b/extdep/compile/snappy.cmake deleted file mode 100644 index 0f7ba300e..000000000 --- a/extdep/compile/snappy.cmake +++ /dev/null @@ -1,14 +0,0 @@ -if (APPLE) - ExternalProject_Add(snappy - URL https://snappy.googlecode.com/files/snappy-1.1.1.tar.gz - BINARY_DIR snappy-prefix/src/snappy - CONFIGURE_COMMAND ./configure --disable-dependency-tracking --prefix=${ETH_DEPENDENCY_INSTALL_DIR} - BUILD_COMMAND "" - INSTALL_COMMAND make install - ) -elseif(WIN32) - -else() - -endif() - diff --git a/extdep/eth_download.cmake b/extdep/eth_download.cmake deleted file mode 100644 index 96d6c5122..000000000 --- a/extdep/eth_download.cmake +++ /dev/null @@ -1,74 +0,0 @@ -# this macro requires the following variables to be specified: -# -# ETH_DEPENDENCY_SERVER - server from which dependencies should be downloaded -# ETH_DEPENDENCY_INSTALL_DIR - install location for all dependencies -# -# usage: -# -# eth_download("json-rpc-cpp") -# eth_download("json-rpc-cpp" VERSION "0.3.2") -# -# params: -# VERSION - exact version we want to use -# OSX_SCRIPT - script which will be executed on apple in install phase -# UNIX_SCRIPT - script which will be executed on unix in install phase -# WIN_SCRIPT - script which will be executed on win in install phase - -# OSX_SCRIPT, WIN_SCRIPT, UNIX_SCRIPT are taking 2 params: -# $1 is package_source, -# $2 is ETH_DEPENDENCY_INSTALL_DIR -# -# parsing arguments -# http://www.cmake.org/cmake/help/v3.0/module/CMakeParseArguments.html -# -# for macos you may need to specify OSX_SCRIPT with install_name_tool to fix dylib -# http://stackoverflow.com/questions/2985315/using-install-name-tool-whats-going-wrong -# -# TODO: -# check if install_command is handling symlinks correctly on linux and windows - -macro(eth_download eth_package_name) - - set (extra_macro_args ${ARGN}) - set (options) - set (one_value_args VERSION OSX_SCRIPT UNIX_SCRIPT WIN_SCRIPT) - set (multi_value_args) - cmake_parse_arguments (ETH_DOWNLOAD "${options}" "${one_value_args}" "${multi_value_args}" ${extra_macro_args}) - - if (ETH_DOWNLOAD_VERSION) - set(eth_tar_name "${eth_package_name}-${ETH_DOWNLOAD_VERSION}.tar.gz") - else() - set(eth_tar_name "${eth_package_name}.tar.gz") - endif() - - message(STATUS "download path for ${eth_package_name} is : ${ETH_DEPENDENCY_SERVER}/${eth_tar_name}") - - # we need that to copy symlinks - # see http://superuser.com/questions/138587/how-to-copy-symbolic-links - if (APPLE) - set (eth_package_copy cp -a . ${ETH_DEPENDENCY_INSTALL_DIR}) - set (eth_package_install ${ETH_DOWNLOAD_OSX_SCRIPT}) - elseif (UNIX) - set (eth_package_copy cp -a . ${ETH_DEPENDENCY_INSTALL_DIR}) - set (eth_package_install ${ETH_DOWNLOAD_UNIX_SCRIPT}) - else () - set (eth_package_copy cmake -E copy_directory . ${ETH_DEPENDENCY_INSTALL_DIR}) - set (eth_package_install ${ETH_DOWNLOAD_WIN_SCRIPT}) - endif() - - if (eth_package_install) - message(STATUS "install script: ${eth_package_install}") - set (eth_package_install ${eth_package_install} . ${ETH_DEPENDENCY_INSTALL_DIR}) - else () - set (eth_package_install echo 0) # cause empty string is not handled properly - endif() - - ExternalProject_Add(${eth_package_name} - URL ${ETH_DEPENDENCY_SERVER}/${eth_tar_name} - BINARY_DIR ${eth_package_name}-prefix/src/${eth_package_name} - CONFIGURE_COMMAND "" - BUILD_COMMAND ${eth_package_copy} - INSTALL_COMMAND ${eth_package_install} - ) -endmacro() - diff --git a/extdep/getstuff.bat b/extdep/getstuff.bat index e083a97ce..c138c92d5 100644 --- a/extdep/getstuff.bat +++ b/extdep/getstuff.bat @@ -23,7 +23,7 @@ set eth_version=%2 cd download -if not exist %eth_name%-%eth_version%.tar.gz curl -o %eth_name%-%eth_version%.tar.gz %eth_server%/%eth_name%-%eth_version%.tar.gz +if not exist %eth_name%-%eth_version%.tar.gz curl -k -o %eth_name%-%eth_version%.tar.gz %eth_server%/%eth_name%-%eth_version%.tar.gz if not exist %eth_name%-%eth_version% tar -zxvf %eth_name%-%eth_version%.tar.gz cmake -E copy_directory %eth_name%-%eth_version% ..\install\windows diff --git a/extdep/miniupnpc.cmake b/extdep/miniupnpc.cmake deleted file mode 100644 index 4fbed6807..000000000 --- a/extdep/miniupnpc.cmake +++ /dev/null @@ -1,11 +0,0 @@ -# TODO this file is not used yet, but will be in future -include(ExternalProject) - -ExternalProject_Add(miniupnpc - URL http://miniupnp.tuxfamily.org/files/download.php?file=miniupnpc-1.9.20141027.tar.gz - BINARY_DIR miniupnpc-prefix/src/miniupnpc - CONFIGURE_COMMAND "" - BUILD_COMMAND make -j 3 - INSTALL_COMMAND make install INSTALLPREFIX=${ETH_DEPENDENCY_INSTALL_DIR} -) - diff --git a/extdep/scripts/json-rpc-cpp_osx.sh b/extdep/scripts/json-rpc-cpp_osx.sh deleted file mode 100755 index 8a6b96c7b..000000000 --- a/extdep/scripts/json-rpc-cpp_osx.sh +++ /dev/null @@ -1,29 +0,0 @@ -#!/bin/bash - -ETH_DEPENDENCY_SOURCE_DIR=$1 -ETH_DEPENDENCY_INSTALL_DIR=$2 - -OLD_COMMON_DYLIB="libjsonrpccpp-common.0.dylib" - -COMMON_DYLIB=${ETH_DEPENDENCY_INSTALL_DIR}/lib/libjsonrpccpp-common.0.dylib -SERVER_DYLIB=${ETH_DEPENDENCY_INSTALL_DIR}/lib/libjsonrpccpp-server.0.dylib -CLIENT_DYLIB=${ETH_DEPENDENCY_INSTALL_DIR}/lib/libjsonrpccpp-client.0.dylib - -# fix bin -STAB_EXEC=${ETH_DEPENDENCY_INSTALL_DIR}/bin/jsonrpcstub -install_name_tool -change ${OLD_COMMON_DYLIB} ${COMMON_DYLIB} ${STAB_EXEC} - -# fix common -install_name_tool -id ${COMMON_DYLIB} ${COMMON_DYLIB} - -# fix server -install_name_tool -id ${SERVER_DYLIB} ${SERVER_DYLIB} -install_name_tool -change ${OLD_COMMON_DYLIB} ${COMMON_DYLIB} ${SERVER_DYLIB} - -# fix client -install_name_tool -id ${CLIENT_DYLIB} ${CLIENT_DYLIB} -install_name_tool -change ${OLD_COMMON_DYLIB} ${COMMON_DYLIB} ${CLIENT_DYLIB} - -# TODO fix argtable and jsoncpp once they are downloaded as dependencies - - diff --git a/extdep/scripts/leveldb_osx.sh b/extdep/scripts/leveldb_osx.sh deleted file mode 100755 index 06b4a2dbd..000000000 --- a/extdep/scripts/leveldb_osx.sh +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/bash - -ETH_DEPENDENCY_SOURCE_DIR=$1 -ETH_DEPENDENCY_INSTALL_DIR=$2 - -OLD_SNAPPY_DYLIB="/Users/marekkotewicz/ethereum/cpp-ethereum/extdep/install/darwin/lib/libsnappy.1.dylib" -SNAPPY_DYLIB=${ETH_DEPENDENCY_INSTALL_DIR}/lib/libsnappy.dylib -LEVELDB_DYLIB=${ETH_DEPENDENCY_INSTALL_DIR}/lib/libleveldb.dylib - -install_name_tool -id ${LEVELDB_DYLIB} ${LEVELDB_DYLIB} -install_name_tool -change ${OLD_SNAPPY_DYLIB} ${SNAPPY_DYLIB} ${LEVELDB_DYLIB} - diff --git a/extdep/scripts/snappy_osx.sh b/extdep/scripts/snappy_osx.sh deleted file mode 100755 index 01304fcf1..000000000 --- a/extdep/scripts/snappy_osx.sh +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/bash - -ETH_DEPENDENCY_SOURCE_DIR=$1 -ETH_DEPENDENCY_INSTALL_DIR=$2 - -SNAPPY_DYLIB=${ETH_DEPENDENCY_INSTALL_DIR}/lib/libsnappy.dylib -install_name_tool -id ${SNAPPY_DYLIB} ${SNAPPY_DYLIB} - diff --git a/libsolidity/AST.cpp b/libsolidity/AST.cpp index 095ba7bf1..0abdf7819 100644 --- a/libsolidity/AST.cpp +++ b/libsolidity/AST.cpp @@ -378,20 +378,16 @@ void VariableDeclaration::checkTypeRequirements() if ((m_type && !m_type->isValueType()) || !m_value) BOOST_THROW_EXCEPTION(createTypeError("Unitialized \"constant\" variable.")); } - if (!m_value) - return; if (m_type) { - m_value->expectType(*m_type); - if (m_isStateVariable && !m_type->externalType() && getVisibility() >= Visibility::Public) - BOOST_THROW_EXCEPTION(createTypeError("Internal type is not allowed for state variables.")); - - if (!FunctionType(*this).externalType()) - BOOST_THROW_EXCEPTION(createTypeError("Internal type is not allowed for public state variables.")); + if (m_value) + m_value->expectType(*m_type); } else { - // no type declared and no previous assignment, infer the type + if (!m_value) + // This feature might be extended in the future. + BOOST_THROW_EXCEPTION(createTypeError("Assignment necessary for type detection.")); m_value->checkTypeRequirements(); TypePointer type = m_value->getType(); if (type->getCategory() == Type::Category::IntegerConstant) @@ -405,6 +401,8 @@ void VariableDeclaration::checkTypeRequirements() BOOST_THROW_EXCEPTION(createTypeError("Variable cannot have void type.")); m_type = type; } + if (m_isStateVariable && getVisibility() >= Visibility::Public && !FunctionType(*this).externalType()) + BOOST_THROW_EXCEPTION(createTypeError("Internal type is not allowed for public state variables.")); } bool VariableDeclaration::isExternalFunctionParameter() const diff --git a/libsolidity/ArrayUtils.cpp b/libsolidity/ArrayUtils.cpp index 58031390f..448e4da2a 100644 --- a/libsolidity/ArrayUtils.cpp +++ b/libsolidity/ArrayUtils.cpp @@ -388,10 +388,7 @@ void ArrayUtils::convertLengthToSize(ArrayType const& _arrayType, bool _pad) con { if (_arrayType.getLocation() == ArrayType::Location::Storage) { - if (_arrayType.isByteArray()) - m_context << u256(31) << eth::Instruction::ADD - << u256(32) << eth::Instruction::SWAP1 << eth::Instruction::DIV; - else if (_arrayType.getBaseType()->getStorageSize() <= 1) + if (_arrayType.getBaseType()->getStorageSize() <= 1) { unsigned baseBytes = _arrayType.getBaseType()->getStorageBytes(); if (baseBytes == 0) @@ -465,82 +462,62 @@ void ArrayUtils::accessIndex(ArrayType const& _arrayType) const m_context << legalAccess; // stack: - if (_arrayType.isByteArray()) - switch (location) - { - case ArrayType::Location::Storage: - // byte array index storage lvalue on stack (goal): - // = - m_context << u256(32) << eth::Instruction::SWAP2; + m_context << eth::Instruction::SWAP1; + if (_arrayType.isDynamicallySized()) + { + if (location == ArrayType::Location::Storage) CompilerUtils(m_context).computeHashStatic(); - // stack: 32 index data_ref + else if (location == ArrayType::Location::Memory) + m_context << u256(32) << eth::Instruction::ADD; + } + // stack: + switch (location) + { + case ArrayType::Location::CallData: + if (!_arrayType.isByteArray()) + m_context + << eth::Instruction::SWAP1 + << _arrayType.getBaseType()->getCalldataEncodedSize() + << eth::Instruction::MUL; + m_context << eth::Instruction::ADD; + if (_arrayType.getBaseType()->isValueType()) + CompilerUtils(m_context).loadFromMemoryDynamic( + *_arrayType.getBaseType(), + true, + !_arrayType.isByteArray(), + false + ); + break; + case ArrayType::Location::Storage: + m_context << eth::Instruction::SWAP1; + if (_arrayType.getBaseType()->getStorageBytes() <= 16) + { + // stack: + // goal: + // = <(index % itemsPerSlot) * byteSize> + unsigned byteSize = _arrayType.getBaseType()->getStorageBytes(); + solAssert(byteSize != 0, ""); + unsigned itemsPerSlot = 32 / byteSize; + m_context << u256(itemsPerSlot) << eth::Instruction::SWAP2; + // stack: itemsPerSlot index data_ref m_context << eth::Instruction::DUP3 << eth::Instruction::DUP3 << eth::Instruction::DIV << eth::Instruction::ADD - // stack: 32 index (data_ref + index / 32) + // stack: itemsPerSlot index (data_ref + index / itemsPerSlot) << eth::Instruction::SWAP2 << eth::Instruction::SWAP1 << eth::Instruction::MOD; - break; - case ArrayType::Location::CallData: - // no lvalue, just retrieve the value - m_context - << eth::Instruction::ADD << eth::Instruction::CALLDATALOAD - << ((u256(0xff) << (256 - 8))) << eth::Instruction::AND; - break; - case ArrayType::Location::Memory: - solAssert(false, "Memory lvalues not yet implemented."); - } - else - { - // stack: - m_context << eth::Instruction::SWAP1; - if (_arrayType.isDynamicallySized()) - { - if (location == ArrayType::Location::Storage) - CompilerUtils(m_context).computeHashStatic(); - else if (location == ArrayType::Location::Memory) - m_context << u256(32) << eth::Instruction::ADD; + if (byteSize != 1) + m_context << u256(byteSize) << eth::Instruction::MUL; } - // stack: - switch (location) + else { - case ArrayType::Location::CallData: - m_context - << eth::Instruction::SWAP1 << _arrayType.getBaseType()->getCalldataEncodedSize() - << eth::Instruction::MUL << eth::Instruction::ADD; - if (_arrayType.getBaseType()->isValueType()) - CompilerUtils(m_context).loadFromMemoryDynamic(*_arrayType.getBaseType(), true, true, false); - break; - case ArrayType::Location::Storage: - m_context << eth::Instruction::SWAP1; - if (_arrayType.getBaseType()->getStorageBytes() <= 16) - { - // stack: - // goal: - // = <(index % itemsPerSlot) * byteSize> - unsigned byteSize = _arrayType.getBaseType()->getStorageBytes(); - solAssert(byteSize != 0, ""); - unsigned itemsPerSlot = 32 / byteSize; - m_context << u256(itemsPerSlot) << eth::Instruction::SWAP2; - // stack: itemsPerSlot index data_ref - m_context - << eth::Instruction::DUP3 << eth::Instruction::DUP3 - << eth::Instruction::DIV << eth::Instruction::ADD - // stack: itemsPerSlot index (data_ref + index / itemsPerSlot) - << eth::Instruction::SWAP2 << eth::Instruction::SWAP1 - << eth::Instruction::MOD - << u256(byteSize) << eth::Instruction::MUL; - } - else - { - if (_arrayType.getBaseType()->getStorageSize() != 1) - m_context << _arrayType.getBaseType()->getStorageSize() << eth::Instruction::MUL; - m_context << eth::Instruction::ADD << u256(0); - } - break; - case ArrayType::Location::Memory: - solAssert(false, "Memory lvalues not yet implemented."); + if (_arrayType.getBaseType()->getStorageSize() != 1) + m_context << _arrayType.getBaseType()->getStorageSize() << eth::Instruction::MUL; + m_context << eth::Instruction::ADD << u256(0); } + break; + case ArrayType::Location::Memory: + solAssert(false, "Memory lvalues not yet implemented."); } } diff --git a/libsolidity/Compiler.cpp b/libsolidity/Compiler.cpp index 8e2634499..886565cb4 100644 --- a/libsolidity/Compiler.cpp +++ b/libsolidity/Compiler.cpp @@ -254,7 +254,6 @@ void Compiler::appendCalldataUnpacker(TypePointers const& _typeParameters, bool void Compiler::appendReturnValuePacker(TypePointers const& _typeParameters) { - //@todo this can be also done more efficiently unsigned dataOffset = 0; unsigned stackDepth = 0; for (TypePointer const& type: _typeParameters) @@ -303,9 +302,6 @@ bool Compiler::visit(VariableDeclaration const& _variableDeclaration) bool Compiler::visit(FunctionDefinition const& _function) { CompilerContext::LocationSetter locationSetter(m_context, _function); - //@todo to simplify this, the calling convention could by changed such that - // caller puts: [retarg0] ... [retargm] [return address] [arg0] ... [argn] - // although note that this reduces the size of the visible stack m_context.startFunction(_function); diff --git a/libsolidity/CompilerUtils.cpp b/libsolidity/CompilerUtils.cpp index 454951147..8d3e9d2a2 100644 --- a/libsolidity/CompilerUtils.cpp +++ b/libsolidity/CompilerUtils.cpp @@ -93,7 +93,7 @@ void CompilerUtils::storeInMemoryDynamic(Type const& _type, bool _padToWordBound else { solAssert(type.getLocation() == ArrayType::Location::Storage, "Memory arrays not yet implemented."); - m_context << eth::Instruction::POP; //@todo + m_context << eth::Instruction::POP; // remove offset, arrays always start new slot m_context << eth::Instruction::DUP1 << eth::Instruction::SLOAD; // stack here: memory_offset storage_offset length_bytes // jump to end if length is zero diff --git a/libsolidity/LValue.cpp b/libsolidity/LValue.cpp index 234072bce..02e6cbca5 100644 --- a/libsolidity/LValue.cpp +++ b/libsolidity/LValue.cpp @@ -225,7 +225,8 @@ void StorageItem::setToZero(SourceLocation const&, bool _removeReference) const else if (m_dataType.getCategory() == Type::Category::Struct) { // stack layout: storage_key storage_offset - // @todo this can be improved for packed types + // @todo this can be improved: use StorageItem for non-value types, and just store 0 in + // all slots that contain value types later. auto const& structType = dynamic_cast(m_dataType); for (auto const& member: structType.getMembers()) { @@ -245,7 +246,6 @@ void StorageItem::setToZero(SourceLocation const&, bool _removeReference) const else { solAssert(m_dataType.isValueType(), "Clearing of unsupported type requested: " + m_dataType.toString()); - // @todo actually use offset if (!_removeReference) CompilerUtils(m_context).copyToStackTop(sizeOnStack(), sizeOnStack()); if (m_dataType.getStorageBytes() == 32) diff --git a/libsolidity/Parser.cpp b/libsolidity/Parser.cpp index 5c7676df5..43571314a 100644 --- a/libsolidity/Parser.cpp +++ b/libsolidity/Parser.cpp @@ -472,17 +472,18 @@ ASTPointer Parser::parseTypeName(bool _allowVar) else BOOST_THROW_EXCEPTION(createParserError("Expected type name")); - // Parse "[...]" postfixes for arrays. - while (m_scanner->getCurrentToken() == Token::LBrack) - { - m_scanner->next(); - ASTPointer length; - if (m_scanner->getCurrentToken() != Token::RBrack) - length = parseExpression(); - nodeFactory.markEndPosition(); - expectToken(Token::RBrack); - type = nodeFactory.createNode(type, length); - } + if (type) + // Parse "[...]" postfixes for arrays. + while (m_scanner->getCurrentToken() == Token::LBrack) + { + m_scanner->next(); + ASTPointer length; + if (m_scanner->getCurrentToken() != Token::RBrack) + length = parseExpression(); + nodeFactory.markEndPosition(); + expectToken(Token::RBrack); + type = nodeFactory.createNode(type, length); + } return type; } diff --git a/libsolidity/Types.h b/libsolidity/Types.h index e1852bc7f..e6d32d175 100644 --- a/libsolidity/Types.h +++ b/libsolidity/Types.h @@ -345,7 +345,7 @@ public: explicit ArrayType(Location _location): m_location(_location), m_isByteArray(true), - m_baseType(std::make_shared(8)) + m_baseType(std::make_shared(1)) {} /// Constructor for a dynamically sized array type ("type[]") ArrayType(Location _location, const TypePointer &_baseType): diff --git a/mix/qml/LogsPane.qml b/mix/qml/LogsPane.qml index 6b8a66638..eb8669df6 100644 --- a/mix/qml/LogsPane.qml +++ b/mix/qml/LogsPane.qml @@ -146,10 +146,13 @@ Rectangle DefaultLabel { + id: dateLabel text: date; font.family: logStyle.generic.layout.logLabelFont width: logStyle.generic.layout.dateWidth font.pointSize: appStyle.absoluteSize(-1) + clip: true + elide: Text.ElideRight anchors.left: parent.left anchors.leftMargin: 15 anchors.verticalCenter: parent.verticalCenter @@ -160,11 +163,14 @@ Rectangle DefaultLabel { text: type; + id: typeLabel font.family: logStyle.generic.layout.logLabelFont width: logStyle.generic.layout.typeWidth + clip: true + elide: Text.ElideRight font.pointSize: appStyle.absoluteSize(-1) - anchors.left: parent.left - anchors.leftMargin: 100 + anchors.left: dateLabel.right + anchors.leftMargin: 2 anchors.verticalCenter: parent.verticalCenter color: { parent.getColor(level); @@ -179,8 +185,8 @@ Rectangle font.pointSize: appStyle.absoluteSize(-1) anchors.verticalCenter: parent.verticalCenter elide: Text.ElideRight - anchors.left: parent.left - anchors.leftMargin: 230 + anchors.left: typeLabel.right + anchors.leftMargin: 2 color: { parent.getColor(level); } @@ -242,6 +248,8 @@ Rectangle width: 40 DefaultLabel { + width: 40 + elide: Text.ElideRight anchors.verticalCenter: parent.verticalCenter color: logStyle.generic.layout.logLabelColor font.pointSize: appStyle.absoluteSize(-3) @@ -268,7 +276,7 @@ Rectangle id: javascriptButton checkable: true height: logStyle.generic.layout.headerButtonHeight - width: 20 + width: 30 anchors.verticalCenter: parent.verticalCenter checked: true onCheckedChanged: { @@ -279,12 +287,22 @@ Rectangle ButtonStyle { label: Item { - DefaultLabel { - font.family: logStyle.generic.layout.logLabelFont - font.pointSize: appStyle.absoluteSize(-3) - color: logStyle.generic.layout.logLabelColor + Rectangle + { + width: labelJs.width + height: labelJs.height anchors.centerIn: parent - text: qsTr("JS") + color: "transparent" + DefaultLabel { + id: labelJs + width: 15 + elide: Text.ElideRight + anchors.horizontalCenter: parent.horizontalCenter + font.family: logStyle.generic.layout.logLabelFont + font.pointSize: appStyle.absoluteSize(-3) + color: logStyle.generic.layout.logLabelColor + text: qsTr("JS") + } } } background: @@ -312,7 +330,7 @@ Rectangle id: runButton checkable: true height: logStyle.generic.layout.headerButtonHeight - width: 30 + width: 40 anchors.verticalCenter: parent.verticalCenter checked: true onCheckedChanged: { @@ -323,12 +341,22 @@ Rectangle ButtonStyle { label: Item { - DefaultLabel { - font.family: logStyle.generic.layout.logLabelFont - font.pointSize: appStyle.absoluteSize(-3) - color: logStyle.generic.layout.logLabelColor + Rectangle + { + width: labelRun.width + height: labelRun.height anchors.centerIn: parent - text: qsTr("Run") + color: "transparent" + DefaultLabel { + id: labelRun + width: 25 + anchors.horizontalCenter: parent.horizontalCenter + elide: Text.ElideRight + font.family: logStyle.generic.layout.logLabelFont + font.pointSize: appStyle.absoluteSize(-3) + color: logStyle.generic.layout.logLabelColor + text: qsTr("Run") + } } } background: @@ -357,7 +385,7 @@ Rectangle checkable: true height: logStyle.generic.layout.headerButtonHeight anchors.verticalCenter: parent.verticalCenter - width: 35 + width: 40 checked: true onCheckedChanged: { proxyModel.toogleFilter("state") @@ -367,12 +395,22 @@ Rectangle ButtonStyle { label: Item { - DefaultLabel { - font.family: logStyle.generic.layout.logLabelFont - font.pointSize: appStyle.absoluteSize(-3) - color: logStyle.generic.layout.logLabelColor + Rectangle + { + width: labelState.width + height: labelState.height anchors.centerIn: parent - text: qsTr("State") + color: "transparent" + DefaultLabel { + id: labelState + width: 30 + anchors.horizontalCenter: parent.horizontalCenter + elide: Text.ElideRight + font.family: logStyle.generic.layout.logLabelFont + font.pointSize: appStyle.absoluteSize(-3) + color: logStyle.generic.layout.logLabelColor + text: qsTr("State") + } } } background: @@ -411,12 +449,22 @@ Rectangle ButtonStyle { label: Item { - DefaultLabel { - font.family: logStyle.generic.layout.logLabelFont - font.pointSize: appStyle.absoluteSize(-3) - color: logStyle.generic.layout.logLabelColor + Rectangle + { + width: labelDeploy.width + height: labelDeploy.height anchors.centerIn: parent - text: qsTr("Deploy.") + color: "transparent" + DefaultLabel { + width: 40 + id: labelDeploy + anchors.horizontalCenter: parent.horizontalCenter + elide: Text.ElideRight + font.family: logStyle.generic.layout.logLabelFont + font.pointSize: appStyle.absoluteSize(-3) + color: logStyle.generic.layout.logLabelColor + text: qsTr("Deploy.") + } } } background: diff --git a/mix/qml/LogsPaneStyle.qml b/mix/qml/LogsPaneStyle.qml index fe50610c8..31433def1 100644 --- a/mix/qml/LogsPaneStyle.qml +++ b/mix/qml/LogsPaneStyle.qml @@ -17,8 +17,8 @@ QtObject { property string logLabelColor: "#4a4a4a" property string logLabelFont: "sans serif" property int headerInputWidth: 200 - property int dateWidth: 150 - property int typeWidth: 150 + property int dateWidth: 100 + property int typeWidth: 100 property int contentWidth: 560 property string logAlternateColor: "#f6f5f6" property string errorColor: "#fffcd5" diff --git a/mix/qml/StatusPane.qml b/mix/qml/StatusPane.qml index 8e00eb759..d36b6fa75 100644 --- a/mix/qml/StatusPane.qml +++ b/mix/qml/StatusPane.qml @@ -142,7 +142,6 @@ Rectangle { anchors.verticalCenter: parent.verticalCenter anchors.horizontalCenter: parent.horizontalCenter font.pointSize: appStyle.absoluteSize(-1) - height: 15 font.family: "sans serif" objectName: "status" wrapMode: Text.WrapAnywhere diff --git a/test/SolidityNameAndTypeResolution.cpp b/test/SolidityNameAndTypeResolution.cpp index 74a488883..ffa78ed9e 100644 --- a/test/SolidityNameAndTypeResolution.cpp +++ b/test/SolidityNameAndTypeResolution.cpp @@ -99,7 +99,7 @@ BOOST_AUTO_TEST_CASE(smoke_test) { char const* text = "contract test {\n" " uint256 stateVariable1;\n" - " function fun(uint256 arg1) { var x; uint256 y; }" + " function fun(uint256 arg1) { uint256 y; }" "}\n"; ETH_TEST_CHECK_NO_THROW(parseTextAndResolveNames(text), "Parsing and Name Resolving Failed"); } @@ -1623,6 +1623,16 @@ BOOST_AUTO_TEST_CASE(bytes0_array) BOOST_CHECK_THROW(parseTextAndResolveNames(text), TypeError); } +BOOST_AUTO_TEST_CASE(uninitialized_var) +{ + char const* sourceCode = R"( + contract C { + function f() returns (uint) { var x; return 2; } + } + )"; + BOOST_CHECK_THROW(parseTextAndResolveNames(sourceCode), TypeError); +} + BOOST_AUTO_TEST_SUITE_END() } diff --git a/test/SolidityParser.cpp b/test/SolidityParser.cpp index b76f00656..7cd8efce1 100644 --- a/test/SolidityParser.cpp +++ b/test/SolidityParser.cpp @@ -841,6 +841,15 @@ BOOST_AUTO_TEST_CASE(constant_is_keyword) BOOST_CHECK_THROW(parseText(text), ParserError); } +BOOST_AUTO_TEST_CASE(var_array) +{ + char const* text = R"( + contract Foo { + function f() { var[] a; } + })"; + BOOST_CHECK_THROW(parseText(text), ParserError); +} + BOOST_AUTO_TEST_SUITE_END() } diff --git a/test/dagger.cpp b/test/dagger.cpp index 367c422ad..cb8908d32 100644 --- a/test/dagger.cpp +++ b/test/dagger.cpp @@ -64,7 +64,7 @@ BOOST_AUTO_TEST_CASE(basic_test) unsigned cacheSize(o["cache_size"].get_int()); h256 cacheHash(o["cache_hash"].get_str()); BOOST_REQUIRE_EQUAL(EthashAux::get()->params(header).cache_size, cacheSize); - BOOST_REQUIRE_EQUAL(sha3(bytesConstRef((byte const*)EthashAux::get()->light(header), cacheSize)), cacheHash); + BOOST_REQUIRE_EQUAL(sha3(EthashAux::get()->light(header)->data()), cacheHash); #if TEST_FULL unsigned fullSize(o["full_size"].get_int());