diff --git a/configure b/configure index 259f172ee..239c41b02 100755 --- a/configure +++ b/configure @@ -2,3 +2,8 @@ ./configure_makefile Makefile ./configure_makefile umkMakefile + +uname=`uname` +if [[ "$uname" == 'Darwin' ]]; then + sed -i.bak 's/-DflagOSX/-DflagOSX -DflagNOMM/' umkMakefile +fi diff --git a/configure_makefile b/configure_makefile index 020130969..71fdf0767 100755 --- a/configure_makefile +++ b/configure_makefile @@ -67,5 +67,6 @@ if [[ "$uname" == 'Darwin' ]]; then sed -i.bak 's/-Wl,-s/ /' $1 sed -i.bak 's/-Wl,--start-group/ /' $1 sed -i.bak 's/-Wl,--end-group/ /' $1 - sed -i.bak 's/-DflagLINUX/-DflagBSD -DflagOSX -DflagNOMM/' $1 + sed -i.bak 's/-DflagLINUX/-DflagBSD -DflagOSX/' umkMakefile + sed -i.bak 's/$(LIBPATH) -Wl,-O,2 $(LDFLAGS)/$(LIBPATH) $(LDFLAGS)/' $1 fi diff --git a/uppbox/MakePosixInstall/Main.cpp b/uppbox/MakePosixInstall/Main.cpp index ad33b90c5..a0f67e3ef 100644 --- a/uppbox/MakePosixInstall/Main.cpp +++ b/uppbox/MakePosixInstall/Main.cpp @@ -130,7 +130,7 @@ CONSOLE_APP_MAIN Syx(GetHomeDirFile("bin/umk") + " ./uppsrc umk GCC32 " OPTS + release + "/umks32"); #endif - Syx(GetHomeDirFile("bin/umk") + " ./uppsrc umk GCC -rvsM"); + Syx(GetHomeDirFile("bin/umk") + " ./uppsrc umk GCC +NOMM -rvsM"); FixMakefile(release + "/umkMakefile.in", release + "/Makefile"); Syx(GetHomeDirFile("bin/umk") + " ./uppsrc ide GCC -rvsM theide"); FixMakefile(release + "/Makefile.in", release + "/Makefile"); diff --git a/uppbox/MakePosixInstall/scripts.cpp b/uppbox/MakePosixInstall/scripts.cpp index b4a74e6b5..ce29b42ff 100644 --- a/uppbox/MakePosixInstall/scripts.cpp +++ b/uppbox/MakePosixInstall/scripts.cpp @@ -11,59 +11,78 @@ AskContinue() uname=`uname` -if [ -x "$(command -v apt-get)" ]; then - DEP="apt-get install g++ clang clang-format git make libgtk-3-dev libnotify-dev libbz2-dev libssl-dev xdotool" -elif [ -x "$(command -v dnf)" ]; then - DEP="dnf install gcc-c++ clang clang-tools-extra git make gtk3-devel libnotify-devel bzip2-devel freetype-devel openssl-devel" -elif [ -x "$(command -v yum)" ]; then - DEP="yum install gcc-c++ clang clang-tools-extra git make gtk3-devel libnotify-devel bzip2-devel freetype-devel openssl-devel" -elif [ -x "$(command -v urpmi)" ]; then - DEP="urpmi gcc-c++ clang clang-tools-extra git make gtk3-devel libnotify-devel bzip2-devel freetype-devel openssl-devel" -elif [ -x "$(command -v zypper)" ]; then - DEP="zypper install gcc-c++ clang git make gtk3-devel libnotify-devel bzip2-devel freetype-devel libopenssl-devel" -elif [ -x "$(command -v pacman)" ]; then - DEP="pacman -Sy --needed gcc clang git make zlib bzip2 gtk3 libnotify openssl pkgconf gdb" -elif [ -x "$(command -v pkg)" ]; then - DEP="pkg install bash gmake git gtk3 libnotify llvm90 pkgconf" - if [[ "$uname" == 'SunOS' ]]; then - DEP="pkg install bash git gtk3 libnotify developer/clang-80 build-essential" - fi -elif [ -x "$(command -v pkg_add)" ]; then - DEP="pkg_add bash git gmake gtk3 libnotify clang-devel" -fi - -if [[ "$uname" == 'OpenBSD' ]]; then +if [[ "$uname" == 'Darwin' ]]; then DEP="" -fi - -if [ -z "$DEP" ]; then - if [[ "$uname" == 'OpenBSD' ]]; then - echo Automatic dependecies installation is not supported on OpenBSD. - echo See README for details. + if which brew; then + echo "Homebrew is already installed" else - echo Packaging system was not identified. - echo Automatic dependency instalation has failed. - echo You will have to install required packages manually. + echo "Installing Homebrew package management system (to obtain openssl libraries required for U++)" + AskContinue + /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" fi - echo Please make sure that build dependecies are satisfied. - AskContinue -else - echo Following command should be used to install required packages: - echo - echo sudo $DEP - echo - echo Install script can run this command for you, but that will require - echo your sudo password. - read -p "Do you want the script to do that (Y/n)?" answer - if [ "$answer" == "${answer//[nN]/x}" ]; then - if ! eval 'sudo $DEP'; then - echo Failed to install all required packages. - echo You will have to install required packages manually. - AskContinue - fi + brew install openssl + if clang++ --version; then + echo "Commandline Development Tools already installed" else - echo Please make sure that build dependecies are satisfied. - AskContinue + echo "Please install the Commandline Development Tools with GUI." + echo "Please wait until the installation is finished." + AskContinue + fi +else + if [ -x "$(command -v apt-get)" ]; then + DEP="apt-get install g++ clang clang-format git make libgtk-3-dev libnotify-dev libbz2-dev libssl-dev xdotool" + elif [ -x "$(command -v dnf)" ]; then + DEP="dnf install gcc-c++ clang clang-tools-extra git make gtk3-devel libnotify-devel bzip2-devel freetype-devel openssl-devel" + elif [ -x "$(command -v yum)" ]; then + DEP="yum install gcc-c++ clang clang-tools-extra git make gtk3-devel libnotify-devel bzip2-devel freetype-devel openssl-devel" + elif [ -x "$(command -v urpmi)" ]; then + DEP="urpmi gcc-c++ clang clang-tools-extra git make gtk3-devel libnotify-devel bzip2-devel freetype-devel openssl-devel" + elif [ -x "$(command -v zypper)" ]; then + DEP="zypper install gcc-c++ clang git make gtk3-devel libnotify-devel bzip2-devel freetype-devel libopenssl-devel" + elif [ -x "$(command -v pacman)" ]; then + DEP="pacman -Sy --needed gcc clang git make zlib bzip2 gtk3 libnotify openssl pkgconf gdb" + elif [ -x "$(command -v pkg)" ]; then + DEP="pkg install bash gmake git gtk3 libnotify llvm90 pkgconf" + if [[ "$uname" == 'SunOS' ]]; then + DEP="pkg install bash git gtk3 libnotify developer/clang-80 build-essential" + fi + elif [ -x "$(command -v pkg_add)" ]; then + DEP="pkg_add bash git gmake gtk3 libnotify clang-devel" + fi + + if [[ "$uname" == 'OpenBSD' ]]; then + DEP="" + fi + + if [ -z "$DEP" ]; then + if [[ "$uname" == 'OpenBSD' ]]; then + echo Automatic dependecies installation is not supported on OpenBSD. + echo See README for details. + else + echo Packaging system was not identified. + echo Automatic dependency instalation has failed. + echo You will have to install required packages manually. + fi + echo Please make sure that build dependecies are satisfied. + AskContinue + else + echo Following command should be used to install required packages: + echo + echo sudo $DEP + echo + echo Install script can run this command for you, but that will require + echo your sudo password. + read -p "Do you want the script to do that (Y/n)?" answer + if [ "$answer" == "${answer//[nN]/x}" ]; then + if ! eval 'sudo $DEP'; then + echo Failed to install all required packages. + echo You will have to install required packages manually. + AskContinue + fi + else + echo Please make sure that build dependecies are satisfied. + AskContinue + fi fi fi @@ -93,17 +112,26 @@ else $UMK ./uppsrc umk GCC -brs ./umk fi -if [ -x ./theide ]; then - echo Install process has been finished, TheIDE is built as ./theide +theide=./theide + +if [[ "$uname" == 'Darwin' ]]; then + theide=./theide.app/Contents/MacOS/theide +fi + +if [ -x "$theide" ]; then + echo Install process has been finished, TheIDE is built as $theide read -p "Do you want to start TheIDE now? (Y/n):" answer if [ "$answer" == "${answer//[nN]/x}" ]; then - ./theide + if [[ "$uname" == 'Darwin' ]]; then + open theide.app + else + $theide + fi fi else echo Something went wrong. - echo Please use 'make' to compile theide and/or notify developers. + echo Please notify developers. fi - )--"; const char *clean_script = diff --git a/uppsrc/ide/Builders/Cocoa.cpp b/uppsrc/ide/Builders/Cocoa.cpp index 72fc190ac..375c64129 100644 --- a/uppsrc/ide/Builders/Cocoa.cpp +++ b/uppsrc/ide/Builders/Cocoa.cpp @@ -53,7 +53,8 @@ void GccBuilder::CocoaAppBundle() PNGEncoder().SaveFile(AppendFileName(icons, fn), Rescale(img, n, n)); } - Execute(String() << "iconutil --convert icns --output " << icns << " " << icons); + String exec = String() << "iconutil --convert icns --output \"" << icns << "\" \"" << icons << "\""; + Execute(exec); } if(IsNull(Info_plist)) { diff --git a/uppsrc/ide/Builders/Install.cpp b/uppsrc/ide/Builders/Install.cpp index d7441c830..df5716769 100644 --- a/uppsrc/ide/Builders/Install.cpp +++ b/uppsrc/ide/Builders/Install.cpp @@ -7,11 +7,11 @@ const char *clang_bm = R"(BUILDER = "CLANG"; COMPILER = "clang++"; -COMMON_OPTIONS = "-mmacosx-version-min=10.13"; +COMMON_OPTIONS = "$COMMON$"; COMMON_CPP_OPTIONS = "-std=c++14 -Wall -Wno-logical-op-parentheses"; COMMON_C_OPTIONS = ""; COMMON_LINK = "$COMMON$"; -COMMON_FLAGS = "$COMMON$"; +COMMON_FLAGS = ""; DEBUG_INFO = "2"; DEBUG_BLITZ = "1"; DEBUG_LINKMODE = "1"; @@ -28,7 +28,7 @@ ALLOW_PRECOMPILED_HEADERS = "0"; DISABLE_BLITZ = "0"; PATH = ""; INCLUDE = "$INCLUDE$"; -LIB = "$LIB$; +LIB = "$LIB$"; LINKMODE_LOCK = "0";)"; #elif PLATFORM_SOLARIS