Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
vvs committed Oct 16, 2009
0 parents commit 8dfb364
Show file tree
Hide file tree
Showing 23 changed files with 2,679 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .dep.inc
@@ -0,0 +1,5 @@
# This code depends on make tool being used
DEPFILES=$(wildcard $(addsuffix .d, ${OBJECTFILES}))
ifneq (${DEPFILES},)
include ${DEPFILES}
endif
5 changes: 5 additions & 0 deletions .gitignore
@@ -0,0 +1,5 @@
*.o
*.dll
*.exe
*~
build
97 changes: 97 additions & 0 deletions Makefile
@@ -0,0 +1,97 @@
#
# There exist several targets which are by default empty and which can be
# used for execution of your targets. These targets are usually executed
# before and after some main targets. They are:
#
# .build-pre: called before 'build' target
# .build-post: called after 'build' target
# .clean-pre: called before 'clean' target
# .clean-post: called after 'clean' target
# .clobber-pre: called before 'clobber' target
# .clobber-post: called after 'clobber' target
# .all-pre: called before 'all' target
# .all-post: called after 'all' target
# .help-pre: called before 'help' target
# .help-post: called after 'help' target
#
# Targets beginning with '.' are not intended to be called on their own.
#
# Main targets can be executed directly, and they are:
#
# build build a specific configuration
# clean remove built files from a configuration
# clobber remove all built files
# all build all configurations
# help print help mesage
#
# Targets .build-impl, .clean-impl, .clobber-impl, .all-impl, and
# .help-impl are implemented in nbproject/makefile-impl.mk.
#
# NOCDDL


# Environment
MKDIR=mkdir
CP=cp
CCADMIN=CCadmin
RANLIB=ranlib

# build
build: .build-post

.build-pre:
# Add your pre 'build' code here...

.build-post: .build-impl jruby.exe
# Add your post 'build' code here...
cp jruby.exe D:/work/jruby-dev/jruby/bin/
cp jruby.dll D:/work/jruby-dev/jruby/bin/

jruby.exe: jrubyexe.cpp nbexecloader.h utilsfuncs.cpp
g++ -s -mno-cygwin jrubyexe.cpp utilsfuncs.cpp -o jruby.exe

# clean
clean: .clean-post

.clean-pre:
# Add your pre 'clean' code here...
# -rm -r build/*

.clean-post: .clean-impl
# Add your post 'clean' code here...
rm -f jruby.exe


# clobber
clobber: .clobber-post

.clobber-pre:
# Add your pre 'clobber' code here...

.clobber-post: .clobber-impl
# Add your post 'clobber' code here...


# all
all: .all-post

.all-pre:
# Add your pre 'all' code here...

.all-post: .all-impl
# Add your post 'all' code here...


# help
help: .help-post

.help-pre:
# Add your pre 'help' code here...

.help-post: .help-impl
# Add your post 'help' code here...



# include project implementation makefile
include nbproject/Makefile-impl.mk
1 change: 1 addition & 0 deletions README.txt
@@ -0,0 +1 @@
JRuby native launcher for Windows.
6 changes: 6 additions & 0 deletions TODO.txt
@@ -0,0 +1,6 @@
Things that are not yet implemented:

* --sample
* --1.8 and --1.9
* --server and --client
* support %JAVA_HOME%?
26 changes: 26 additions & 0 deletions argnames.h
@@ -0,0 +1,26 @@
/*
* File: argnames.h
* Author: Holy
*
* Created on 4. prosinec 2008, 14:13
*/

#ifndef _ARGNAMES_H
#define _ARGNAMES_H

#define ARG_NAME_SEPAR_PROC "--fork-java"
#define ARG_NAME_CONSOLE "--console"
#define ARG_NAME_LAUNCHER_LOG "--trace"
#define ARG_NAME_LA_START_APP "--la_start_app"
#define ARG_NAME_LA_START_AU "--la_start_au"
#define ARG_NAME_LA_PPID "--la_ppid"
#define ARG_NAME_USER_DIR "--userdir"
#define ARG_NAME_CLUSTERS "--clusters"
#define ARG_NAME_BOOTCLASS "--bootclass"
#define ARG_NAME_JDKHOME "--jdkhome"
#define ARG_NAME_CP_PREPEND "--cp:p"
#define ARG_NAME_CP_APPEND "--cp:a"


#endif /* _ARGNAMES_H */

