]>
Commit | Line | Data |
---|---|---|
50e1e10f | 1 | AC_INIT(version.h) |
a4b2d3ce | 2 | AC_PREREQ(2.12) |
50e1e10f TT |
3 | MCONFIG=./MCONFIG |
4 | AC_SUBST_FILE(MCONFIG) | |
74becf3c TT |
5 | BINARY_TYPE=bin |
6 | dnl | |
7 | dnl This is to figure out the version number and the date.... | |
8 | dnl | |
9 | E2FSPROGS_VERSION=`grep E2FSPROGS_VERSION ${srcdir}/version.h \ | |
10 | | awk '{print $3}' | tr \" " " | awk '{print $1}'` | |
11 | DATE=`grep E2FSPROGS_DATE ${srcdir}/version.h | awk '{print $3}' \ | |
12 | | tr \" " "` | |
13 | MONTH=`echo $DATE | awk -F- '{print $2}'` | |
14 | YEAR=`echo $DATE | awk -F- '{print $3}'` | |
15 | ||
16 | if expr $YEAR ">" 90 >/dev/null ; then | |
17 | E2FSPROGS_YEAR=19$YEAR | |
18 | else | |
19 | E2FSPROGS_YEAR=20$YEAR | |
20 | fi | |
21 | ||
22 | case $MONTH in | |
23 | Jan) E2FSPROGS_MONTH="January" ;; | |
24 | Feb) E2FSPROGS_MONTH="February" ;; | |
25 | Mar) E2FSPROGS_MONTH="March" ;; | |
26 | Apr) E2FSPROGS_MONTH="April" ;; | |
27 | May) E2FSPROGS_MONTH="May" ;; | |
28 | Jun) E2FSPROGS_MONTH="June" ;; | |
29 | Jul) E2FSPROGS_MONTH="July" ;; | |
30 | Aug) E2FSPROGS_MONTH="August" ;; | |
31 | Sep) E2FSPROGS_MONTH="September" ;; | |
32 | Oct) E2FSPROGS_MONTH="October" ;; | |
33 | Nov) E2FSPROGS_MONTH="November" ;; | |
34 | Dec) E2FSPROGS_MONTH="December" ;; | |
35 | *) echo "Unknown month $MONTH??" ;; | |
36 | esac | |
37 | ||
38 | unset DATE MONTH YEAR | |
39 | echo "Generating configuration file for e2fsprogs version $E2FSPROGS_VERSION" | |
40 | echo "Release date is ${E2FSPROGS_MONTH}, ${E2FSPROGS_YEAR}" | |
41 | AC_SUBST(E2FSPROGS_YEAR) | |
42 | AC_SUBST(E2FSPROGS_MONTH) | |
43 | AC_SUBST(E2FSPROGS_VERSION) | |
fc6d9d51 | 44 | AC_REQUIRE([AC_CANONICAL_HOST]) |
74becf3c TT |
45 | dnl |
46 | dnl set $(CC) from --with-cc=value | |
47 | dnl | |
48 | AC_ARG_WITH([cc], | |
49 | [ --with-cc=COMPILER select compiler to use], | |
50 | AC_MSG_RESULT(CC=$withval) | |
51 | CC=$withval, | |
52 | if test -z "$CC" ; then CC=cc; fi | |
53 | [AC_MSG_RESULT(CC defaults to $CC)])dnl | |
54 | export CC | |
55 | AC_SUBST([CC]) | |
56 | dnl | |
57 | dnl set $(LD) from --with-linker=value | |
58 | dnl | |
59 | AC_ARG_WITH([linker], | |
60 | [ --with-linker=LINKER select linker to use], | |
61 | AC_MSG_RESULT(LD=$withval) | |
62 | LD=$withval, | |
63 | if test -z "$LD" ; then LD=$CC; fi | |
64 | [AC_MSG_RESULT(LD defaults to $LD)])dnl | |
65 | export LD | |
66 | AC_SUBST([LD]) | |
67 | dnl | |
68 | dnl set $(CCOPTS) from --with-ccopts=value | |
69 | dnl | |
70 | AC_ARG_WITH([ccopts], | |
71 | [ --with-ccopts=CCOPTS select compiler command line options], | |
72 | AC_MSG_RESULT(CCOPTS is $withval) | |
73 | CCOPTS=$withval | |
74 | CFLAGS="$CFLAGS $withval", | |
75 | CCOPTS=)dnl | |
76 | AC_SUBST(CCOPTS) | |
77 | dnl | |
a4d09610 TT |
78 | dnl Set default values for library extentions. Will be dealt with after |
79 | dnl parsing configuration opions, which may modify these | |
80 | dnl | |
81 | LIB_EXT=.a | |
82 | STATIC_LIB_EXT=.a | |
83 | PROFILE_LIB_EXT=.a | |
84 | dnl | |
74becf3c TT |
85 | dnl set $(LDFLAGS) from --with-ldopts=value |
86 | dnl | |
87 | AC_ARG_WITH([ldopts], | |
88 | [ --with-ldopts=LDOPTS select linker command line options], | |
89 | AC_MSG_RESULT(LDFLAGS is $withval) | |
90 | LDFLAGS=$withval, | |
91 | LDFLAGS=)dnl | |
92 | AC_SUBST(LDFLAGS) | |
50e1e10f | 93 | dnl |
a4b2d3ce | 94 | dnl Allow separate `root_prefix' to be specified |
fc6d9d51 | 95 | dnl |
a4b2d3ce TT |
96 | AC_ARG_WITH([root-prefix], |
97 | [ --with-root-prefix=PREFIX override prefix variable for files to be placed in the root], | |
98 | root_prefix=$withval, | |
99 | root_prefix=NONE)dnl | |
fc6d9d51 | 100 | dnl |
50e1e10f TT |
101 | dnl handle --enable-dll-shlibs |
102 | dnl | |
103 | AC_ARG_ENABLE([dll-shlibs], | |
a4d09610 | 104 | [ --enable-dll-shlibs select DLL libraries], |
50e1e10f TT |
105 | if test "$enableval" = "no" |
106 | then | |
107 | DLL_CMT=# | |
108 | MAKEFILE_DLL=/dev/null | |
109 | echo "Disabling DLL shared libraries" | |
110 | else | |
111 | DLL_CMT= | |
112 | MAKEFILE_DLL=$srcdir/lib/Makefile.dll-lib | |
74becf3c | 113 | BINARY_TYPE=dllbin |
a4d09610 | 114 | LIB_EXT=.sa |
50e1e10f TT |
115 | echo "Enabling DLL shared libraries" |
116 | fi | |
117 | , | |
118 | MAKEFILE_DLL=/dev/null | |
119 | DLL_CMT=# | |
120 | echo "Disabling DLL shared libraries by default" | |
121 | ) | |
122 | AC_SUBST(DLL_CMT) | |
123 | AC_SUBST_FILE(MAKEFILE_DLL) | |
124 | dnl | |
125 | dnl handle --enable-elf-shlibs | |
126 | dnl | |
127 | AC_ARG_ENABLE([elf-shlibs], | |
a4d09610 | 128 | [ --enable-elf-shlibs select ELF shared libraries], |
50e1e10f TT |
129 | if test "$enableval" = "no" |
130 | then | |
131 | ELF_CMT=# | |
132 | MAKEFILE_ELF=/dev/null | |
133 | echo "Disabling ELF shared libraries" | |
134 | else | |
135 | ELF_CMT= | |
136 | MAKEFILE_ELF=$srcdir/lib/Makefile.elf-lib | |
74becf3c | 137 | BINARY_TYPE=elfbin |
a4d09610 | 138 | LIB_EXT=.so |
50e1e10f TT |
139 | echo "Enabling ELF shared libraries" |
140 | fi | |
141 | , | |
142 | MAKEFILE_ELF=/dev/null | |
143 | ELF_CMT=# | |
144 | echo "Disabling ELF shared libraries by default" | |
145 | ) | |
146 | AC_SUBST(ELF_CMT) | |
147 | AC_SUBST_FILE(MAKEFILE_ELF) | |
148 | dnl | |
149 | dnl handle --enable-bsd-shlibs | |
150 | dnl | |
151 | AC_ARG_ENABLE([bsd-shlibs], | |
a4d09610 | 152 | [ --enable-bsd-shlibs select BSD shared libraries], |
50e1e10f TT |
153 | if test "$enableval" = "no" |
154 | then | |
155 | BSDLIB_CMT=# | |
156 | MAKEFILE_BSDLIB=/dev/null | |
157 | echo "Disabling BSD shared libraries" | |
158 | else | |
159 | BSDLIB_CMT= | |
160 | MAKEFILE_BSDLIB=$srcdir/lib/Makefile.bsd-lib | |
a4d09610 | 161 | LIB_EXT=.so |
50e1e10f TT |
162 | echo "Enabling BSD shared libraries" |
163 | fi | |
164 | , | |
165 | MAKEFILE_BSDLIB=/dev/null | |
166 | BSDLIB_CMT=# | |
167 | echo "Disabling BSD shared libraries by default" | |
168 | ) | |
169 | AC_SUBST(BSDLIB_CMT) | |
170 | AC_SUBST_FILE(MAKEFILE_BSDLIB) | |
171 | dnl | |
172 | dnl handle --enable-profile | |
173 | dnl | |
174 | AC_ARG_ENABLE([profile], | |
a4d09610 | 175 | [ --enable-profile build profiling libraries], |
50e1e10f TT |
176 | if test "$enableval" = "no" |
177 | then | |
178 | PROFILE_CMT=# | |
179 | MAKEFILE_PROFILE=/dev/null | |
180 | echo "Disabling profiling libraries" | |
181 | else | |
182 | PROFILE_CMT= | |
183 | MAKEFILE_PROFILE=$srcdir/lib/Makefile.profile | |
a4d09610 | 184 | PROFILED_LIB_EXT=_p.a |
50e1e10f TT |
185 | echo "Building profiling libraries" |
186 | fi | |
187 | , | |
188 | PROFILE_CMT=# | |
189 | MAKEFILE_PROFILE=/dev/null | |
190 | echo "Disabling profiling libraries by default" | |
191 | ) | |
192 | AC_SUBST(PROFILE_CMT) | |
193 | AC_SUBST_FILE(MAKEFILE_PROFILE) | |
194 | dnl | |
195 | dnl handle --enable-checker | |
196 | dnl | |
197 | AC_ARG_ENABLE([checker], | |
a4d09610 | 198 | [ --enable-checker build checker libraries], |
50e1e10f TT |
199 | if test "$enableval" = "no" |
200 | then | |
201 | CHECKER_CMT=# | |
202 | MAKEFILE_CHECKER=/dev/null | |
203 | echo "Disabling checker libraries" | |
204 | else | |
205 | CHECKER_CMT= | |
206 | MAKEFILE_CHECKER=$srcdir/lib/Makefile.checker | |
207 | echo "Building checker libraries" | |
208 | fi | |
209 | , | |
210 | CHECKER_CMT=# | |
211 | MAKEFILE_CHECKER=/dev/null | |
212 | echo "Disabling checker libraries by default" | |
213 | ) | |
214 | AC_SUBST(CHECKER_CMT) | |
215 | AC_SUBST_FILE(MAKEFILE_CHECKER) | |
216 | dnl | |
a4d09610 TT |
217 | dnl Substitute library extensions |
218 | dnl | |
219 | AC_SUBST(LIB_EXT) | |
220 | AC_SUBST(STATIC_LIB_EXT) | |
221 | AC_SUBST(PROFILED_LIB_EXT) | |
222 | dnl | |
50e1e10f TT |
223 | dnl handle --enable-gcc-wall |
224 | dnl | |
225 | AC_ARG_ENABLE([gcc-wall], | |
b0b9c4de | 226 | [ --enable-gcc-wall enable GCC anal warnings (DON'T USE IN PRODUCTION)], |
50e1e10f TT |
227 | if test "$enableval" = "no" |
228 | then | |
229 | W=# | |
230 | echo "Disabling GCC warnings" | |
231 | else | |
232 | W= | |
233 | echo "Enabling GCC warnings" | |
234 | fi | |
235 | , | |
236 | W=# | |
237 | echo "Disabling GCC warnings by default" | |
238 | ) | |
239 | AC_SUBST(W) | |
a4d09610 TT |
240 | AC_ARG_ENABLE([dynamic-e2fsck], |
241 | [ --enable-dynamic-e2fsck build e2fsck dynamically], | |
242 | if test "$enableval" = "no" | |
243 | then | |
244 | E2FSCK_TYPE=static | |
245 | echo "Building e2fsck statically" | |
246 | else | |
247 | E2FSCK_TYPE=shared | |
248 | echo "Building e2fsck dynamically" | |
249 | fi | |
250 | , | |
251 | E2FSCK_TYPE=static | |
252 | echo "Building e2fsck statically by default" | |
253 | ) | |
254 | AC_SUBST(E2FSCK_TYPE) | |
50e1e10f | 255 | dnl |
fc6d9d51 TT |
256 | dnl See whether to install the `fsck' wrapper program (that calls e2fsck) |
257 | dnl | |
258 | AC_ARG_ENABLE([fsck], | |
259 | [ --enable-fsck build fsck wrapper program], | |
260 | [if test "$enableval" = "no" | |
261 | then | |
262 | FSCK_PROG='' FSCK_MAN='' | |
263 | echo "Not building fsck wrapper" | |
264 | else | |
265 | FSCK_PROG=fsck FSCK_MAN=fsck.8 | |
266 | echo "Building fsck wrapper" | |
267 | fi] | |
268 | , | |
269 | [case "$host_os" in | |
270 | gnu*) | |
271 | FSCK_PROG='' FSCK_MAN='' | |
272 | echo "Not building fsck wrapper by default" | |
273 | ;; | |
274 | *) | |
275 | FSCK_PROG=fsck FSCK_MAN=fsck.8 | |
276 | echo "Building fsck wrapper by default" | |
277 | esac] | |
278 | ) | |
279 | AC_SUBST(FSCK_PROG) | |
280 | AC_SUBST(FSCK_MAN) | |
281 | dnl | |
50e1e10f TT |
282 | dnl |
283 | MAKEFILE_LIBRARY=$srcdir/lib/Makefile.library | |
284 | AC_SUBST_FILE(MAKEFILE_LIBRARY) | |
285 | dnl | |
fc6d9d51 TT |
286 | dnl |
287 | AC_ARG_ENABLE([old-bitops], | |
288 | [ --enable-old-bitops Use old (non-standard but native) bitmask operations], | |
289 | if test "$enableval" = "no" | |
290 | then | |
291 | echo "Using new (standard) bitmask operations" | |
292 | else | |
293 | AC_DEFINE(EXT2_OLD_BITOPS) | |
294 | echo "Using old (native) bitmask operations" | |
295 | ||
296 | fi | |
297 | , | |
298 | echo "Using standard bitmask operations by default" | |
299 | ) | |
300 | dnl | |
50e1e10f TT |
301 | dnl End of configuration options |
302 | dnl | |
74becf3c | 303 | AC_SUBST(BINARY_TYPE) |
50e1e10f TT |
304 | AC_PROG_MAKE_SET |
305 | AC_PATH_PROG(LN, ln, ln) | |
fc6d9d51 | 306 | AC_PROG_LN_S |
50e1e10f TT |
307 | AC_PATH_PROG(MV, mv, mv) |
308 | AC_PATH_PROG(CP, cp, cp) | |
309 | AC_PATH_PROG(RM, rm, rm) | |
310 | AC_PATH_PROG(CHMOD, chmod, :) | |
311 | AC_PATH_PROG(AWK, awk, awk) | |
312 | AC_PATH_PROG(SED, sed, sed) | |
313 | AC_CHECK_TOOL(AR, ar, ar) | |
314 | AC_CHECK_TOOL(RANLIB, ranlib, :) | |
315 | AC_CHECK_TOOL(STRIP, strip, :) | |
316 | AC_PROG_CC | |
317 | AC_PROG_INSTALL | |
318 | AC_C_CROSS | |
5a679c8f | 319 | AC_CHECK_HEADERS(stdlib.h unistd.h stdarg.h errno.h mntent.h paths.h dirent.h getopt.h setjmp.h linux/fd.h linux/major.h sys/disklabel.h sys/sockio.h sys/time.h sys/stat.h sys/types.h net/if.h netinet/in.h) |
50e1e10f TT |
320 | AC_FUNC_VPRINTF |
321 | dnl | |
322 | dnl See if struct dirent has a d_namlen field (like bsd systems), implying | |
323 | dnl that the actual length of the structure may be grater than the declared | |
324 | dnl length. | |
325 | dnl | |
326 | AC_MSG_CHECKING(whether struct dirent has a d_namlen field) | |
327 | AC_CACHE_VAL(e2fsprogs_cv_struct_d_namlen, | |
328 | AC_TRY_COMPILE( | |
329 | [#include <sys/types.h> | |
330 | #include <dirent.h>], | |
331 | [struct dirent de; de.d_namlen = 0;], | |
332 | [e2fsprogs_cv_struct_d_namlen=yes], | |
333 | [e2fsprogs_cv_struct_d_namlen=no])) | |
334 | AC_MSG_RESULT($e2fsprogs_cv_struct_d_namlen) | |
335 | if test "$e2fsprogs_cv_struct_d_namlen" = yes; then | |
336 | AC_DEFINE(HAVE_DIRENT_NAMLEN) | |
337 | fi | |
338 | dnl | |
b0b9c4de TT |
339 | dnl Check to see if llseek() is declared in unistd.h. On some libc's |
340 | dnl it is, and on others it isn't..... Thank you glibc developers.... | |
341 | dnl | |
342 | dnl Warning! Use of --enable-gcc-wall may throw off this test. | |
343 | dnl | |
344 | dnl | |
345 | AC_MSG_CHECKING(whether llseek declared in unistd.h) | |
346 | AC_CACHE_VAL(e2fsprogs_cv_have_llseek_prototype, | |
347 | AC_TRY_COMPILE( | |
348 | [#include <unistd.h>], [extern int llseek(int);], | |
349 | [e2fsprogs_cv_have_llseek_prototype=no], | |
350 | [e2fsprogs_cv_have_llseek_prototype=yes])) | |
351 | AC_MSG_RESULT($e2fsprogs_cv_have_llseek_prototype) | |
352 | if test "$e2fsprogs_cv_have_llseek_prototype" = yes; then | |
353 | AC_DEFINE(HAVE_LLSEEK_PROTOTYPE) | |
354 | fi | |
355 | dnl | |
50e1e10f TT |
356 | dnl Word sizes... |
357 | dnl | |
358 | if test "$cross_compiling" = yes -a "$ac_cv_sizeof_long" = ""; then | |
359 | # if cross-compiling, with no cached values, just assume something common. | |
360 | ac_cv_sizeof_short=2 | |
361 | ac_cv_sizeof_int=4 | |
362 | ac_cv_sizeof_long=4 | |
fc6d9d51 | 363 | ac_cv_sizeof_long_long=0 |
50e1e10f TT |
364 | AC_MSG_WARN([Cross-compiling, so cannot check type sizes; assuming short=2, int=4, long=4]) |
365 | fi | |
366 | AC_CHECK_SIZEOF(short) | |
367 | AC_CHECK_SIZEOF(int) | |
368 | AC_CHECK_SIZEOF(long) | |
fc6d9d51 | 369 | AC_CHECK_SIZEOF(long long) |
50e1e10f TT |
370 | SIZEOF_SHORT=$ac_cv_sizeof_short |
371 | SIZEOF_INT=$ac_cv_sizeof_int | |
372 | SIZEOF_LONG=$ac_cv_sizeof_long | |
fc6d9d51 | 373 | SIZEOF_LONG_LONG=$ac_cv_sizeof_long_long |
50e1e10f TT |
374 | AC_SUBST(SIZEOF_SHORT) |
375 | AC_SUBST(SIZEOF_INT) | |
376 | AC_SUBST(SIZEOF_LONG) | |
fc6d9d51 | 377 | AC_SUBST(SIZEOF_LONG_LONG) |
50e1e10f TT |
378 | dnl |
379 | dnl See if struct stat has a st_flags field, in which case we can get file | |
380 | dnl flags somewhat portably. Also check for the analogous setter, chflags(). | |
381 | dnl | |
382 | AC_MSG_CHECKING(whether struct stat has a st_flags field) | |
383 | AC_CACHE_VAL(e2fsprogs_cv_struct_st_flags, | |
384 | AC_TRY_COMPILE([#include <sys/stat.h>], | |
385 | [struct stat stat; stat.st_flags = 0;], | |
386 | [e2fsprogs_cv_struct_st_flags=yes], | |
387 | [e2fsprogs_cv_struct_st_flags=no])) | |
388 | AC_MSG_RESULT($e2fsprogs_cv_struct_st_flags) | |
389 | if test "$e2fsprogs_cv_struct_st_flags" = yes; then | |
390 | AC_DEFINE(HAVE_STAT_FLAGS) | |
391 | fi | |
fc6d9d51 TT |
392 | AC_CHECK_FUNCS(chflags getrusage llseek strdup getmntinfo strcasecmp srandom fchown) |
393 | dnl | |
394 | dnl Check to see if ino_t is defined | |
395 | dnl | |
396 | AC_MSG_CHECKING(ino_t defined by sys/types.h) | |
397 | AC_CACHE_VAL(e2fsprogs_cv_ino_t, | |
398 | AC_TRY_COMPILE([#include <sys/types.h>], | |
399 | [ino_t ino; ino = 0;], | |
400 | [e2fsprogs_cv_ino_t=yes], | |
401 | [e2fsprogs_cv_ino_t=no])) | |
402 | AC_MSG_RESULT($e2fsprogs_cv_ino_t) | |
403 | if test "$e2fsprogs_cv_ino_t" = yes; then | |
404 | AC_DEFINE(HAVE_INO_T) | |
405 | fi | |
50e1e10f TT |
406 | dnl |
407 | dnl On systems without linux header files, we add an extra include directory | |
408 | dnl that holds enough to fake it (hopefully). Note that the $(top_srcdir) here | |
409 | dnl is quoted so that it gets expanded by make, not by configure. | |
410 | dnl | |
411 | AC_CHECK_HEADER(linux/fs.h, [linux_headers=yes], [linux_headers=no]) | |
50e1e10f TT |
412 | if test "$linux_headers" = yes; then |
413 | AC_DEFINE(HAVE_LINUX_FS_H) | |
50e1e10f TT |
414 | else |
415 | LINUX_INCLUDE='-I$(top_srcdir)/include -I$(top_builddir)/include' | |
416 | # Use this include directory with test compiles in the configure script too. | |
417 | CPPFLAGS="$CPPFLAGS -I$srcdir/include -I./include" | |
418 | fi | |
419 | AC_SUBST(LINUX_INCLUDE) | |
420 | dnl | |
fc6d9d51 TT |
421 | dnl Check to see if -lsocket is required (solaris) to make something |
422 | dnl that uses socket() to compile; this is needed for the UUID library | |
423 | dnl | |
424 | SOCKET_LIB='' | |
425 | AC_CHECK_LIB(socket, socket, [SOCKET_LIB=-lsocket]) | |
426 | AC_SUBST(SOCKET_LIB) | |
427 | dnl | |
50e1e10f TT |
428 | dnl See if optreset exists |
429 | dnl | |
430 | AC_MSG_CHECKING(for optreset) | |
431 | AC_CACHE_VAL(ac_cv_have_optreset, | |
432 | [AC_EGREP_HEADER(optreset, unistd.h, | |
433 | ac_cv_have_optreset=yes, ac_cv_have_optreset=no)])dnl | |
434 | AC_MSG_RESULT($ac_cv_have_optreset) | |
435 | if test $ac_cv_have_optreset = yes; then | |
436 | AC_DEFINE(HAVE_OPTRESET) | |
437 | fi | |
438 | dnl | |
50e1e10f TT |
439 | dnl See if using the EXT2 ioctls causes a compile-time barf (as on the hurd). |
440 | dnl | |
441 | AC_MSG_CHECKING(whether the ext2 ioctls compile) | |
442 | AC_CACHE_VAL(e2fsprogs_cv_ioctl_ext2, | |
443 | AC_TRY_COMPILE([#include <linux/ext2_fs.h> | |
444 | #include <sys/ioctl.h>], | |
445 | [ioctl (0, EXT2_IOC_SETVERSION, 0);], | |
446 | [e2fsprogs_cv_ioctl_ext2=yes], | |
447 | [e2fsprogs_cv_ioctl_ext2=no])) | |
448 | AC_MSG_RESULT($e2fsprogs_cv_ioctl_ext2) | |
449 | if test "$e2fsprogs_cv_ioctl_ext2" = yes; then | |
450 | AC_DEFINE(HAVE_EXT2_IOCTLS) | |
451 | fi | |
452 | dnl | |
a4b2d3ce | 453 | dnl Linux places root files in the / by default |
50e1e10f | 454 | dnl |
50e1e10f TT |
455 | case "$host_os" in |
456 | linux*) | |
a4b2d3ce TT |
457 | if test "$prefix" = NONE -a "$root_prefix" = NONE ; then |
458 | root_prefix=""; | |
459 | echo "On $host_os systems, root_prefix defaults to ''" | |
fc6d9d51 TT |
460 | fi |
461 | ;; | |
462 | esac | |
fc6d9d51 | 463 | dnl |
a4b2d3ce | 464 | dnl On Linux/hurd, force the prefix to be /usr |
fc6d9d51 TT |
465 | dnl |
466 | case "$host_os" in | |
467 | linux* | gnu*) | |
468 | if test "$prefix" = NONE ; then | |
a4b2d3ce TT |
469 | prefix="/usr"; |
470 | echo "On $host_os systems, prefix defaults to /usr" | |
50e1e10f TT |
471 | fi |
472 | ;; | |
473 | esac | |
a4b2d3ce | 474 | if test "$root_prefix" = NONE ; then |
ffe1991f | 475 | if test "$prefix" = NONE ; then |
a4b2d3ce TT |
476 | root_prefix="$ac_default_prefix" |
477 | else | |
478 | root_prefix="$prefix" | |
479 | fi | |
480 | fi | |
481 | AC_SUBST(root_prefix) | |
50e1e10f TT |
482 | dnl |
483 | dnl See if -static works. | |
50e1e10f | 484 | dnl |
ae851482 TT |
485 | AC_MSG_CHECKING([whether linker accepts -static]) |
486 | AC_CACHE_VAL(ac_cv_e2fsprogs_use_static, | |
487 | [SAVE_LDFLAGS=$LDFLAGS; LDFLAGS="$LDFLAGS -static" | |
488 | AC_TRY_LINK([#include <stdio.h>],[fflush(stdout);], | |
489 | ac_cv_e2fsprogs_use_static=yes, ac_cv_e2fsprogs_use_static=no) | |
490 | LDFLAGS=$SAVE_LDFLAGS]) | |
defde784 TT |
491 | dnl |
492 | dnl Regardless of how the test turns out, Solaris doesn't handle -static | |
493 | dnl This is caused by the socket library requiring the nsl library, which | |
494 | dnl requires the -dl library, which only works for dynamically linked | |
495 | dnl programs. It basically means you can't have statically linked programs | |
496 | dnl which use the network under Solaris. | |
497 | dnl | |
498 | case "$host_os" in | |
499 | solaris2.*) | |
500 | ac_cv_e2fsprogs_use_static=no | |
501 | ;; | |
502 | esac | |
ae851482 | 503 | AC_MSG_RESULT($ac_cv_e2fsprogs_use_static) |
74becf3c | 504 | LDFLAG_STATIC= |
ae851482 | 505 | if test $ac_cv_e2fsprogs_use_static = yes; then |
50e1e10f | 506 | LDFLAG_STATIC=-static |
ae851482 | 507 | fi |
50e1e10f TT |
508 | AC_SUBST(LDFLAG_STATIC) |
509 | dnl | |
50e1e10f TT |
510 | dnl Make the ss and et directories work correctly. |
511 | dnl | |
512 | SS_DIR=`cd ${srcdir}/lib/ss; pwd` | |
513 | ET_DIR=`cd ${srcdir}/lib/et; pwd` | |
514 | AC_SUBST(SS_DIR) | |
515 | AC_SUBST(ET_DIR) | |
516 | dnl | |
517 | dnl Only try to run the test suite if we're not cross compiling. | |
518 | dnl | |
519 | if test "$cross_compiling" = yes ; then | |
520 | DO_TEST_SUITE= | |
521 | else | |
522 | DO_TEST_SUITE=check | |
523 | fi | |
524 | AC_SUBST(DO_TEST_SUITE) | |
525 | dnl | |
a4d09610 TT |
526 | dnl |
527 | dnl | |
528 | DO_SUBSTITUTE_SCRIPT=$srcdir/lib/do_substitute | |
529 | AC_SUBST_FILE(DO_SUBSTITUTE_SCRIPT) | |
530 | dnl | |
50e1e10f TT |
531 | dnl Make our output files, being sure that we create the some miscellaneous |
532 | dnl directories | |
533 | dnl | |
534 | test -d lib || mkdir lib | |
535 | test -d include || mkdir include | |
536 | test -d include/linux || mkdir include/linux | |
defde784 | 537 | test -d include/asm || mkdir include/asm |
24b2c7a7 TT |
538 | rmakefile= |
539 | if test -d ${srcdir}/resize ; then | |
540 | rmakefile=resize/Makefile | |
541 | fi | |
44339bdf | 542 | AC_OUTPUT(MCONFIG Makefile util/Makefile util/subst.conf lib/et/Makefile |
fc6d9d51 TT |
543 | lib/ss/Makefile lib/ext2fs/Makefile lib/e2p/Makefile lib/uuid/Makefile |
544 | misc/Makefile e2fsck/Makefile debugfs/Makefile tests/Makefile | |
24b2c7a7 | 545 | tests/progs/Makefile $rmakefile doc/Makefile) |