···212212 ${CMAKE_CURRENT_SOURCE_DIR}/AVFoundation/include
213213 ${CMAKE_CURRENT_SOURCE_DIR}/CoreAudio/include
214214 ${CMAKE_CURRENT_SOURCE_DIR}/CoreMedia/include
215215+ ${CMAKE_CURRENT_SOURCE_DIR}/JavaVM/include
215216)
216217217218add_subdirectory(external/libkqueue)
···394395# Just a stub
395396add_subdirectory(WebKit)
396397add_subdirectory(OpenGL)
398398+add_subdirectory(JavaVM)
397399398400# /Applications
399401#add_subdirectory(external/TextEdit)
+20
src/JavaVM/CMakeLists.txt
···11+project(JavaVM)
22+33+set(DYLIB_COMPAT_VERSION "1.0.0")
44+set(DYLIB_CURRENT_VERSION "1.0.0")
55+66+add_framework(JavaVM
77+ FAT
88+ CURRENT_VERSION
99+ VERSION "A"
1010+1111+ SOURCES
1212+ src/JavaVM.m
1313+ src/NSJavaVirtualMachine.m
1414+ src/NSJavaConfiguration.m
1515+1616+ DEPENDENCIES
1717+ system
1818+ objc
1919+ Foundation
2020+)
+59
src/JavaVM/include/JavaVM/JavaVM.h
···11+/*
22+ This file is part of Darling.
33+44+ Copyright (C) 2017 Lubos Dolezel
55+66+ Darling is free software: you can redistribute it and/or modify
77+ it under the terms of the GNU General Public License as published by
88+ the Free Software Foundation, either version 3 of the License, or
99+ (at your option) any later version.
1010+1111+ Darling is distributed in the hope that it will be useful,
1212+ but WITHOUT ANY WARRANTY; without even the implied warranty of
1313+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1414+ GNU General Public License for more details.
1515+1616+ You should have received a copy of the GNU General Public License
1717+ along with Darling. If not, see <http://www.gnu.org/licenses/>.
1818+*/
1919+2020+2121+#ifndef _JavaVM_H_
2222+#define _JavaVM_H_
2323+2424+#import <Foundation/Foundation.h>
2525+2626+#import <JavaVM/NSJavaVirtualMachine.h>
2727+#import <JavaVM/NSJavaConfiguration.h>
2828+2929+void* CheckForInstalledJavaRuntimes(void);
3030+void* JAWT_GetAWT(void);
3131+void* JNI_CreateJavaVM(void);
3232+void* JNI_GetCreatedJavaVMs(void);
3333+void* JNI_GetDefaultJavaVMInitArgs(void);
3434+void* JVMCopyDefaultPrefForTaskAndKey(void);
3535+void* JVMCopyUserPrefForTaskAndKey(void);
3636+void* JVMCreateCompleteJVMListForTask(void);
3737+void* JVMCreateJVMListForTask(void);
3838+void* JVMCreateJVMListForTaskVersionAndArch(void);
3939+void* JVMCreateJVMListForTaskVersionAndArchs(void);
4040+void* JVMCreateJVMListOfCurrentArchitectureForTask(void);
4141+void* JVMCreateLatestJVMInfo(void);
4242+void* JVMSaveUserPrefForTaskAndKey(void);
4343+void* JVMSetPreferredOrderForTask(void);
4444+void* _NSJVMAddressOfFunctionInLibrary(void);
4545+void* _NSJVMAddressOfFunctionInLibraryNamed(void);
4646+void* _NSJVMInitializeObjCRuntimeInLibraryNamed(void);
4747+void* _NSJVMJNI_CreateJavaVM(void);
4848+void* _NSJVMJNI_GetCreatedJavaVMs(void);
4949+void* _NSJVMJNI_GetDefaultJavaVMInitArgs(void);
5050+void* _NSJVMJavaVMLibraryName(void);
5151+void* _NSJVMLoadLibrary(void);
5252+void* _NSJVM_IHashCodeFunction(void);
5353+void* _NSJVM_IsJVMLoaded(void);
5454+void* _NSLoadJavaVirtualMachine(void);
5555+void* scheduleUpdateSharing(void);
5656+void* scheduleUpdateSharingUninstalled(void);
5757+void* updateSharing(void);
5858+5959+#endif
+24
src/JavaVM/include/JavaVM/NSJavaConfiguration.h
···11+/*
22+ This file is part of Darling.
33+44+ Copyright (C) 2017 Lubos Dolezel
55+66+ Darling is free software: you can redistribute it and/or modify
77+ it under the terms of the GNU General Public License as published by
88+ the Free Software Foundation, either version 3 of the License, or
99+ (at your option) any later version.
1010+1111+ Darling is distributed in the hope that it will be useful,
1212+ but WITHOUT ANY WARRANTY; without even the implied warranty of
1313+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1414+ GNU General Public License for more details.
1515+1616+ You should have received a copy of the GNU General Public License
1717+ along with Darling. If not, see <http://www.gnu.org/licenses/>.
1818+*/
1919+2020+#include <Foundation/Foundation.h>
2121+2222+@interface NSJavaConfiguration : NSObject
2323+2424+@end
+24
src/JavaVM/include/JavaVM/NSJavaVirtualMachine.h
···11+/*
22+ This file is part of Darling.
33+44+ Copyright (C) 2017 Lubos Dolezel
55+66+ Darling is free software: you can redistribute it and/or modify
77+ it under the terms of the GNU General Public License as published by
88+ the Free Software Foundation, either version 3 of the License, or
99+ (at your option) any later version.
1010+1111+ Darling is distributed in the hope that it will be useful,
1212+ but WITHOUT ANY WARRANTY; without even the implied warranty of
1313+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1414+ GNU General Public License for more details.
1515+1616+ You should have received a copy of the GNU General Public License
1717+ along with Darling. If not, see <http://www.gnu.org/licenses/>.
1818+*/
1919+2020+#include <Foundation/Foundation.h>
2121+2222+@interface NSJavaVirtualMachine : NSObject
2323+2424+@end
+175
src/JavaVM/src/JavaVM.m
···11+/*
22+ This file is part of Darling.
33+44+ Copyright (C) 2017 Lubos Dolezel
55+66+ Darling is free software: you can redistribute it and/or modify
77+ it under the terms of the GNU General Public License as published by
88+ the Free Software Foundation, either version 3 of the License, or
99+ (at your option) any later version.
1010+1111+ Darling is distributed in the hope that it will be useful,
1212+ but WITHOUT ANY WARRANTY; without even the implied warranty of
1313+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1414+ GNU General Public License for more details.
1515+1616+ You should have received a copy of the GNU General Public License
1717+ along with Darling. If not, see <http://www.gnu.org/licenses/>.
1818+*/
1919+2020+2121+#include <JavaVM/JavaVM.h>
2222+#include <stdlib.h>
2323+#include <stdio.h>
2424+2525+static int verbose = 0;
2626+2727+__attribute__((constructor))
2828+static void initme(void) {
2929+ verbose = getenv("STUB_VERBOSE") != NULL;
3030+}
3131+3232+void* CheckForInstalledJavaRuntimes(void) {
3333+ if (verbose) puts("STUB: CheckForInstalledJavaRuntimes called");
3434+ return NULL;
3535+}
3636+3737+void* JAWT_GetAWT(void) {
3838+ if (verbose) puts("STUB: JAWT_GetAWT called");
3939+ return NULL;
4040+}
4141+4242+void* JNI_CreateJavaVM(void) {
4343+ if (verbose) puts("STUB: JNI_CreateJavaVM called");
4444+ return NULL;
4545+}
4646+4747+void* JNI_GetCreatedJavaVMs(void) {
4848+ if (verbose) puts("STUB: JNI_GetCreatedJavaVMs called");
4949+ return NULL;
5050+}
5151+5252+void* JNI_GetDefaultJavaVMInitArgs(void) {
5353+ if (verbose) puts("STUB: JNI_GetDefaultJavaVMInitArgs called");
5454+ return NULL;
5555+}
5656+5757+void* JVMCopyDefaultPrefForTaskAndKey(void) {
5858+ if (verbose) puts("STUB: JVMCopyDefaultPrefForTaskAndKey called");
5959+ return NULL;
6060+}
6161+6262+void* JVMCopyUserPrefForTaskAndKey(void) {
6363+ if (verbose) puts("STUB: JVMCopyUserPrefForTaskAndKey called");
6464+ return NULL;
6565+}
6666+6767+void* JVMCreateCompleteJVMListForTask(void) {
6868+ if (verbose) puts("STUB: JVMCreateCompleteJVMListForTask called");
6969+ return NULL;
7070+}
7171+7272+void* JVMCreateJVMListForTask(void) {
7373+ if (verbose) puts("STUB: JVMCreateJVMListForTask called");
7474+ return NULL;
7575+}
7676+7777+void* JVMCreateJVMListForTaskVersionAndArch(void) {
7878+ if (verbose) puts("STUB: JVMCreateJVMListForTaskVersionAndArch called");
7979+ return NULL;
8080+}
8181+8282+void* JVMCreateJVMListForTaskVersionAndArchs(void) {
8383+ if (verbose) puts("STUB: JVMCreateJVMListForTaskVersionAndArchs called");
8484+ return NULL;
8585+}
8686+8787+void* JVMCreateJVMListOfCurrentArchitectureForTask(void) {
8888+ if (verbose) puts("STUB: JVMCreateJVMListOfCurrentArchitectureForTask called");
8989+ return NULL;
9090+}
9191+9292+void* JVMCreateLatestJVMInfo(void) {
9393+ if (verbose) puts("STUB: JVMCreateLatestJVMInfo called");
9494+ return NULL;
9595+}
9696+9797+void* JVMSaveUserPrefForTaskAndKey(void) {
9898+ if (verbose) puts("STUB: JVMSaveUserPrefForTaskAndKey called");
9999+ return NULL;
100100+}
101101+102102+void* JVMSetPreferredOrderForTask(void) {
103103+ if (verbose) puts("STUB: JVMSetPreferredOrderForTask called");
104104+ return NULL;
105105+}
106106+107107+void* _NSJVMAddressOfFunctionInLibrary(void) {
108108+ if (verbose) puts("STUB: _NSJVMAddressOfFunctionInLibrary called");
109109+ return NULL;
110110+}
111111+112112+void* _NSJVMAddressOfFunctionInLibraryNamed(void) {
113113+ if (verbose) puts("STUB: _NSJVMAddressOfFunctionInLibraryNamed called");
114114+ return NULL;
115115+}
116116+117117+void* _NSJVMInitializeObjCRuntimeInLibraryNamed(void) {
118118+ if (verbose) puts("STUB: _NSJVMInitializeObjCRuntimeInLibraryNamed called");
119119+ return NULL;
120120+}
121121+122122+void* _NSJVMJNI_CreateJavaVM(void) {
123123+ if (verbose) puts("STUB: _NSJVMJNI_CreateJavaVM called");
124124+ return NULL;
125125+}
126126+127127+void* _NSJVMJNI_GetCreatedJavaVMs(void) {
128128+ if (verbose) puts("STUB: _NSJVMJNI_GetCreatedJavaVMs called");
129129+ return NULL;
130130+}
131131+132132+void* _NSJVMJNI_GetDefaultJavaVMInitArgs(void) {
133133+ if (verbose) puts("STUB: _NSJVMJNI_GetDefaultJavaVMInitArgs called");
134134+ return NULL;
135135+}
136136+137137+void* _NSJVMJavaVMLibraryName(void) {
138138+ if (verbose) puts("STUB: _NSJVMJavaVMLibraryName called");
139139+ return NULL;
140140+}
141141+142142+void* _NSJVMLoadLibrary(void) {
143143+ if (verbose) puts("STUB: _NSJVMLoadLibrary called");
144144+ return NULL;
145145+}
146146+147147+void* _NSJVM_IHashCodeFunction(void) {
148148+ if (verbose) puts("STUB: _NSJVM_IHashCodeFunction called");
149149+ return NULL;
150150+}
151151+152152+void* _NSJVM_IsJVMLoaded(void) {
153153+ if (verbose) puts("STUB: _NSJVM_IsJVMLoaded called");
154154+ return NULL;
155155+}
156156+157157+void* _NSLoadJavaVirtualMachine(void) {
158158+ if (verbose) puts("STUB: _NSLoadJavaVirtualMachine called");
159159+ return NULL;
160160+}
161161+162162+void* scheduleUpdateSharing(void) {
163163+ if (verbose) puts("STUB: scheduleUpdateSharing called");
164164+ return NULL;
165165+}
166166+167167+void* scheduleUpdateSharingUninstalled(void) {
168168+ if (verbose) puts("STUB: scheduleUpdateSharingUninstalled called");
169169+ return NULL;
170170+}
171171+172172+void* updateSharing(void) {
173173+ if (verbose) puts("STUB: updateSharing called");
174174+ return NULL;
175175+}
+32
src/JavaVM/src/NSJavaConfiguration.m
···11+/*
22+ This file is part of Darling.
33+44+ Copyright (C) 2017 Lubos Dolezel
55+66+ Darling is free software: you can redistribute it and/or modify
77+ it under the terms of the GNU General Public License as published by
88+ the Free Software Foundation, either version 3 of the License, or
99+ (at your option) any later version.
1010+1111+ Darling is distributed in the hope that it will be useful,
1212+ but WITHOUT ANY WARRANTY; without even the implied warranty of
1313+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1414+ GNU General Public License for more details.
1515+1616+ You should have received a copy of the GNU General Public License
1717+ along with Darling. If not, see <http://www.gnu.org/licenses/>.
1818+*/
1919+2020+#import <JavaVM/NSJavaConfiguration.h>
2121+2222+@implementation NSJavaConfiguration
2323+2424+- (NSMethodSignature *)methodSignatureForSelector:(SEL)aSelector {
2525+ return [NSMethodSignature signatureWithObjCTypes: "v@:"];
2626+}
2727+2828+- (void)forwardInvocation:(NSInvocation *)anInvocation {
2929+ NSLog(@"Stub called: %@ in %@", NSStringFromSelector([anInvocation selector]), [self class]);
3030+}
3131+3232+@end
+32
src/JavaVM/src/NSJavaVirtualMachine.m
···11+/*
22+ This file is part of Darling.
33+44+ Copyright (C) 2017 Lubos Dolezel
55+66+ Darling is free software: you can redistribute it and/or modify
77+ it under the terms of the GNU General Public License as published by
88+ the Free Software Foundation, either version 3 of the License, or
99+ (at your option) any later version.
1010+1111+ Darling is distributed in the hope that it will be useful,
1212+ but WITHOUT ANY WARRANTY; without even the implied warranty of
1313+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1414+ GNU General Public License for more details.
1515+1616+ You should have received a copy of the GNU General Public License
1717+ along with Darling. If not, see <http://www.gnu.org/licenses/>.
1818+*/
1919+2020+#import <JavaVM/NSJavaVirtualMachine.h>
2121+2222+@implementation NSJavaVirtualMachine
2323+2424+- (NSMethodSignature *)methodSignatureForSelector:(SEL)aSelector {
2525+ return [NSMethodSignature signatureWithObjCTypes: "v@:"];
2626+}
2727+2828+- (void)forwardInvocation:(NSInvocation *)anInvocation {
2929+ NSLog(@"Stub called: %@ in %@", NSStringFromSelector([anInvocation selector]), [self class]);
3030+}
3131+3232+@end