Пробовал ли кто-нибудь скомпилировать под Mac OS с homebrew?
У меня получилось (скорее не получилось) следующее:
Примечание1: если cmake запускать без параметров, то он просто выдает help страницу, поэтому запускаю с параметромandrei@Andreys-MacBook-Pro:~/Emulat/Xpeccy$ cmake -DDRAWING=Qt
-- Could NOT find ALSA (missing: ALSA_LIBRARY ALSA_INCLUDE_DIR)
-- Could NOT find SDL (missing: SDL_LIBRARY SDL_INCLUDE_DIR)
--
-- Project will be compiled with following options:
-- Package type : DEB
-- Painter : Qt
-- Endianness: little endian
-- Build type :
--
-- Configuring done
-- Generating done
-- Build files have been written to: /Users/andrei/Emulat/Xpeccy
andrei@Andreys-MacBook-Pro:~/Emulat/Xpeccy$ make
[ 1%] Generating src/xgui/moc_xgui.cxx
[ 2%] Generating ui_debuger.h
[ 3%] Generating ui_dumpdial.h
[ 4%] Generating ui_layedit.h
[ 5%] Generating ui_openDump.h
[ 6%] Generating ui_rsedit.h
[ 7%] Generating ui_rzxplayer.h
[ 9%] Generating ui_setupwin.h
[ 10%] Generating ui_tapewin.h
[ 11%] Generating ui_umadial.h
[ 12%] Generating qrc_xpeccy.cxx
[ 13%] Generating src/moc_emulwin.cxx
[ 14%] Generating src/moc_debuger.cxx
[ 15%] Generating src/moc_setupwin.cxx
Scanning dependencies of target xpeccy
[ 17%] Building CXX object CMakeFiles/xpeccy.dir/src/debuger.cpp.o
/Users/andrei/Emulat/Xpeccy/src/debuger.cpp:640:53: warning: equality comparison with extraneous parentheses [-Wparentheses-equality]
if (/*(labels[i].bank == bnk) && */(labels[i].adr == adr)) return &labels[i];
~~~~~~~~~~~~~~^~~~~~
/Users/andrei/Emulat/Xpeccy/src/debuger.cpp:640:53: note: remove extraneous parentheses around the comparison to silence this warning
if (/*(labels[i].bank == bnk) && */(labels[i].adr == adr)) return &labels[i];
~ ^ ~
/Users/andrei/Emulat/Xpeccy/src/debuger.cpp:640:53: note: use '=' to turn this equality comparison into an assignment
if (/*(labels[i].bank == bnk) && */(labels[i].adr == adr)) return &labels[i];
^~
=
1 warning generated.
[ 18%] Building CXX object CMakeFiles/xpeccy.dir/src/emulwin.cpp.o
/Users/andrei/Emulat/Xpeccy/src/emulwin.cpp:719:31: error: use of undeclared identifier 'SLASH'
fname = conf.path.confDir + SLASH + prf->name + ".cmos";
^
/Users/andrei/Emulat/Xpeccy/src/emulwin.cpp:726:32: error: use of undeclared identifier 'SLASH'
fname = conf.path.confDir + SLASH + prf->name + ".nvram";
^
/Users/andrei/Emulat/Xpeccy/src/emulwin.cpp:769:59: error: use of undeclared identifier 'SLASH'
QString fnams = QString(conf.scrShot.dir.c_str()).append(SLASH);
^
3 errors generated.
make[2]: *** [CMakeFiles/xpeccy.dir/src/emulwin.cpp.o] Error 1
make[1]: *** [CMakeFiles/xpeccy.dir/all] Error 2
make: *** [all] Error 2
Примечание2: если cmake запускаю из каталога build (как написано в первом сообщении), то получаю:
CMake Error: The source directory "/Users/andrei/Emulat/Xpeccy/build" does not appear to contain CMakeLists.txt.
Specify --help for usage, or press the help button on the CMake GUI.
Cmake нужен путь к CmakeLists.txt. Директория build делается, чтобы там мусорить. Поэтому минимум - cmake .. (.. это "на директорию выше", где CmakeLists и лежит)
По ошибке:
Для MAC надо определить SLASH (подозреваю, будет такой же, как для linux). Это в src/libxpeccy/filetypes/filetypes.h Там же определяется ENVHOME - как называется переменная окружения, указывающая на домашнюю директорию.
PS:SDL таки лучше доставить, а то вообще без звука останешься
Последний раз редактировалось SAM style; 04.10.2015 в 17:54.
Все любят гипножабу
С любовью к вам, Yandex.Direct
Размещение рекламы на форуме способствует его дальнейшему развитию
Спасибо, с этой ошибкой разобрался. Да, для мака тоже разделитель "/" и в $HOME путь к домашней папке, поэтому написал так:
Теперь 20 ошибок на XKEY_*:#if defined(__linux__) || defined(__APPLE__)
#define ENVHOME "HOME"
#define SLASH "/"
#endif
[ 11%] Building CXX object CMakeFiles/xpeccy.dir/src/xcore/keymap.cpp.o
/Users/andrei/Emulat/Xpeccy/src/xcore/keymap.cpp:182:7: error: use of undeclared identifier 'XKEY_1'
{"1",XKEY_1,'1',0,0,0,0x16},{"2",XKEY_2,'2',0,0,0, 0x1e},{"3",XKEY_3,'3',0,0,0,0x26},{"4",XKEY_4,'4', 0,0,0,0x25},{"5",XKEY_5,'5',0,0,0,0x2e},
^
(...)
/Users/andrei/Emulat/Xpeccy/src/xcore/keymap.cpp:185:91: error: use of undeclared identifier 'XKEY_O'
{"Y",XKEY_Y,'y',0,0,0,0x35},{"U",XKEY_U,'u',0,0,0, 0x3c},{"I",XKEY_I,'i',0,0,0,0x43},{"O",XKEY_O,'o', 0,0,0,0x44},{"P",XKEY_P,'p',0,0,0,0x4d},
^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
20 errors generated.
make[2]: *** [CMakeFiles/xpeccy.dir/src/xcore/keymap.cpp.o] Error 1
make[1]: *** [CMakeFiles/xpeccy.dir/all] Error 2
Их исправил в keymap.cpp:
было:
стало:#if __linux
Получил следующую ошибку:#if __linux || __APPLE__
Правлю filetypes/raw.c точно как в первом случае. После этого компиляция доходит до конца, но меня все еще смущают 3 варнинга:/Users/andrei/Emulat/Xpeccy/src/libxpeccy/filetypes/raw.c:46:30: error: use of undeclared identifier 'SLSH'
char* ptr = strrchr(name, SLSH);
Попытака запуска:/Users/andrei/Emulat/Xpeccy/src/libxpeccy/filetypes/rzx.c:126:6: warning: 'tmpnam' is deprecated: This function is provided for compatibility reasons only. Due to
security concerns inherent in the design of tmpnam(3), it is highly recommended that you use mkstemp(3) instead. [-Wdeprecated-declarations]
tmpnam(sname);
^
/usr/include/stdio.h:276:7: note: 'tmpnam' has been explicitly marked deprecated here
char *tmpnam(char *);
^
/Users/andrei/Emulat/Xpeccy/src/libxpeccy/filetypes/unpackers/lh1/bit_stream_reader.c:47:13: warning: unused function 'bit_stream_reader_init' [-Wunused-function]
static void bit_stream_reader_init(BitStreamReader *reader,
^
/Users/andrei/Emulat/Xpeccy/src/libxpeccy/filetypes/unpackers/lh1/bit_stream_reader.c:126:12: warning: unused function 'read_bit' [-Wunused-function]
static int read_bit(BitStreamReader *reader)
^
$ xpeccy
Using Qt painter
Using Qt ver 4.8.7
Main config is missing. Default files will be copied
QFSFileEngine:pen: No file name specified
Segmentation fault: 11
Последний раз редактировалось Spectre; 04.10.2015 в 22:18.
А у кого-нибудь всё таки получилось собрать его для ARM устройств, типа Raspberry Pi. По идее мощности RPi2 уже должно хватить на безтормозную работу XSpeccy.
С уважением, Станислав.
Эту тему просматривают: 5 (пользователей: 0 , гостей: 5)