webMAN-MOD icon indicating copy to clipboard operation
webMAN-MOD copied to clipboard

[Question] how to compile on Mac OS X Lion without Meson?

Open Lion4K opened this issue 4 years ago • 26 comments

Mine is an old mac mini mid 2007, only capable of running OSX Lion 10.7.5

I can't run python3 gives a segmentation error, so I cannot install meson.

I do have xcode and I tried running make but I got an error. Something about windows idk.

Then I tried renaming the makefile.macos to makefile and I got another error.

This time it says:

fatal error: 'endian.h' file not found. #include <endian.h> ^ 1 error generated. Make: *** [src/main.o] Error 1

Lion4K avatar Jan 26 '21 13:01 Lion4K

Try changing #include <endian.h> to #include <sys/types.h>

Vladimir Stolyarov @xakep666 submitted a fix for this issue on Jan 4, 2021 This is the commit: https://github.com/aldostools/webMAN-MOD/commit/1b6ec2725b0d08c46acec6268948e56f3776267e

aldostools avatar Jan 26 '21 13:01 aldostools

Inside the makefile ?

Lion4K avatar Jan 26 '21 13:01 Lion4K

No, in the file include/common.h Check the commit: https://github.com/aldostools/webMAN-MOD/commit/1b6ec2725b0d08c46acec6268948e56f3776267e

aldostools avatar Jan 26 '21 13:01 aldostools

Ok, now it gives 2 errors

Lion4K avatar Jan 26 '21 13:01 Lion4K

heres the error

https://pastebin.com/CDMMPS57

Lion4K avatar Jan 26 '21 14:01 Lion4K

I was trying the dumb way, idk, sounds dumb, I twas saying file not found so i was searching for them sources and adding them to the folder, and one next one starting with the endian.h

Lion4K avatar Jan 26 '21 14:01 Lion4K

this is what i was trying

https://pastebin.com/3ATUFF3s

Lion4K avatar Jan 26 '21 14:01 Lion4K

Please use the latest commit in ps3netsrv folder of the Projects

You probably are using ps3netsrv_20200708.zip that is from July 8, 2020.

aldostools avatar Jan 26 '21 14:01 aldostools

The error in your pastebin clearly says: ./include/common.h:14:10: fatal error: 'endian.h' file not found

That means that you didn't change what I have already told you 3 times

aldostools avatar Jan 26 '21 14:01 aldostools

oh no, that was what I WAS trying, before asking.

Lion4K avatar Jan 26 '21 14:01 Lion4K

Ok, so i downloaded the new version you linked me.

renamed the makefile.macos to makefile and got this when running make

Lions-Mac-mini:ps3netsrv lion$ make g++ -Wall -Wno-format -I./include -std=c++0x -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -DPOLARSSL -D_OS_WINDOWS -DWIN32 -static -O3 -DNDEBUG -c -o src/main.o src/main.cpp cc1plus: error: unrecognized command line option "-std=c++0x" make: *** [src/main.o] Error 1 Lions-Mac-mini:ps3netsrv lion$ make c++ -Wall -Wno-format -I./include -std=c++0x -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -DPOLARSSL -Doff64_t=off_t -O3 -DNDEBUG -c -o src/main.o src/main.cpp src/main.cpp:2:10: fatal error: 'cstdint' file not found #include ^ 1 error generated. make: *** [src/main.o] Error 1 Lions-Mac-mini:ps3netsrv lion$

Lion4K avatar Jan 26 '21 14:01 Lion4K

You are compiling with the default Makefile that is for Windows See the command line says: -D_OS_WINDOWS -DWIN32

Use Makefile.macos

aldostools avatar Jan 26 '21 14:01 aldostools

Oh I see you renamed the file. Try the Makefile.linux

aldostools avatar Jan 26 '21 14:01 aldostools

but I renamed the makefile.macos to makefile alredy, isnt supposed to be using that file alredy?

Lion4K avatar Jan 26 '21 14:01 Lion4K

ok, im gonna try the linux one

Lion4K avatar Jan 26 '21 14:01 Lion4K

Lions-Mac-mini:ps3netsrv lion$ make c++ -Wall -Wno-format -I./include -std=c++0x -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -DPOLARSSL -Doff64_t=off_t -static -O3 -DNDEBUG -c -o src/main.o src/main.cpp src/main.cpp:2:10: fatal error: 'cstdint' file not found #include ^ 1 error generated. make: *** [src/main.o] Error 1 Lions-Mac-mini:ps3netsrv lion$

Lion4K avatar Jan 26 '21 14:01 Lion4K

i think its the same error no?

Lion4K avatar Jan 26 '21 14:01 Lion4K

I checked Makefile.macos and the flags -D_OS_WINDOWS -DWIN32 are used only if OS = 'windows'

You probably didn't use the correct file.

Extract the zip again, do not rename anything and try: make -f Makefile.macos

