jruby-launcher 1.1.1-java → 1.1.2-java

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,78 +1,78 @@
1
- /*
2
- * Copyright 2009-2012 JRuby Team (www.jruby.org).
3
- */
4
-
5
-
6
- #ifndef _ARGPARSER_H_
7
- #define _ARGPARSER_H_
8
-
9
- #include <string>
10
- #include <list>
11
- #include <set>
12
-
13
- class ArgParser {
14
- protected:
15
- static const char *REQ_JAVA_VERSION;
16
- static const char *HELP_MSG;
17
-
18
- static const char *OPT_JDK_HOME;
19
- static const char *OPT_JRUBY_HOME;
20
- static const char *OPT_JRUBY_COMMAND_NAME;
21
-
22
- static const char *OPT_CMDLINE_CLASS_PATH;
23
- static const char *OPT_CLASS_PATH;
24
- static const char *OPT_BOOT_CLASS_PATH;
25
-
26
- static const char *OPT_JFFI_PATH;
27
- static const char *OPT_JRUBY_SHELL;
28
- static const char *OPT_JRUBY_SCRIPT;
29
-
30
- static const char *MAIN_CLASS;
31
- static const char *DEFAULT_EXECUTABLE;
32
-
33
- public:
34
- ArgParser();
35
- virtual ~ArgParser();
36
- bool parseArgs(int argc, char *argv[]);
37
- void appendToHelp(const char *msg);
38
- std::string* buildCommandLine(int argc, char* argv[]);
39
-
40
- protected:
41
- ArgParser(const ArgParser& orig);
42
-
43
- bool initPlatformDir();
44
- void prepareOptions();
45
- void setupMaxHeapAndStack(std::list<std::string> userOptions);
46
- void addEnvVarToOptions(std::list<std::string> & optionsList, const char * envvar);
47
- void constructClassPath();
48
- void constructBootClassPath();
49
- void addFilesToClassPath(const char *dir, const char *subdir, const char *pattern);
50
- void addToClassPath(const char *path, bool onlyIfExists = false);
51
- void addToBootClassPath(const char *path, bool onlyIfExists = false);
52
- void addJarsToClassPathFrom(const char *dir);
53
- void addOptionsToCommandLine(std::list<std::string> & commandLine);
54
- bool endsWith(const std::string &string, const std::string &end);
55
-
56
- protected:
57
- bool separateProcess;
58
- bool nailgunClient;
59
- bool noBootClassPath;
60
- bool printCommandLine;
61
- std::string platformDir;
62
- std::string bootclass;
63
- std::string jdkhome;
64
- std::string cpBefore;
65
- std::string cpExplicit;
66
- std::string cpAfter;
67
- std::string nextAction;
68
-
69
- std::list<std::string> javaOptions;
70
- std::set<std::string> addedToCP;
71
- std::string classPath;
72
- std::string bootClassPath;
73
- std::set<std::string> addedToBootCP;
74
- std::string appendHelp;
75
- std::list<std::string> progArgs;
76
- };
77
-
78
- #endif // ! _ARGPARSER_H_
1
+ /*
2
+ * Copyright 2009-2012 JRuby Team (www.jruby.org).
3
+ */
4
+
5
+
6
+ #ifndef _ARGPARSER_H_
7
+ #define _ARGPARSER_H_
8
+
9
+ #include <string>
10
+ #include <list>
11
+ #include <set>
12
+
13
+ class ArgParser {
14
+ protected:
15
+ static const char *REQ_JAVA_VERSION;
16
+ static const char *HELP_MSG;
17
+
18
+ static const char *OPT_JDK_HOME;
19
+ static const char *OPT_JRUBY_HOME;
20
+ static const char *OPT_JRUBY_COMMAND_NAME;
21
+
22
+ static const char *OPT_CMDLINE_CLASS_PATH;
23
+ static const char *OPT_CLASS_PATH;
24
+ static const char *OPT_BOOT_CLASS_PATH;
25
+
26
+ static const char *OPT_JFFI_PATH;
27
+ static const char *OPT_JRUBY_SHELL;
28
+ static const char *OPT_JRUBY_SCRIPT;
29
+
30
+ static const char *MAIN_CLASS;
31
+ static const char *DEFAULT_EXECUTABLE;
32
+
33
+ public:
34
+ ArgParser();
35
+ virtual ~ArgParser();
36
+ bool parseArgs(int argc, char *argv[]);
37
+ void appendToHelp(const char *msg);
38
+ std::string* buildCommandLine(int argc, char* argv[]);
39
+
40
+ protected:
41
+ ArgParser(const ArgParser& orig);
42
+
43
+ bool initPlatformDir();
44
+ void prepareOptions();
45
+ void setupMaxHeapAndStack(std::list<std::string> userOptions);
46
+ void addEnvVarToOptions(std::list<std::string> & optionsList, const char * envvar);
47
+ void constructClassPath();
48
+ void constructBootClassPath();
49
+ void addFilesToClassPath(const char *dir, const char *subdir, const char *pattern);
50
+ void addToClassPath(const char *path, bool onlyIfExists = false);
51
+ void addToBootClassPath(const char *path, bool onlyIfExists = false);
52
+ void addJarsToClassPathFrom(const char *dir);
53
+ void addOptionsToCommandLine(std::list<std::string> & commandLine);
54
+ bool endsWith(const std::string &string, const std::string &end);
55
+
56
+ protected:
57
+ bool separateProcess;
58
+ bool nailgunClient;
59
+ bool noBootClassPath;
60
+ bool printCommandLine;
61
+ std::string platformDir;
62
+ std::string bootclass;
63
+ std::string jdkhome;
64
+ std::string cpBefore;
65
+ std::string cpExplicit;
66
+ std::string cpAfter;
67
+ std::string nextAction;
68
+
69
+ std::list<std::string> javaOptions;
70
+ std::set<std::string> addedToCP;
71
+ std::string classPath;
72
+ std::string bootClassPath;
73
+ std::set<std::string> addedToBootCP;
74
+ std::string appendHelp;
75
+ std::list<std::string> progArgs;
76
+ };
77
+
78
+ #endif // ! _ARGPARSER_H_
data/extconf.rb CHANGED
@@ -1,7 +1,7 @@
1
- require 'rbconfig'
2
-
3
- mf = File.read('Makefile')
4
- mf = mf.gsub(/^BINDIR\s*=.*$/, "BINDIR = #{Config::CONFIG['bindir']}")
5
- mf = mf.gsub(/^PREFIX\s*=.*$/, "PREFIX = #{File.dirname(Config::CONFIG['libdir'])}")
6
- puts mf
7
- File.open('Makefile', 'wb') {|f| f << mf}
1
+ require 'rbconfig'
2
+
3
+ mf = File.read('Makefile')
4
+ mf = mf.gsub(/^BINDIR\s*=.*$/, "BINDIR = #{Config::CONFIG['bindir']}")
5
+ mf = mf.gsub(/^PREFIX\s*=.*$/, "PREFIX = #{File.dirname(Config::CONFIG['libdir'])}")
6
+ puts mf
7
+ File.open('Makefile', 'wb') {|f| f << mf}
@@ -1,76 +1,76 @@
1
- # Environment
2
- MKDIR=mkdir
3
- CP=cp
4
- CCADMIN=CCadmin
5
- RANLIB=ranlib
6
- CC=gcc
7
- CCC=g++
8
- CXX=g++
9
-
10
- # Windows (mingw)?
11
- ifneq (,$(findstring mingw, $(CONF)))
12
- MINGW := true
13
- endif
14
-
15
- # Macros
16
- ifndef CND_PLATFORM
17
- CND_PLATFORM=$(shell uname -s)
18
- endif
19
-
20
- # Include project Makefile
21
- include Makefile
22
-
23
- # Object Directory
24
- OBJECTDIR=build/${CONF}/${CND_PLATFORM}
25
-
26
- # Object Files
27
- OBJECTFILES = ${OBJECTDIR}/argparser.o \
28
- ${OBJECTDIR}/utilsfuncs.o \
29
- ${OBJECTDIR}/ng.o \
30
- ${OBJECTDIR}/strlcpy.o \
31
- ${OBJECTDIR}/jrubyexe.o
32
-
33
- ifdef JAVA_HOME
34
- JAVA_INCLUDE = $(subst \,/,${JAVA_HOME})/include
35
- INCLUDES = "-I${JAVA_INCLUDE}"
36
- endif
37
-
38
- ifdef MINGW
39
- OBJECTFILES += ${OBJECTDIR}/utilsfuncswin.o \
40
- ${OBJECTDIR}/platformlauncher.o \
41
- ${OBJECTDIR}/jvmlauncher.o \
42
- ${OBJECTDIR}/jruby.o
43
- INCLUDES += "-I${JAVA_INCLUDE}/win32"
44
- else
45
- OBJECTFILES += ${OBJECTDIR}/unixlauncher.o
46
- endif
47
-
48
- CFLAGS += -O2 -Wall $(INCLUDES)
49
- CCFLAGS = $(CFLAGS)
50
- CXXFLAGS = $(CFLAGS)
51
-
52
- # Compiler Flags
53
- ifeq (mingw,$(CONF))
54
- CFLAGS += -m32 -s
55
- endif
56
- ifeq (mingw64,$(CONF))
57
- CFLAGS += -m64 -s
58
- endif
59
-
60
- # Resources
61
- WINDRES = windres
62
-
63
- # Link Libraries and Options
64
- LDLIBSOPTIONS = -lstdc++
65
-
66
- ifdef MINGW
67
- LDLIBSOPTIONS += -lws2_32 -static-libgcc -Wl,--enable-auto-import -Wl,-Bstatic -Wl,-Bdynamic -static
68
- PROGRAM = jruby.dll
69
- else
70
- PROGRAM = jruby
71
- endif
72
-
73
- ifneq (,$(findstring SunOS,$(CND_PLATFORM)))
74
- CFLAGS += -D__SUNOS__
75
- LDLIBSOPTIONS += -lsocket -lnsl
76
- endif
1
+ # Environment
2
+ MKDIR=mkdir
3
+ CP=cp
4
+ CCADMIN=CCadmin
5
+ RANLIB=ranlib
6
+ CC=gcc
7
+ CCC=g++
8
+ CXX=g++
9
+
10
+ # Windows (mingw)?
11
+ ifneq (,$(findstring mingw, $(CONF)))
12
+ MINGW := true
13
+ endif
14
+
15
+ # Macros
16
+ ifndef CND_PLATFORM
17
+ CND_PLATFORM=$(shell uname -s)
18
+ endif
19
+
20
+ # Include project Makefile
21
+ include Makefile
22
+
23
+ # Object Directory
24
+ OBJECTDIR=build/${CONF}/${CND_PLATFORM}
25
+
26
+ # Object Files
27
+ OBJECTFILES = ${OBJECTDIR}/argparser.o \
28
+ ${OBJECTDIR}/utilsfuncs.o \
29
+ ${OBJECTDIR}/ng.o \
30
+ ${OBJECTDIR}/strlcpy.o \
31
+ ${OBJECTDIR}/jrubyexe.o
32
+
33
+ ifdef JAVA_HOME
34
+ JAVA_INCLUDE = $(subst \,/,${JAVA_HOME})/include
35
+ INCLUDES = "-I${JAVA_INCLUDE}"
36
+ endif
37
+
38
+ ifdef MINGW
39
+ OBJECTFILES += ${OBJECTDIR}/utilsfuncswin.o \
40
+ ${OBJECTDIR}/platformlauncher.o \
41
+ ${OBJECTDIR}/jvmlauncher.o \
42
+ ${OBJECTDIR}/jruby.o
43
+ INCLUDES += "-I${JAVA_INCLUDE}/win32"
44
+ else
45
+ OBJECTFILES += ${OBJECTDIR}/unixlauncher.o
46
+ endif
47
+
48
+ CFLAGS += -O2 -Wall $(INCLUDES)
49
+ CCFLAGS = $(CFLAGS)
50
+ CXXFLAGS = $(CFLAGS)
51
+
52
+ # Compiler Flags
53
+ ifeq (mingw,$(CONF))
54
+ CFLAGS += -m32 -s
55
+ endif
56
+ ifeq (mingw64,$(CONF))
57
+ CFLAGS += -m64 -s
58
+ endif
59
+
60
+ # Resources
61
+ WINDRES = windres
62
+
63
+ # Link Libraries and Options
64
+ LDLIBSOPTIONS = -lstdc++
65
+
66
+ ifdef MINGW
67
+ LDLIBSOPTIONS += -lws2_32 -static-libgcc -Wl,--enable-auto-import -Wl,-Bstatic -Wl,-Bdynamic -static
68
+ PROGRAM = jruby.dll
69
+ else
70
+ PROGRAM = jruby
71
+ endif
72
+
73
+ ifneq (,$(findstring SunOS,$(CND_PLATFORM)))
74
+ CFLAGS += -D__SUNOS__
75
+ LDLIBSOPTIONS += -lsocket -lnsl
76
+ endif
@@ -1,107 +1,107 @@
1
- # Building and Cleaning subprojects are done by default, but can be controlled with the SUB
2
- # macro. If SUB=no, subprojects will not be built or cleaned. The following macro
3
- # statements set BUILD_SUB-CONF and CLEAN_SUB-CONF to .build-reqprojects-conf
4
- # and .clean-reqprojects-conf unless SUB has the value 'no'
5
- SUB_no=NO
6
- SUBPROJECTS=${SUB_${SUB}}
7
- BUILD_SUBPROJECTS_=.build-subprojects
8
- BUILD_SUBPROJECTS_NO=
9
- BUILD_SUBPROJECTS=${BUILD_SUBPROJECTS_${SUBPROJECTS}}
10
- CLEAN_SUBPROJECTS_=.clean-subprojects
11
- CLEAN_SUBPROJECTS_NO=
12
- CLEAN_SUBPROJECTS=${CLEAN_SUBPROJECTS_${SUBPROJECTS}}
13
-
14
-
15
- # Project Name
16
- PROJECTNAME=jruby-launcher
17
-
18
- # Active Configuration
19
- DEFAULTCONF=mingw
20
- CONF=${DEFAULTCONF}
21
-
22
- # All Configurations
23
- ALLCONFS=mingw mingw64 unix
24
-
25
- # build
26
- .build-impl: .build-pre .validate-impl .depcheck-impl
27
- @#echo "=> Running $@... Configuration=$(CONF)"
28
- ${MAKE} -f inc/Makefile-rules.mk CONF=$(CONF) SUBPROJECTS=${SUBPROJECTS} .build-conf
29
-
30
-
31
- # clean
32
- .clean-impl: .clean-pre .depcheck-impl
33
- @#echo "=> Running $@... Configuration=$(CONF)"
34
- ${MAKE} -f inc/Makefile-rules.mk CONF=$(CONF) SUBPROJECTS=${SUBPROJECTS} .clean-conf
35
-
36
-
37
- # clobber
38
- .clobber-impl: .clobber-pre .depcheck-impl
39
- @#echo "=> Running $@..."
40
- for CONF in ${ALLCONFS}; \
41
- do \
42
- ${MAKE} -f inc/Makefile-rules.mk CONF=$(CONF) SUBPROJECTS=${SUBPROJECTS} .clean-conf; \
43
- done
44
-
45
- # all
46
- .all-impl: .all-pre .depcheck-impl
47
- @#echo "=> Running $@..."
48
- for CONF in ${ALLCONFS}; \
49
- do \
50
- ${MAKE} -f inc/Makefile-rules.mk CONF=$(CONF) SUBPROJECTS=${SUBPROJECTS} .build-conf; \
51
- done
52
-
53
- # configuration validation (currently only needed on mingw/windows)
54
- .validate-impl:
55
- @if [ $(CONF) = mingw -a ! "$$JAVA_HOME" ]; \
56
- then \
57
- echo ""; \
58
- echo "Error: JAVA_HOME not set. Please make sure you have a JVM installed"; \
59
- echo "and JAVA_HOME pointing to it."; \
60
- echo "Current directory: " `pwd`; \
61
- echo ""; \
62
- exit 1; \
63
- fi
64
-
65
- # dependency checking support
66
- .depcheck-impl:
67
- @echo "# This code depends on make tool being used" >.dep.inc
68
- @if [ -n "${MAKE_VERSION}" ]; then \
69
- echo "DEPFILES=\$$(wildcard \$$(addsuffix .d, \$${OBJECTFILES}))" >>.dep.inc; \
70
- echo "ifneq (\$${DEPFILES},)" >>.dep.inc; \
71
- echo "include \$${DEPFILES}" >>.dep.inc; \
72
- echo "endif" >>.dep.inc; \
73
- else \
74
- echo ".KEEP_STATE:" >>.dep.inc; \
75
- echo ".KEEP_STATE_FILE:.make.state.\$${CONF}" >>.dep.inc; \
76
- fi
77
-
78
- # help
79
- .help-impl: .help-pre
80
- @echo "This makefile supports the following configurations:"
81
- @echo " ${ALLCONFS}"
82
- @echo ""
83
- @echo "and the following targets:"
84
- @echo " build (default target)"
85
- @echo " clean"
86
- @echo " clobber"
87
- @echo " all"
88
- @echo " help"
89
- @echo ""
90
- @echo "Makefile Usage:"
91
- @echo " make [CONF=<CONFIGURATION>] [SUB=no] build"
92
- @echo " make [CONF=<CONFIGURATION>] [SUB=no] clean"
93
- @echo " make [SUB=no] clobber"
94
- @echo " make [SUB=no] all"
95
- @echo " make help"
96
- @echo ""
97
- @echo "Target 'build' will build a specific configuration and, unless 'SUB=no',"
98
- @echo " also build subprojects."
99
- @echo "Target 'clean' will clean a specific configuration and, unless 'SUB=no',"
100
- @echo " also clean subprojects."
101
- @echo "Target 'clobber' will remove all built files from all configurations and,"
102
- @echo " unless 'SUB=no', also from subprojects."
103
- @echo "Target 'all' will will build all configurations and, unless 'SUB=no',"
104
- @echo " also build subprojects."
105
- @echo "Target 'help' prints this message."
106
- @echo ""
107
-
1
+ # Building and Cleaning subprojects are done by default, but can be controlled with the SUB
2
+ # macro. If SUB=no, subprojects will not be built or cleaned. The following macro
3
+ # statements set BUILD_SUB-CONF and CLEAN_SUB-CONF to .build-reqprojects-conf
4
+ # and .clean-reqprojects-conf unless SUB has the value 'no'
5
+ SUB_no=NO
6
+ SUBPROJECTS=${SUB_${SUB}}
7
+ BUILD_SUBPROJECTS_=.build-subprojects
8
+ BUILD_SUBPROJECTS_NO=
9
+ BUILD_SUBPROJECTS=${BUILD_SUBPROJECTS_${SUBPROJECTS}}
10
+ CLEAN_SUBPROJECTS_=.clean-subprojects
11
+ CLEAN_SUBPROJECTS_NO=
12
+ CLEAN_SUBPROJECTS=${CLEAN_SUBPROJECTS_${SUBPROJECTS}}
13
+
14
+
15
+ # Project Name
16
+ PROJECTNAME=jruby-launcher
17
+
18
+ # Active Configuration
19
+ DEFAULTCONF=mingw
20
+ CONF=${DEFAULTCONF}
21
+
22
+ # All Configurations
23
+ ALLCONFS=mingw mingw64 unix
24
+
25
+ # build
26
+ .build-impl: .build-pre .validate-impl .depcheck-impl
27
+ @#echo "=> Running $@... Configuration=$(CONF)"
28
+ ${MAKE} -f inc/Makefile-rules.mk CONF=$(CONF) SUBPROJECTS=${SUBPROJECTS} .build-conf
29
+
30
+
31
+ # clean
32
+ .clean-impl: .clean-pre .depcheck-impl
33
+ @#echo "=> Running $@... Configuration=$(CONF)"
34
+ ${MAKE} -f inc/Makefile-rules.mk CONF=$(CONF) SUBPROJECTS=${SUBPROJECTS} .clean-conf
35
+
36
+
37
+ # clobber
38
+ .clobber-impl: .clobber-pre .depcheck-impl
39
+ @#echo "=> Running $@..."
40
+ for CONF in ${ALLCONFS}; \
41
+ do \
42
+ ${MAKE} -f inc/Makefile-rules.mk CONF=$(CONF) SUBPROJECTS=${SUBPROJECTS} .clean-conf; \
43
+ done
44
+
45
+ # all
46
+ .all-impl: .all-pre .depcheck-impl
47
+ @#echo "=> Running $@..."
48
+ for CONF in ${ALLCONFS}; \
49
+ do \
50
+ ${MAKE} -f inc/Makefile-rules.mk CONF=$(CONF) SUBPROJECTS=${SUBPROJECTS} .build-conf; \
51
+ done
52
+
53
+ # configuration validation (currently only needed on mingw/windows)
54
+ .validate-impl:
55
+ @if [ $(CONF) = mingw -a ! "$$JAVA_HOME" ]; \
56
+ then \
57
+ echo ""; \
58
+ echo "Error: JAVA_HOME not set. Please make sure you have a JVM installed"; \
59
+ echo "and JAVA_HOME pointing to it."; \
60
+ echo "Current directory: " `pwd`; \
61
+ echo ""; \
62
+ exit 1; \
63
+ fi
64
+
65
+ # dependency checking support
66
+ .depcheck-impl:
67
+ @echo "# This code depends on make tool being used" >.dep.inc
68
+ @if [ -n "${MAKE_VERSION}" ]; then \
69
+ echo "DEPFILES=\$$(wildcard \$$(addsuffix .d, \$${OBJECTFILES}))" >>.dep.inc; \
70
+ echo "ifneq (\$${DEPFILES},)" >>.dep.inc; \
71
+ echo "include \$${DEPFILES}" >>.dep.inc; \
72
+ echo "endif" >>.dep.inc; \
73
+ else \
74
+ echo ".KEEP_STATE:" >>.dep.inc; \
75
+ echo ".KEEP_STATE_FILE:.make.state.\$${CONF}" >>.dep.inc; \
76
+ fi
77
+
78
+ # help
79
+ .help-impl: .help-pre
80
+ @echo "This makefile supports the following configurations:"
81
+ @echo " ${ALLCONFS}"
82
+ @echo ""
83
+ @echo "and the following targets:"
84
+ @echo " build (default target)"
85
+ @echo " clean"
86
+ @echo " clobber"
87
+ @echo " all"
88
+ @echo " help"
89
+ @echo ""
90
+ @echo "Makefile Usage:"
91
+ @echo " make [CONF=<CONFIGURATION>] [SUB=no] build"
92
+ @echo " make [CONF=<CONFIGURATION>] [SUB=no] clean"
93
+ @echo " make [SUB=no] clobber"
94
+ @echo " make [SUB=no] all"
95
+ @echo " make help"
96
+ @echo ""
97
+ @echo "Target 'build' will build a specific configuration and, unless 'SUB=no',"
98
+ @echo " also build subprojects."
99
+ @echo "Target 'clean' will clean a specific configuration and, unless 'SUB=no',"
100
+ @echo " also clean subprojects."
101
+ @echo "Target 'clobber' will remove all built files from all configurations and,"
102
+ @echo " unless 'SUB=no', also from subprojects."
103
+ @echo "Target 'all' will will build all configurations and, unless 'SUB=no',"
104
+ @echo " also build subprojects."
105
+ @echo "Target 'help' prints this message."
106
+ @echo ""
107
+