diff --git a/makefile b/makefile index 3f20d58980..946a3344cd 100644 --- a/makefile +++ b/makefile @@ -62,7 +62,14 @@ build-cflags = $(common-cflags) -fPIC -fvisibility=hidden \ cflags = $(build-cflags) -common-lflags = -lm -lz -lstdc++ +use-libstdcpp = true + +common-lflags = -lm -lz + +ifeq ($(use-libstdcpp),true) + common-lflags += -lstdc++ + common-cflags += -DUSE_LIBSTDCPP +endif build-lflags = diff --git a/src/boot.cpp b/src/boot.cpp index e3f91f6c0d..f6f0c95ba6 100644 --- a/src/boot.cpp +++ b/src/boot.cpp @@ -11,10 +11,12 @@ #include "stdint.h" #include "stdlib.h" -// since we don't link against libstdc++, we must implement some dummy -// functions: +#ifndef USE_LIBSTDCPP +// since we aren't linking against libstdc++, we must implement some +// dummy functions: extern "C" void __cxa_pure_virtual(void) { abort(); } void operator delete(void*) { abort(); } +#endif #ifdef __MINGW32__ # define EXPORT __declspec(dllexport)