-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathconfigure.in
301 lines (245 loc) · 5.88 KB
/
configure.in
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
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
dnl -*- shell-script -*-
dnl
dnl hfsutils - tools for reading and writing Macintosh HFS volumes
dnl Copyright (C) 1996-1998 Robert Leslie
dnl
dnl This program is free software; you can redistribute it and/or modify
dnl it under the terms of the GNU General Public License as published by
dnl the Free Software Foundation; either version 2 of the License, or
dnl (at your option) any later version.
dnl
dnl This program is distributed in the hope that it will be useful,
dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
dnl GNU General Public License for more details.
dnl
dnl You should have received a copy of the GNU General Public License
dnl along with this program; if not, write to the Free Software
dnl Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
dnl
dnl $Id: configure.in,v 1.10 1998/09/15 19:19:42 rob Exp $
dnl
AC_INIT(libhfs/libhfs.h)
AC_CONFIG_HEADER(config.h)
AC_CONFIG_SUBDIRS(libhfs librsrc)
AC_ARG_WITH(tcl,
[ --with-tcl[=DIR] build the Tcl components], [
case "$with_tcl" in
yes|no)
tcl_dir="DEFAULT"
;;
*)
tcl_dir="$with_tcl"
with_tcl=yes
;;
esac
])
AC_ARG_WITH(tk,
[ --with-tk[=DIR] build the Tk components], [
case "$with_tk" in
yes|no)
tk_dir="DEFAULT"
;;
*)
tk_dir="$with_tk"
with_tk=yes
;;
esac
])
if test "$with_tk" = yes && test "$with_tcl" != yes
then
AC_MSG_ERROR(--with-tk requires --with-tcl)
fi
dnl Checks for programs.
AC_PROG_MAKE_SET
AC_PROG_CC
AC_PROG_INSTALL
AC_PROG_RANLIB
AC_PROG_GCC_TRADITIONAL
dnl Checks for header files.
AC_HEADER_STDC
AC_CHECK_HEADERS(unistd.h fcntl.h termios.h sys/ioctl.h)
dnl Checks for typedefs, structures, and compiler characteristics.
AC_TYPE_UID_T
AC_TYPE_SIZE_T
AC_C_CONST
dnl Checks for library functions.
AC_REPLACE_FUNCS(strdup strerror strstr strtol)
AC_CHECK_FUNCS(setreuid)
AC_CACHE_CHECK(for sys_errlist, hfs_cv_decl_syserrlist, [
AC_TRY_LINK([], [
extern char *sys_errlist[];
extern int sys_nerr;
sys_errlist[sys_nerr - 1][0] = 0;
], hfs_cv_decl_syserrlist=yes, hfs_cv_decl_syserrlist=no)
])
if test "$hfs_cv_decl_syserrlist" = yes
then
AC_DEFINE(HAVE_SYS_ERRLIST)
fi
dnl Prepare target variables.
MAKE_TARGETS=""
INSTALL_TARGETS=""
AC_SUBST(MAKE_TARGETS)
AC_SUBST(INSTALL_TARGETS)
dnl Tcl configuration.
TCL_INCLUDES=""
TCL_LIB_SPEC=""
TCL_LIBS=""
AC_SUBST(TCL_INCLUDES)
AC_SUBST(TCL_LIB_SPEC)
AC_SUBST(TCL_LIBS)
if test "$with_tcl" = yes
then
AC_MSG_CHECKING(for Tcl)
found=""
for dir in \
"$tcl_dir" \
"$tcl_dir/lib" \
"$tcl_dir/../lib" \
/usr/local/lib \
/usr/local/lib/tcl* \
/usr/local/tcl*/lib \
/usr/lib \
/usr/lib/tcl* \
/usr/tcl*/lib \
; \
do
if test -r "$dir/tclConfig.sh"
then
found="$dir"
break
fi
done
if test -z "$found"
then
AC_MSG_RESULT(cannot find installation)
AC_MSG_ERROR(use --without-tcl or --with-tcl=DIR)
fi
tcl_dir="$found"
. "$tcl_dir/tclConfig.sh"
AC_MSG_RESULT(version $TCL_VERSION in $tcl_dir)
AC_MSG_CHECKING(for tcl.h)
found=""
for dir in \
$TCL_PREFIX/include \
$TCL_PREFIX/include/tcl* \
$TCL_PREFIX/tcl*/include \
"$tcl_dir" \
"$tcl_dir/include" \
"$tcl_dir/../include" \
`echo "$tcl_dir" | sed -e 's|/lib|/include|'` \
; \
do
if test -r "$dir/tcl.h"
then
found="$dir"
break
fi
done
if test -z "$found"
then
AC_MSG_RESULT(not found)
AC_MSG_WARN(compilation of Tcl components may fail)
AC_MSG_WARN(edit Makefile if necessary and contact author)
else
AC_MSG_RESULT($found)
TCL_INCLUDES="-I$found"
fi
MAKE_TARGETS="$MAKE_TARGETS all_tcl"
INSTALL_TARGETS="$INSTALL_TARGETS install_tcl"
fi
dnl Tk configuration.
TK_INCLUDES=""
TK_LIB_SPEC=""
TK_LIBS=""
AC_SUBST(TK_INCLUDES)
AC_SUBST(TK_LIB_SPEC)
AC_SUBST(TK_LIBS)
if test "$with_tk" = yes
then
AC_MSG_CHECKING(for Tk)
found=""
for dir in \
"$tk_dir" \
"$tk_dir/lib" \
"$tk_dir/../lib" \
/usr/local/lib \
/usr/local/lib/tk* \
/usr/local/tk*/lib \
/usr/lib \
/usr/lib/tk* \
/usr/tk*/lib \
; \
do
if test -r "$dir/tkConfig.sh"
then
found="$dir"
break
fi
done
if test -z "$found"
then
AC_MSG_RESULT(cannot find installation)
AC_MSG_ERROR(use --without-tk or --with-tk=DIR)
fi
tk_dir="$found"
. "$tk_dir/tkConfig.sh"
AC_MSG_RESULT(version $TK_VERSION in $tk_dir)
AC_MSG_CHECKING(for tk.h)
found=""
for dir in \
$TK_PREFIX/include \
$TK_PREFIX/include/tk* \
$TK_PREFIX/tk*/include \
"$tk_dir" \
"$tk_dir/include" \
"$tk_dir/../include" \
`echo "$tk_dir" | sed -e 's|/lib|/include|'` \
; \
do
if test -r "$dir/tk.h"
then
found="$dir"
break
fi
done
if test -z "$found"
then
AC_MSG_RESULT(not found)
AC_MSG_WARN(compilation of Tk components may fail)
AC_MSG_WARN(edit Makefile if necessary and contact author)
else
AC_MSG_RESULT($found)
if test "x-I$found" != "x$TCL_INCLUDES"
then
TK_INCLUDES="-I$found"
fi
fi
TK_INCLUDES="$TK_INCLUDES $TK_XINCLUDES"
MAKE_TARGETS="$MAKE_TARGETS all_tk"
INSTALL_TARGETS="$INSTALL_TARGETS install_tk"
fi
dnl Other options.
AC_ARG_ENABLE(cli,
[ --disable-cli do not build or install the command-line utils])
if test "x$enable_cli" != xno
then
MAKE_TARGETS="all_cli $MAKE_TARGETS"
INSTALL_TARGETS="install_cli $INSTALL_TARGETS"
fi
AC_ARG_ENABLE(devlibs,
[ --enable-devlibs enable installation of the developer libraries])
if test "x$enable_devlibs" = xyes
then
MAKE_TARGETS="$MAKE_TARGETS all_lib"
INSTALL_TARGETS="$INSTALL_TARGETS install_lib"
fi
AC_ARG_ENABLE(debug,
[ --enable-debug enable diagnostic debugging support])
if test "x$enable_debug" = xyes
then
AC_DEFINE(DEBUG)
fi
dnl Create output files.
AC_OUTPUT(hfsck/Makefile linux/Makefile Makefile)