#!/bin/bash
BUILDDIR=../build/linux-x86_64-minimal-release
VER='"23-internal-adhoc.johan.jdk"'
INCLIST="-I../src/java.base/share/native/launcher -I../src/java.base/share/native/libjli \
-I../src/java.base/unix/native/libjli \
-I../src/java.base/share/native/include \
-I../src/java.base/unix/native/include \
-I../src/hotspot/share/include \
-I../src/hotspot/os/posix/include \
-I$BUILDDIR/support/modules_include/java.base"

gcc -DVERSION_STRING=$VER \
-g -c $INCLIST src/main.c 
g++ -g -o bin/blop \
-DVERSION_STRING='"23-internal-adhoc.johan.jdk"' \
-I../src/java.base/share/native/launcher \
-I../src/java.base/share/native/libjli \
-I../src/java.base/unix/native/libjli \
-I../src/java.base/share/native/include \
-I../src/java.base/unix/native/include \
-I../src/hotspot/share/include \
-I../src/hotspot/os/posix/include \
-I$BUILDDIR/support/modules_include/java.base \
-L$BUILDDIR/images/static-libs/lib \
-L$BUILDDIR/images/static-libs/lib/minimal \
main.o \
-Wl,--export-dynamic \
-Wl,-u,JNI_CreateJavaVM \
-Wl,-u,Java_java_lang_ClassLoader_registerNatives \
-Wl,-u,Java_java_lang_System_registerNatives \
-Wl,-u,Java_java_lang_Class_registerNatives \
-Wl,-u,Java_java_lang_Class_desiredAssertionStatus0 \
-Wl,-u,Java_jdk_internal_misc_VM_initialize \
-Wl,-u,Java_java_lang_Throwable_fillInStackTrace \
-Wl,-u,Java_java_lang_StackTraceElement_initStackTraceElements \
-Wl,-u,Java_java_lang_Thread_registerNatives \
-Wl,-u,Java_java_lang_Float_floatToRawIntBits \
-Wl,-u,Java_java_security_AccessController_getStackAccessControlContext \
-Wl,-u,Java_java_lang_Double_doubleToRawLongBits \
-Wl,-u,Java_jdk_internal_misc_CDS_getCDSConfigStatus \
-Wl,-u,Java_jdk_internal_reflect_Reflection_getCallerClass \
-Wl,-u,Java_java_lang_ref_Finalizer_isFinalizationEnabled \
-Wl,-u,Java_java_lang_Object_getClass \
-Wl,-u,Java_java_lang_Runtime_maxMemory \
-Wl,-u,Java_jdk_internal_loader_BootLoader_setBootLoaderUnnamedModule0 \
-Wl,-u,Java_java_io_FileInputStream_initIDs \
-Wl,-u,Java_java_io_FileOutputStream_initIDs \
-Wl,-u,Java_jdk_internal_misc_Signal_findSignal0 \
-Wl,-u,Java_java_lang_ref_Reference_waitForReferencePendingList \
-Wl,-u,Java_java_lang_String_intern \
-Wl,-u,Java_java_io_UnixFileSystem_initIDs \
-Wl,-u,Java_jdk_internal_loader_NativeLibraries_findBuiltinLib \
-Wl,-u,Java_sun_nio_fs_UnixNativeDispatcher_init \
-Wl,-u,Java_java_lang_reflect_Array_newArray \
-Wl,-u,Java_sun_nio_ch_IOUtil_initIDs \
-Wl,-u,Java_sun_nio_ch_FileDispatcherImpl_init0 \
-Wl,-u,Java_sun_nio_ch_NativeThread_init \
-Wl,-u,Java_sun_nio_ch_UnixFileDispatcherImpl_read0 \
-Wl,-u,Java_java_lang_Module_defineModule0 \
-Wl,-u,Java_jdk_internal_vm_ContinuationSupport_isSupported0 \
-Wl,-u,Java_jdk_internal_vm_Continuation_registerNatives \
-Wl,-u,Java_java_lang_Shutdown_beforeHalt \
-Wl,-u,Java_jdk_internal_misc_PreviewFeatures_isPreviewEnabled \
-ljli \
-Wl,-u,JLI_List_new \
-Wl,-u,JIMAGE_Open \
-ljava \
-lnio \
-ljvm \
-ljimage \
-lz
