This repository has been archived by the owner on Sep 8, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
configure
executable file
·147 lines (119 loc) · 3.66 KB
/
configure
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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
#!/bin/sh
# Configuration script for GJDB
srcdir="`(cd \`dirname $0\`; pwd)`"
builddir="`pwd`"
arch=`uname`
doReplace () {
echo Creating ./$1/$2 from $srcdir/$1/$2.in
sed -e "s,@apphome@,$apphome,g" \
-e "s,@jdilib@,$jdilib,g" \
-e "s,@complib@,$complib,g" \
-e "s,@srcdir@,$srcdir,g" \
-e "s,@builddir@,$builddir,g" \
-e "s,@docdir@,$docdir,g" \
-e "s,@prefix@,$prefix,g" \
-e "s,@libdir@,$libdir,g" \
-e "s,@bindir@,$bindir,g" \
-e "s,@jdk@,$jdk,g" \
-e "s,@compiler@,$compiler,g" \
-e "s,@emacsdir@,$emacsdir,g" $srcdir/$1/$2.in > $1/$2
}
Usage () {
echo 'Usage: SRCDIR/configure [OPTIONS] [CONFIG_FILE]
where SRCDIR is the top-level directory for the GJDB distribution and
OPTIONS contains the following
--apphome=DIR The location at which java is installed. That is,
java and javac are in DIR/bin, and DIR/lib contains
the compiled standard class libraries.
This version of gjdb requires jdk1.5 or higher.
--prefix=DIR Default directory prefix for installation (see
below). Default is $HOME.
--sharedir=DIR Directory containing architecture-independent code.
Default is prefix/share/gjdb.
--docdir=DIR Directory in which to install gjdb.pdf. Default
is sharedir/doc.
--libdir=DIR Directory in which to install gjdb.jar. Default
is sharedir/lib
--bindir=DIR Directory in which to install gjdb. Default is
prefix/bin
--emacsdir=DIR Directory in which to install gjdb.el. Default is
sharedir/emacs/lisp
If CONFIG_FILE is specified, re-creates only that file.
'
exit 1
}
file=
config="$0 $@"
prefix=$HOME
while [ $# -gt 0 ]; do
val="`echo $1 | sed 's/^.*=//'`"
case $1 in
--apphome=*) apphome="$val";;
--prefix=*) prefix="$val";;
--sharedir=*) sharedir="$val";;
--docdir=*) docdir="$val";;
--libdir=*) libdir="$val";;
--bindir=*) bindir="$val";;
--emacsdir=*) emacsdir="$val";;
--*) Usage;;
*) if [ "X$file" = "X" ]; then file=$1; else Usage; fi;;
esac
shift
done
if [ -z "$apphome" ]; then
javac -d . $srcdir/Javahome.java
apphome="`java Javahome`"
if [ ! -x $apphome/bin/javac ]; then
apphome="`dirname $apphome`"
fi
fi
if [ -z "$apphome" -o ! -x "$apphome/bin/javac" ]; then
echo "Cannot find Java installation"
exit 1
fi
rawjavaversion="`$apphome/bin/java -version 2>&1`"
majorversion=`echo $rawjavaversion | sed -e '1s/^.*"\([0-9]*\)\.[0-9]*.*$/\1/' -e 1q`
minorversion=`echo $rawjavaversion | sed -e '1s/^.*"[0-9]*\.\([0-9]*\).*$/\1/' -e 1q`
jdk=`echo $rawjavaversion | sed -e '1s/^.*"\([-0-9a-zA-Z._]*\)".*$/\1/' -e 1q`
if [ "$majorversion" != "1" -o "0$minorversion" -lt 3 ]; then
echo "Error: Unrecognized Java version: \"$rawjavaversion\""
exit 1
else
echo "Configuring for JDK version $rawjavaversion"
fi
if [ -r "${apphome}/lib/tools.jar" ]; then
jdilib="${apphome}/lib/tools.jar"
complib="-classpath $jdilib"
else
jdilib=
complib=
fi
compiler=3
sharedir=${sharedir:-${prefix}/share/gjdb}
libdir=${libdir:-${sharedir}/lib}
bindir=${bindir:-${prefix}/bin}
emacsdir=${emacsdir:-${sharedir}/emacs/lisp}
docdir=${docdir:-${sharedir}/doc}
if [ -z "$file" ]; then
if [ ! -d src/ucb/gjdb ]; then
mkdir -p src/ucb/gjdb
fi
if [ ! -d bin ]; then
mkdir bin
fi
if [ ! -d doc ]; then
mkdir doc
fi
fi
if [ -z "$file" ]; then
doReplace . Makefile
doReplace bin gjdb
doReplace bin meta-gjdb
doReplace doc Makefile
rm -f config.status
echo "$config" >config.status
echo "Configuration complete. Compile with 'make'; install with 'make install'"
else
doReplace `dirname $file` `basename $file`
fi
exit 0