For ages I've been trying to replaced my build system on a Debian VM for a native MacOS setup without success.
The Debian VM setup works perfectly, with dozens of successful builds but is very inconvenient an uncomfortable.
I use MacPorts and so, to satisfy requirements I've installed:
$ sudo port install coreutils asciidoc bzip2 fastjar flex getopt gtk2 intltool jikes zlib openssl p5-extutils-makemaker rsync ruby sdcc unzip gettext libxslt bison gawk autoconf wget gmake ncurses e2fsprogs ossp-uuid gawk findutils gnutar
And install a CaseSensitive disk image.
After git cloning and cd to the tree, I do:
$ ./scripts/feeds update -a
And I get:
...
Checking 'gcc'... ok.
Checking 'working-gcc'... ok.
Checking 'g++'... ok.
Checking 'working-g++'... failed.
...
Everything else is ok.
Looking into include/prereq-build.mk, I mimic:
$ echo 'int main(int argc, char **argv) { return 0; }' | g++ -x c++ -v -o ./a.out -
and I get:
...
ld: library not found for -lSystem
collect2: error: ld returned 1 exit status
But I get the same with:
$ echo 'int main(int argc, char **argv) { return 0; }' | gcc -x c -v -o ./a.out -
which checks working-gcc ok.
EDIT (lack of -lstdc++):
$ echo 'int main(int argc, char **argv) { return 0; }' | gcc -x c -v -o ./a.out - -lstdc++
Achieves the same result; and so does:
$ echo 'int main(int argc, char **argv) { return 0; }' | gcc -x c -v -o ./a.out -lstdc++ -
My g++ is
$ g++ --verbose
Using built-in specs.
COLLECT_GCC=g++
COLLECT_LTO_WRAPPER=/opt/local/libexec/gcc/x86_64-apple-darwin19/9.4.0/lto-wrapper
Target: x86_64-apple-darwin19
Configured with: /opt/local/var/macports/build/_opt_bblocal_var_buildworker_ports_build_ports_lang_gcc9/gcc9/work/gcc-9.4.0/configure --prefix=/opt/local --build=x86_64-apple-darwin19 --enable-languages=c,c++,objc,obj-c++,lto,fortran,jit --libdir=/opt/local/lib/gcc9 --includedir=/opt/local/include/gcc9 --infodir=/opt/local/share/info --mandir=/opt/local/share/man --datarootdir=/opt/local/share/gcc-9 --with-local-prefix=/opt/local --with-system-zlib --disable-nls --program-suffix=-mp-9 --with-gxx-include-dir=/opt/local/include/gcc9/c++/ --with-gmp=/opt/local --with-mpfr=/opt/local --with-mpc=/opt/local --with-isl=/opt/local --enable-stage1-checking --disable-multilib --enable-lto --enable-libstdcxx-time --with-build-config=bootstrap-debug --with-as=/opt/local/bin/as --with-ld=/opt/local/bin/ld --with-ar=/opt/local/bin/ar --with-bugurl=https://trac.macports.org/newticket --enable-host-shared --disable-tls --with-pkgversion='MacPorts gcc9 9.4.0_0' --with-sysroot=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk
Thread model: posix
gcc version 9.4.0 (MacPorts gcc9 9.4.0_0)
Can somebody please help?
Thank you