77 changes: 77 additions & 0 deletions jruby.cpp
@@ -0,0 +1,77 @@
/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
*
* Copyright 1997-2008 Sun Microsystems, Inc. All rights reserved.
*
* The contents of this file are subject to the terms of either the GNU
* General Public License Version 2 only ("GPL") or the Common
* Development and Distribution License("CDDL") (collectively, the
* "License"). You may not use this file except in compliance with the
* License. You can obtain a copy of the License at
* http://www.netbeans.org/cddl-gplv2.html
* or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
* specific language governing permissions and limitations under the
* License. When distributing the software, include this License Header
* Notice in each file and include the License file at
* nbbuild/licenses/CDDL-GPL-2-CP. Sun designates this
* particular file as subject to the "Classpath" exception as provided
* by Sun in the GPL Version 2 section of the License file that
* accompanied this code. If applicable, add the following below the
* License Header, with the fields enclosed by brackets [] replaced by
* your own identifying information:
* "Portions Copyrighted [year] [name of copyright owner]"
*
* Contributor(s):
*
* The Original Software is NetBeans. The Initial Developer of the Original
* Software is Sun Microsystems, Inc. Portions Copyright 1997-2008 Sun
* Microsystems, Inc. All Rights Reserved.
*
* If you wish your version of this file to be governed by only the CDDL
* or only the GPL Version 2, indicate your decision by adding
* "[Contributor] elects to include this software in this distribution
* under the [CDDL or GPL Version 2] license." If you do not indicate a
* single choice of license, a recipient has the option to distribute
* your version of this file under either the CDDL, the GPL Version 2 or
* to extend the choice of license to its licensees as provided above.
* However, if you add GPL Version 2 code and therefore, elected the GPL
* Version 2 license, then the option applies only if the new code is
* made subject to such option by the copyright holder.
*
* Author: Tomas Holy
*/

#include "platformlauncher.h"
#include "utilsfuncs.h"

PlatformLauncher launcher;

extern "C" BOOL APIENTRY DllMain(HANDLE hModule,
DWORD ul_reason_for_call,
LPVOID lpReserved
) {
switch (ul_reason_for_call) {
case DLL_PROCESS_ATTACH:
break;
case DLL_THREAD_ATTACH:
break;
case DLL_THREAD_DETACH:
break;
case DLL_PROCESS_DETACH:
launcher.onExit();
break;
}
return TRUE;
}

#define NBEXEC_EXPORT extern "C" __declspec(dllexport)

NBEXEC_EXPORT int startPlatform(int argc, char *argv[], const char *helpMsg) {
DWORD retCode = 0;
launcher.appendToHelp(helpMsg);
launcher.setSuppressConsole(!isConsoleAttached());
if (!launcher.start(argv, argc, &retCode)) {
return -1;
}
return retCode;
}
51 changes: 51 additions & 0 deletions jrubyexe.cpp
@@ -0,0 +1,51 @@
/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
*
* Copyright 1997-2008 Sun Microsystems, Inc. All rights reserved.
*
* The contents of this file are subject to the terms of either the GNU
* General Public License Version 2 only ("GPL") or the Common
* Development and Distribution License("CDDL") (collectively, the
* "License"). You may not use this file except in compliance with the
* License. You can obtain a copy of the License at
* http://www.netbeans.org/cddl-gplv2.html
* or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
* specific language governing permissions and limitations under the
* License. When distributing the software, include this License Header
* Notice in each file and include the License file at
* nbbuild/licenses/CDDL-GPL-2-CP. Sun designates this
* particular file as subject to the "Classpath" exception as provided
* by Sun in the GPL Version 2 section of the License file that
* accompanied this code. If applicable, add the following below the
* License Header, with the fields enclosed by brackets [] replaced by
* your own identifying information:
* "Portions Copyrighted [year] [name of copyright owner]"
*
* Contributor(s):
*
* The Original Software is NetBeans. The Initial Developer of the Original
* Software is Sun Microsystems, Inc. Portions Copyright 1997-2008 Sun
* Microsystems, Inc. All Rights Reserved.
*
* If you wish your version of this file to be governed by only the CDDL
* or only the GPL Version 2, indicate your decision by adding
* "[Contributor] elects to include this software in this distribution
* under the [CDDL or GPL Version 2] license." If you do not indicate a
* single choice of license, a recipient has the option to distribute
* your version of this file under either the CDDL, the GPL Version 2 or
* to extend the choice of license to its licensees as provided above.
* However, if you add GPL Version 2 code and therefore, elected the GPL
* Version 2 license, then the option applies only if the new code is
* made subject to such option by the copyright holder.
*
* Author: Tomas Holy
*/

#include <windows.h>
#include "nbexecloader.h"

int main(int argc, char *argv[]) {
checkLoggingArg(argc, argv, true);
NBExecLoader loader;
return loader.start("jruby.dll", argc - 1, argv + 1);
}

0 comments on commit 8dfb364

Please sign in to comment.