File: configure.in

package info (click to toggle)
qdbm 1.8.78-6.1
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 6,952 kB
  • ctags: 5,454
  • sloc: ansic: 31,454; cpp: 3,623; perl: 2,167; java: 2,079; ruby: 1,690; makefile: 1,318; sh: 396
file content (263 lines) | stat: -rw-r--r-- 6,067 bytes parent folder | download | duplicates (8)
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
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
# Source of configuration for Java interface of QDBM



#================================================================
# Generic Settings
#================================================================


# Targets
AC_INIT(qdbm-java, 1.0.0)

# Export variables
LIBVER=1
LIBREV=0
TARGETS="all"
MYJAVAHOME="/usr/java"
JVMPLATFORM="linux"
JAVAC="javac"
JAR="jar"
JAVAH="javah"
JAVADOC="javadoc"
JAVARUN="java"
MYDEFS=""
MYOPTS=""
LD="ld"

# Building paths
pathtmp="$PATH"
PATH="$HOME/bin:/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin"
PATH="$PATH:/usr/ccs/bin:/usr/ucb:/usr/xpg4/bin:/usr/xpg6/bin:$pathtmp"
LIBRARY_PATH="$HOME/lib:/usr/local/lib:$LIBRARY_PATH"
LD_LIBRARY_PATH="$HOME/lib:/usr/local/lib:$LD_LIBRARY_PATH"
CPATH="$HOME/include:/usr/local/include:$CPATH"
export PATH LIBRARY_PATH LD_LIBRARY_PATH CPATH



#================================================================
# Options
#================================================================


# Debug mode
AC_ARG_ENABLE(debug,
  AC_HELP_STRING([--enable-debug], [build for debugging]))
if test "$enable_debug" = "yes"
then
  TARGETS="debug"
fi

# Developping mode
AC_ARG_ENABLE(devel,
  AC_HELP_STRING([--enable-devel], [build for development]))
if test "$enable_devel" = "yes"
then
  TARGETS="devel"
fi

# Enable gcj
AC_ARG_WITH(gcj,
  AC_HELP_STRING([--with-gcj], [build with gcj, gcc for Java]))



#================================================================
# Checking Commands to Build with
#================================================================


# Home directory of Java
printf 'checking MYJAVAHOME... '
if test -d "$JAVA_HOME"
then
  MYJAVAHOME="$JAVA_HOME"
fi
printf '%s\n' "$MYJAVAHOME"

# Platform of Java
printf 'checking JVMPLATFORM... '
if uname | grep Darwin > /dev/null
then
  JVMPLATFORM="mac"
else
  for file in `\ls $MYJAVAHOME/include`
  do
    if test -d "$MYJAVAHOME/include/$file"
    then
      JVMPLATFORM="$file"
    fi
  done
fi
printf '%s\n' "$JVMPLATFORM"

# Java compiler
printf 'checking JAVAC... '
JAVAC="$MYJAVAHOME/bin/javac"
if uname | grep Darwin > /dev/null
then
  if test -x "$MYJAVAHOME/Commands/javac"
  then
    JAVAC="$MYJAVAHOME/Commands/javac"
  else
    JAVAC="$MYJAVAHOME/bin/javac"
  fi
fi
if test "$with_gcj" = "yes"
then
  JAVAC="gcj -C -Wall"
  printf 'gcj -C -Wall\n'
elif test -x "$JAVAC"
then
  printf '%s\n' "$JAVAC"
else
  printf 'no\n'
  printf '#================================================================\n' 1>&2
  printf '# WARNING: %s is not found.\n' "$JAVAC" 1>&2
  printf '#================================================================\n' 1>&2
fi

# Other building tools
if test "$with_gcj" = "yes"
then
  JAR="jar"
  JAVAH="gcjh"
  JAVADOC="false"
  JAVARUN="gij"
