summaryrefslogtreecommitdiff
path: root/java/jflex/files/patch-jflex
blob: 3ea64aef137a95b9e7f013724e4ee16725860c6c (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
--- bin/jflex.orig	Mon May  3 23:06:29 2004
+++ bin/jflex	Mon May  3 23:11:12 2004
@@ -1,51 +1,19 @@
-#! /bin/bash 
+#!/bin/sh 
 #
-#     JFlex start script $Revision: 2.0 $
+# Replacement for the script that came with JFlex
+# because bash is not necessarily on a FreeBSD
+# machine. Also, we know where the jar is.
 #
-# if Java is not in your binary path, you need to supply its
-# location in this script. The script automatically finds 
-# JFLEX_HOME when called directly, via binary path, or symbolic
-# link. 
-#
-# Site wide installation: simply make a symlink from e.g.
-# /usr/bin/jflex to this script at its original position
-#
-#===================================================================
-#
-# configurables:
-
-# path to the java interpreter
-JAVA=java
-
-# end configurables
-#
-#===================================================================
-#
-
-# calculate true location
-
-PRG=`type $0`
-PRG=${PRG##* }
-
-# If PRG is a symlink, trace it to the real home directory
-
-while [ -L "$PRG" ]
-do
-    newprg=$(ls -l ${PRG})
-    newprg=${newprg##*-> }
-    [ ${newprg} = ${newprg#/} ] && newprg=${PRG%/*}/${newprg}
-    PRG="$newprg"
-done
-
-PRG=${PRG%/*}
-JFLEX_HOME=${PRG}/.. 
-
-# --------------------------------------------------------------------
+# Conor McDermottroe <ports@mcdermottroe.com>
 
-export CLASSPATH
-CLASSPATH=$JFLEX_HOME/lib/JFlex.jar
+# Allow the user to override where JFlex.jar lives
+if [ -z "$JAVAJARDIR" ]; then
+	JAVAJARDIR=%%JAVAJARDIR%%
+fi
 
-$JAVA JFlex.Main $@
+# Allow the user to specify which java interpreter to use
+if [ -z "$JAVA" ]; then
+	JAVA="`which javavm`"
+fi
 
-#for more memory:
-#$JAVA -Xmx128m JFlex.Main $@
+$JAVA -jar $JAVAJARDIR/JFlex.jar $@