diff --git a/configure_makefile b/configure_makefile index dceb530a2..020130969 100755 --- a/configure_makefile +++ b/configure_makefile @@ -59,15 +59,13 @@ fi if [[ "$uname" == 'Darwin' ]]; then echo Configuring $1 for MacOS - sed -i.bak 's/\`pkg-config --cflags libpng\` \`pkg-config --cflags freetype2\` \`pkg-config --cflags x11\` \`pkg-config --cflags fontconfig\` \`pkg-config --cflags xcb\` \`pkg-config --cflags expat\`/ /' $1 sed -i.bak 's/-Wl,--gc-sections $(LINKOPTIONS)/$(LINKOPTIONS)/' $1 - sed -i.bak 's/$(LINKER) -o "$(OutFile)" -Wl,-s $(LIBPATH) -Wl,-O,2 $(LDFLAGS) -Wl,--start-group/$(LINKER) -o "$(OutFile)" $(LIBPATH) $(LDFLAGS)/' $1 - sed -i.bak 's/\`pkg-config --libs libpng\`/ /' $1 - sed -i.bak 's/\`pkg-config --libs freetype2\`/ /' $1 - sed -i.bak 's/\`pkg-config --libs x11\`/ /' $1 - sed -i.bak 's/\`pkg-config --libs fontconfig\`/ /' $1 - sed -i.bak 's/\`pkg-config --libs xcb\`/ /' $1 - sed -i.bak 's/\`pkg-config --libs expat\`/ /' $1 - sed -i.bak 's/-lrt /-lpng /' $1 + sed -i.bak 's/\`pkg-config --cflags .*\`/ /' $1 + sed -i.bak 's/\`pkg-config --libs .*\`/ /' $1 + sed -i.bak 's/-lrt / -framework Foundation -framework Cocoa -framework Carbon /' $1 + sed -i.bak 's/-lpng / /' $1 + 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 fi diff --git a/uppbox/MakePosixInstall/Main.cpp b/uppbox/MakePosixInstall/Main.cpp index 2f3b3a923..ad33b90c5 100644 --- a/uppbox/MakePosixInstall/Main.cpp +++ b/uppbox/MakePosixInstall/Main.cpp @@ -131,9 +131,9 @@ CONSOLE_APP_MAIN #endif Syx(GetHomeDirFile("bin/umk") + " ./uppsrc umk GCC -rvsM"); - FixMakefile(release + "/umkMakefile", release + "/Makefile"); + FixMakefile(release + "/umkMakefile.in", release + "/Makefile"); Syx(GetHomeDirFile("bin/umk") + " ./uppsrc ide GCC -rvsM theide"); - FixMakefile(release + "/Makefile", release + "/Makefile"); + FixMakefile(release + "/Makefile.in", release + "/Makefile"); SaveFile(release + "/license.chk", "1"); diff --git a/uppbox/MakePosixInstall/scripts.cpp b/uppbox/MakePosixInstall/scripts.cpp index 0f4ec0fb3..b4a74e6b5 100644 --- a/uppbox/MakePosixInstall/scripts.cpp +++ b/uppbox/MakePosixInstall/scripts.cpp @@ -1,5 +1,5 @@ const char *install_script = -R"--(#!/usr/bin/env bash +R"--(##!/usr/bin/env bash AskContinue() { @@ -83,10 +83,12 @@ if [ -z "$UMK" ]; then UMK="./umk" fi -if clang++ 2>/dev/null; then +if clang++ --version >/dev/null; then + echo $UMK ./uppsrc ide CLANG -brs ./theide $UMK ./uppsrc ide CLANG -brs ./theide $UMK ./uppsrc umk CLANG -brs ./umk else + echo $UMK ./uppsrc ide GCC -brs ./theide $UMK ./uppsrc ide GCC -brs ./theide $UMK ./uppsrc umk GCC -brs ./umk fi diff --git a/uppsrc/Draw/Draw.upp b/uppsrc/Draw/Draw.upp index 382c0b715..9b3544528 100644 --- a/uppsrc/Draw/Draw.upp +++ b/uppsrc/Draw/Draw.upp @@ -10,7 +10,7 @@ uses library(WIN32) "usp10 user32 gdi32"; -link(OSX !X11) "-framework Foundation -framework Cocoa -framework Carbon"; +link(OSX !X11 !NOMM) "-framework Foundation -framework Cocoa -framework Carbon"; pkg_config(POSIX !OSX) "freetype2 fontconfig"; @@ -25,6 +25,7 @@ file FontWin32.cpp, FontFc.cpp, FontCoco.mm, + FontCocoNOMM.cpp, Draw.cpp, DrawText.cpp, DrawData.cpp, diff --git a/uppsrc/Draw/FontCoco.mm b/uppsrc/Draw/FontCoco.mm index 94fad406a..a5fe82b41 100644 --- a/uppsrc/Draw/FontCoco.mm +++ b/uppsrc/Draw/FontCoco.mm @@ -3,7 +3,7 @@ #define LLOG(x) // LOG(x) #define LTIMING(x) // TIMING(x) -#if !defined(CUSTOM_FONTSYS) && defined(PLATFORM_COCOA) +#if !defined(CUSTOM_FONTSYS) && defined(PLATFORM_COCOA) && !defined(flagNOMM) #define Point NS_Point #define Rect NS_Rect diff --git a/uppsrc/Draw/FontCocoNOMM.cpp b/uppsrc/Draw/FontCocoNOMM.cpp new file mode 100644 index 000000000..f3c555e65 --- /dev/null +++ b/uppsrc/Draw/FontCocoNOMM.cpp @@ -0,0 +1,44 @@ +#include "Draw.h" + +#define LLOG(x) // LOG(x) +#define LTIMING(x) // TIMING(x) + +#if !defined(CUSTOM_FONTSYS) && defined(PLATFORM_COCOA) && defined(flagNOMM) + +// NOMM serves mostly to build umk (or other console app) without Objective-C++ + +namespace Upp { + +CommonFontInfo GetFontInfoSys(Font font) +{ + CommonFontInfo fi; + return fi; +} + +GlyphInfo GetGlyphInfoSys(Font font, int chr) +{ + GlyphInfo gi; + gi.lspc = gi.rspc = 0; + gi.width = 0x8000; + gi.glyphi = 0; + return gi; +} + +Vector GetAllFacesSys() +{ + Vector r; + return r; +} + +String GetFontDataSys(Font font, const char *table, int offset, int size) +{ // read truetype or opentype table + return Null; +} + +void RenderCharacterSys(FontGlyphConsumer& sw, double x, double y, int chr, Font font) +{ +} + +}; + +#endif diff --git a/uppsrc/ide/Install.cpp b/uppsrc/ide/Install.cpp index 77e984c72..562c2a453 100644 --- a/uppsrc/ide/Install.cpp +++ b/uppsrc/ide/Install.cpp @@ -92,10 +92,12 @@ bool Install(bool& hasvars) Scan(GetHomeDirFile("upp.src/*")); Scan(GetHomeDirFile("upp/uppsrc")); Scan(GetHomeDirFile("upp/*")); + #ifndef PLATFORM_COCOA // otherwise macos complains about Documents/Music etc... Scan(GetHomeDirFile("*")); for(FindFile ff(GetHomeDirFile("*")); ff; ff.Next()) if(ff.IsFolder()) Scan(ff.GetPath() + "/*"); + #endif } CreateBuildMethods(); diff --git a/uppsrc/umk/umk.upp b/uppsrc/umk/umk.upp index 09077fb49..b397c6fde 100644 --- a/uppsrc/umk/umk.upp +++ b/uppsrc/umk/umk.upp @@ -12,5 +12,6 @@ file umake.cpp; mainconfig - "" = ""; + "" = "", + "" = "NOMM";