aldostools avatar Jan 26 '21 14:01 aldostools

No, i was using it correctly, had no idea you could choose other makefiles with the -f flag thou.

heres the paste

Lions-Mac-mini:ps3netsrv lion$ make -f Makefile.macos c++ -Wall -Wno-format -I./include -std=c++0x -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -DPOLARSSL -Doff64_t=off_t -O3 -DNDEBUG -c -o src/main.o src/main.cpp src/main.cpp:2:10: fatal error: 'cstdint' file not found #include ^ 1 error generated. make: *** [src/main.o] Error 1 Lions-Mac-mini:ps3netsrv lion$

Lion4K avatar Jan 26 '21 14:01 Lion4K

Ok, in this case you will have to wait for help from another developer with experience in MacOS. This makefile haven't been changed in ages and no one have reported errors using it.

Maybe some missing files in your compiler?

aldostools avatar Jan 26 '21 14:01 aldostools

well thats a possibility, its xcode 4.6 i think, on a 2007 OS, so actual missing files are a possibility.

im gonna resume what i was doing by downloading the missing files one by one, i just hope i dont take a year doing that.

Lion4K avatar Jan 26 '21 14:01 Lion4K

erm, i resumed from the other folder the outdated one, and kept downloading the missing files and reached this point where no other files are missing but i got this huge error now.

what do you think?

Lions-Mac-mini:ps3netsrv lion$ make c++ -Wall -I./include -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -DPOLARSSL -Doff64_t=off_t -c -o src/VIsoFile.o src/VIsoFile.cpp In file included from src/VIsoFile.cpp:7: In file included from ./include/common.h:14: ./include/endian.h:46:10: warning: 'LITTLE_ENDIAN' macro redefined

define LITTLE_ENDIAN __LITTLE_ENDIAN

     ^

/usr/include/i386/endian.h:93:9: note: previous definition is here #define LITTLE_ENDIAN __DARWIN_LITTLE_ENDIAN ^ In file included from src/VIsoFile.cpp:7: In file included from ./include/common.h:14: ./include/endian.h:47:10: warning: 'BIG_ENDIAN' macro redefined

define BIG_ENDIAN __BIG_ENDIAN

     ^

/usr/include/i386/endian.h:94:9: note: previous definition is here #define BIG_ENDIAN __DARWIN_BIG_ENDIAN ^ In file included from src/VIsoFile.cpp:7: In file included from ./include/common.h:14: ./include/endian.h:48:10: warning: 'PDP_ENDIAN' macro redefined

define PDP_ENDIAN __PDP_ENDIAN

     ^

/usr/include/i386/endian.h:95:9: note: previous definition is here #define PDP_ENDIAN __DARWIN_PDP_ENDIAN ^ In file included from src/VIsoFile.cpp:7: In file included from ./include/common.h:14: ./include/endian.h:49:10: warning: 'BYTE_ORDER' macro redefined

define BYTE_ORDER __BYTE_ORDER

     ^

/usr/include/i386/endian.h:97:9: note: previous definition is here #define BYTE_ORDER __DARWIN_BYTE_ORDER ^ src/VIsoFile.cpp:421:22: error: use of undeclared identifier 'DT_DIR' if (entry->d_type & DT_DIR) ^ src/VIsoFile.cpp:438:22: error: use of undeclared identifier 'DT_DIR' if (entry->d_type & DT_DIR) ^ src/VIsoFile.cpp:1128:61: error: use of undeclared identifier 'alphasort' count = scandir(dirList->path, &dirs, select_directories, alphasort); ^ src/VIsoFile.cpp:1165:56: error: use of undeclared identifier 'alphasort' count = scandir(dirList->path, &files, select_files, alphasort); ^ 4 warnings and 4 errors generated. make: *** [src/VIsoFile.o] Error 1 Lions-Mac-mini:ps3netsrv lion$

Lion4K avatar Jan 26 '21 14:01 Lion4K

put that on a pastebin bc it got a lil weird to read from.

https://pastebin.com/wWp5YwXj

Lion4K avatar Jan 26 '21 15:01 Lion4K

idk I see some stuff talking about darwin which is the core of mac os, instead of Linux, maybe its because the stuff im using from linux ? idk im kinda lost.

Lion4K avatar Jan 26 '21 15:01 Lion4K

I also tried compiling on linux and running on mac and got this

Lions-Mac-mini:ps3netsrv lion$ ./ps3netsrv.x86 -bash: ./ps3netsrv.x86: cannot execute binary file

i didnt expected to work but expected some more info, but no :/

Lion4K avatar Jan 26 '21 15:01 Lion4K

@Lion4K I've also tired of mac os and cross-compilation problems and written a minimal server implementation in go (https://github.com/xakep666/ps3netsrv-go/releases/tag/v0.0.1) Maybe it helps you :)

xakep666 avatar Feb 06 '21 21:02 xakep666