elif uname | grep Darwin > /dev/null
then
  if test -x "$MYJAVAHOME/Commands/java"
  then
    JAR="$MYJAVAHOME/Commands/jar"
    JAVAH="$MYJAVAHOME/Commands/javah"
    JAVADOC="$MYJAVAHOME/Commands/javadoc"
    JAVARUN="$MYJAVAHOME/Commands/java"
  else
    JAR="$MYJAVAHOME/bin/jar"
    JAVAH="$MYJAVAHOME/bin/javah"
    JAVADOC="$MYJAVAHOME/bin/javadoc"
    JAVARUN="$MYJAVAHOME/bin/java"
  fi
else
  JAR="$MYJAVAHOME/bin/jar"
  JAVAH="$MYJAVAHOME/bin/javah"
  JAVADOC="$MYJAVAHOME/bin/javadoc"
  JAVARUN="$MYJAVAHOME/bin/java"
fi

# C compiler
AC_PROG_CC
if test "$GCC" != "yes"
then
  printf '#================================================================\n' 1>&2
  printf '# WARNING: GCC is required to build this package.\n' 1>&2
  printf '#================================================================\n' 1>&2
fi
if uname | egrep -i 'SunOS' > /dev/null 2>&1
then
  MYOPTS="-O1"
fi
if uname | egrep -i 'BSD' > /dev/null 2>&1
then
  MYOPTS="-O1"
fi
if gcc --version | egrep -i '^2\.(8|9)' > /dev/null 2>&1
then
  MYOPTS="-O1"
fi

# Linker
printf 'checking for ld... '
if which ld | grep '/ld$' > /dev/null 2>&1
then
  LD=`which ld`
  printf '%s\n' "$LD"
else
  printf 'no\n'
  printf '#================================================================\n' 1>&2
  printf '# WARNING: ld is not found in PATH.\n' 1>&2
  printf '#================================================================\n' 1>&2
fi



#================================================================
# Checking Libraries
#================================================================


# Underlying libraries
AC_CHECK_LIB(c, main)
AC_CHECK_LIB(pthread, main)
AC_CHECK_LIB(z, main)
AC_CHECK_LIB(lzo2, main)
AC_CHECK_LIB(bz2, main)
AC_CHECK_LIB(iconv, main)

# Fundamental QDBM libraries
AC_CHECK_LIB(qdbm, main, true,
  printf 'checking whether /usr/local/lib/libqdbm.* is... '
  if ls /usr/local/lib/libqdbm.* > /dev/null 2>&1
  then
    printf 'yes\n'
  else
    printf 'no\n'
    printf '#================================================================\n' 1>&2
    printf '# WARNING: Install QDBM libraries before installation.\n' 1>&2
    printf '#================================================================\n' 1>&2
  fi
)

# For old BSDs
if uname -a | grep BSD > /dev/null &&
  test -f /usr/lib/libc_r.a && test ! -f /usr/lib/libpthread.a
then
  LIBS=`printf '%s' "$LIBS" | sed 's/-lc/-lc_r/g'`
fi

# Duplication of QDBM for Java
AC_CHECK_LIB(jqdbm, main,
  printf '#================================================================\n' 1>&2
  printf '# WARNING: An old library was detected.\n' 1>&2
  printf '#================================================================\n' 1>&2
)



#================================================================
# Generic Settings
#================================================================

# Data types
if uname | grep '^SunOS' > /dev/null
then
  MYDEFS='-Dint64_t=long\ long'
elif uname | grep '^CYGWIN' > /dev/null
then
  MYDEFS='-D__int64=long\ long'
fi

# Export variables
AC_SUBST(LIBVER)
AC_SUBST(LIBREV)
AC_SUBST(TARGETS)
AC_SUBST(MYJAVAHOME)
AC_SUBST(JVMPLATFORM)
AC_SUBST(JAVAC)
AC_SUBST(JAR)
AC_SUBST(JAVAH)
AC_SUBST(JAVADOC)
AC_SUBST(JAVARUN)
AC_SUBST(MYDEFS)
AC_SUBST(MYOPTS)
AC_SUBST(LD)
AC_SUBST(CPPFLAGS)
AC_SUBST(LDFLAGS)

# Targets
AC_OUTPUT(Makefile)



# END OF FILE