Whamcloud - gitweb
Add support for creating and checking 8192-byte blocksize filesystems.
[tools/e2fsprogs.git] / configure.in
1 AC_INIT(version.h)
2 AC_PREREQ(2.12)
3 MCONFIG=./MCONFIG
4 AC_SUBST_FILE(MCONFIG)
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 ">" 1900 > /dev/null ; then
17         E2FSPROGS_YEAR=$YEAR
18 elif expr $YEAR ">" 90 >/dev/null ; then
19         E2FSPROGS_YEAR=19$YEAR
20 else
21         E2FSPROGS_YEAR=20$YEAR
22 fi
23
24 case $MONTH in
25 Jan)    E2FSPROGS_MONTH="January" ;;
26 Feb)    E2FSPROGS_MONTH="February" ;;
27 Mar)    E2FSPROGS_MONTH="March" ;;
28 Apr)    E2FSPROGS_MONTH="April" ;;
29 May)    E2FSPROGS_MONTH="May" ;;
30 Jun)    E2FSPROGS_MONTH="June" ;;
31 Jul)    E2FSPROGS_MONTH="July" ;;
32 Aug)    E2FSPROGS_MONTH="August" ;;
33 Sep)    E2FSPROGS_MONTH="September" ;;
34 Oct)    E2FSPROGS_MONTH="October" ;;
35 Nov)    E2FSPROGS_MONTH="November" ;;
36 Dec)    E2FSPROGS_MONTH="December" ;;
37 *)      echo "Unknown month $MONTH??" ;;
38 esac
39
40 unset DATE MONTH YEAR
41 echo "Generating configuration file for e2fsprogs version $E2FSPROGS_VERSION"
42 echo "Release date is ${E2FSPROGS_MONTH}, ${E2FSPROGS_YEAR}"
43 AC_SUBST(E2FSPROGS_YEAR)
44 AC_SUBST(E2FSPROGS_MONTH)
45 AC_SUBST(E2FSPROGS_VERSION)
46 AC_CANONICAL_HOST
47 dnl
48 dnl set $(CC) from --with-cc=value
49 dnl
50 AC_ARG_WITH([cc],
51 [  --with-cc=COMPILER      select compiler to use],
52 AC_MSG_RESULT(CC=$withval)
53 CC=$withval,
54 if test -z "$CC" ; then CC=cc; fi
55 [AC_MSG_RESULT(CC defaults to $CC)])dnl
56 export CC
57 AC_SUBST([CC])
58 AC_PROG_CC
59 dnl
60 dnl set $(LD) from --with-linker=value
61 dnl
62 AC_ARG_WITH([linker],
63 [  --with-linker=LINKER    select linker to use],
64 AC_MSG_RESULT(LD=$withval)
65 LD=$withval,
66 if test -z "$LD" ; then LD=$CC; fi
67 [AC_MSG_RESULT(LD defaults to $LD)])dnl
68 export LD
69 AC_SUBST([LD])
70 dnl
71 dnl set $(CCOPTS) from --with-ccopts=value
72 dnl
73 AC_ARG_WITH([ccopts],
74 [  --with-ccopts=CCOPTS    select compiler command line options],
75 AC_MSG_RESULT(CCOPTS is $withval)
76 CFLAGS=$withval,
77 )dnl
78 dnl
79 dnl On systems without linux header files, we add an extra include directory
80 dnl that holds enough to fake it (hopefully).  Note that the $(top_srcdir) here
81 dnl is quoted so that it gets expanded by make, not by configure.
82 dnl
83 AC_CHECK_HEADER(linux/fs.h, [linux_headers=yes], [linux_headers=no])
84 if test "$linux_headers" != yes; then
85   LINUX_INCLUDE='-I$(top_builddir)/include'
86 fi
87 AC_SUBST(LINUX_INCLUDE)
88 dnl
89 dnl Set default values for library extentions.  Will be dealt with after
90 dnl parsing configuration opions, which may modify these
91 dnl
92 LIB_EXT=.a
93 STATIC_LIB_EXT=.a
94 PROFILE_LIB_EXT=.a
95 dnl
96 dnl set $(LDFLAGS) from --with-ldopts=value
97 dnl
98 AC_ARG_WITH([ldopts],
99 [  --with-ldopts=LDOPTS    select linker command line options],
100 AC_MSG_RESULT(LDFLAGS is $withval)
101 LDFLAGS=$withval,
102 LDFLAGS=)dnl
103 AC_SUBST(LDFLAGS)
104 dnl
105 dnl Allow separate `root_prefix' to be specified
106 dnl
107 AC_ARG_WITH([root-prefix],
108 [  --with-root-prefix=PREFIX override prefix variable for files to be placed in the root],
109 root_prefix=$withval,
110 root_prefix=NONE)dnl
111 dnl
112 dnl handle --enable-compression
113 dnl
114 AC_ARG_ENABLE([compression],
115 [  --enable-compression   enable EXPERIMENTAL compression support],
116 if test "$enableval" = "no"
117 then
118         echo "Disabling compression support"
119 else
120         AC_DEFINE(ENABLE_COMPRESSION)
121         echo "Enabling compression support"
122         echo "WARNING: Compression support is experimental"
123 fi
124 ,
125 echo "Disabling compression support by default"
126 )
127 dnl
128 dnl handle --enable-dll-shlibs
129 dnl
130 AC_ARG_ENABLE([dll-shlibs],
131 [  --enable-dll-shlibs    select DLL libraries],
132 if test "$enableval" = "no"
133 then
134         DLL_CMT=#
135         MAKEFILE_DLL=/dev/null
136         echo "Disabling DLL shared libraries"
137 else
138         DLL_CMT=
139         MAKEFILE_DLL=$srcdir/lib/Makefile.dll-lib
140         BINARY_TYPE=dllbin
141         LIB_EXT=.sa
142         echo "Enabling DLL shared libraries"
143 fi
144 ,
145 MAKEFILE_DLL=/dev/null
146 DLL_CMT=#
147 echo "Disabling DLL shared libraries by default"
148 )
149 AC_SUBST(DLL_CMT)
150 AC_SUBST_FILE(MAKEFILE_DLL)
151 dnl
152 dnl handle --enable-elf-shlibs
153 dnl
154 AC_ARG_ENABLE([elf-shlibs],
155 [  --enable-elf-shlibs    select ELF shared libraries],
156 if test "$enableval" = "no"
157 then
158         ELF_CMT=#
159         MAKEFILE_ELF=/dev/null
160         echo "Disabling ELF shared libraries"
161 else
162         ELF_CMT=
163         MAKEFILE_ELF=$srcdir/lib/Makefile.elf-lib
164         [case "$host_os" in
165         solaris2.*)
166                 MAKEFILE_ELF=$srcdir/lib/Makefile.solaris-lib
167         ;;
168         esac]
169         BINARY_TYPE=elfbin
170         LIB_EXT=.so
171         echo "Enabling ELF shared libraries"
172 fi
173 ,
174 MAKEFILE_ELF=/dev/null
175 ELF_CMT=#
176 echo "Disabling ELF shared libraries by default"
177 )
178 AC_SUBST(ELF_CMT)
179 AC_SUBST_FILE(MAKEFILE_ELF)
180 dnl
181 dnl handle --enable-bsd-shlibs
182 dnl
183 AC_ARG_ENABLE([bsd-shlibs],
184 [  --enable-bsd-shlibs    select BSD shared libraries],
185 if test "$enableval" = "no"
186 then
187         BSDLIB_CMT=#
188         MAKEFILE_BSDLIB=/dev/null
189         echo "Disabling BSD shared libraries"
190 else
191         BSDLIB_CMT=
192         MAKEFILE_BSDLIB=$srcdir/lib/Makefile.bsd-lib
193         LIB_EXT=.so
194         echo "Enabling BSD shared libraries"
195 fi
196 ,
197 MAKEFILE_BSDLIB=/dev/null
198 BSDLIB_CMT=#
199 echo "Disabling BSD shared libraries by default"
200 )
201 AC_SUBST(BSDLIB_CMT)
202 AC_SUBST_FILE(MAKEFILE_BSDLIB)
203 dnl
204 dnl handle --enable-profile
205 dnl
206 AC_ARG_ENABLE([profile],
207 [  --enable-profile       build profiling libraries],
208 if test "$enableval" = "no"
209 then
210         PROFILE_CMT=#
211         MAKEFILE_PROFILE=/dev/null
212         echo "Disabling profiling libraries"
213 else
214         PROFILE_CMT=
215         MAKEFILE_PROFILE=$srcdir/lib/Makefile.profile
216         PROFILED_LIB_EXT=_p.a
217         echo "Building profiling libraries"
218 fi
219 ,
220 PROFILE_CMT=#
221 MAKEFILE_PROFILE=/dev/null
222 echo "Disabling profiling libraries by default"
223 )
224 AC_SUBST(PROFILE_CMT)
225 AC_SUBST_FILE(MAKEFILE_PROFILE)
226 dnl
227 dnl handle --enable-checker
228 dnl
229 AC_ARG_ENABLE([checker],
230 [  --enable-checker       build checker libraries],
231 if test "$enableval" = "no"
232 then
233         CHECKER_CMT=#
234         MAKEFILE_CHECKER=/dev/null
235         echo "Disabling checker libraries"
236 else
237         CHECKER_CMT=
238         MAKEFILE_CHECKER=$srcdir/lib/Makefile.checker
239         echo "Building checker libraries"
240 fi
241 ,
242 CHECKER_CMT=#
243 MAKEFILE_CHECKER=/dev/null
244 echo "Disabling checker libraries by default"
245 )
246 AC_SUBST(CHECKER_CMT)
247 AC_SUBST_FILE(MAKEFILE_CHECKER)
248 dnl
249 dnl Substitute library extensions
250 dnl
251 AC_SUBST(LIB_EXT)
252 AC_SUBST(STATIC_LIB_EXT)
253 AC_SUBST(PROFILED_LIB_EXT)
254 dnl
255 dnl handle --enable-jfs-debug
256 dnl
257 AC_ARG_ENABLE([jfs-debug],
258 [  --enable-jfs-debug     enable journal debugging],
259 if test "$enableval" = "no"
260 then
261         echo "Disabling journal debugging"
262 else
263         AC_DEFINE(CONFIG_JBD_DEBUG)
264         echo "Enabling journal debugging"
265 fi
266 ,
267 echo "Disabling journal debugging by default"
268 )
269 dnl
270 dnl handle --enable-swapfs
271 dnl
272 AC_ARG_ENABLE([swapfs],
273 [  --disable-swapfs       disable support of legacy byte-swapped filesystems],
274 if test "$enableval" = "no"
275 then
276         echo "Disabling swapfs support"
277 else
278         AC_DEFINE(ENABLE_SWAPFS)
279         echo "Enabling swapfs support"
280 fi
281 ,
282 echo "Enabling swapfs support by default"
283 AC_DEFINE(ENABLE_SWAPFS)
284 )
285 dnl
286 dnl handle --enable-debugfs
287 dnl
288 AC_ARG_ENABLE([debugfs],
289 [  --disable-debugfs      disable support of debugfs program],
290 if test "$enableval" = "no"
291 then
292         echo "Disabling debugfs support"
293         DEBUGFS_CMT="#"
294 else
295         DEBUGFS_CMT=
296         echo "Enabling debugfs support"
297 fi
298 ,
299 echo "Enabling debugfs support by default"
300 DEBUGFS_CMT=
301 )
302 AC_SUBST(DEBUGFS_CMT)
303 dnl
304 dnl handle --enable-imager
305 dnl
306 AC_ARG_ENABLE([imager],
307 [  --disable-imager       disable support of e2image program],
308 if test "$enableval" = "no"
309 then
310         echo "Disabling e2image support"
311         IMAGER_CMT="#"
312 else
313         IMAGER_CMT=
314         echo "Enabling e2image support"
315 fi
316 ,
317 echo "Enabling e2image support by default"
318 IMAGER_CMT=
319 )
320 AC_SUBST(IMAGER_CMT)
321 dnl
322 dnl handle --enable-resizer
323 dnl
324 AC_ARG_ENABLE([resizer],
325 [  --disable-resizer      disable support of e2resize program],
326 if test "$enableval" = "no"
327 then
328         echo "Disabling e2resize support"
329         RESIZER_CMT="#"
330 else
331         RESIZER_CMT=
332         echo "Enabling e2resize support"
333 fi
334 ,
335 echo "Enabling e2resize support by default"
336 RESIZER_CMT=
337 )
338 AC_SUBST(RESIZER_CMT)
339 dnl
340 dnl handle --enable-dynamic-e2fsck
341 dnl
342 AC_ARG_ENABLE([dynamic-e2fsck],
343 [  --enable-dynamic-e2fsck build e2fsck dynamically],
344 if test "$enableval" = "no"
345 then
346         E2FSCK_TYPE=static
347         echo "Building e2fsck statically"
348 else
349         E2FSCK_TYPE=shared
350         echo "Building e2fsck dynamically"
351 fi
352 ,
353 E2FSCK_TYPE=static
354 echo "Building e2fsck statically by default"
355 )
356 AC_SUBST(E2FSCK_TYPE)
357 dnl
358 dnl See whether to install the `fsck' wrapper program (that calls e2fsck)
359 dnl
360 AC_ARG_ENABLE([fsck],
361 [  --enable-fsck           build fsck wrapper program],
362 [if test "$enableval" = "no"
363 then
364         FSCK_PROG='' FSCK_MAN=''
365         echo "Not building fsck wrapper"
366 else
367         FSCK_PROG=fsck FSCK_MAN=fsck.8
368         echo "Building fsck wrapper"
369 fi]
370 ,
371 [case "$host_os" in
372   gnu*)
373     FSCK_PROG='' FSCK_MAN=''
374     echo "Not building fsck wrapper by default"
375     ;;
376   *)
377     FSCK_PROG=fsck FSCK_MAN=fsck.8
378     echo "Building fsck wrapper by default"
379 esac]
380 )
381 AC_SUBST(FSCK_PROG)
382 AC_SUBST(FSCK_MAN)
383 dnl
384 dnl
385 MAKEFILE_LIBRARY=$srcdir/lib/Makefile.library
386 AC_SUBST_FILE(MAKEFILE_LIBRARY)
387 dnl
388 dnl
389 AC_ARG_ENABLE([old-bitops],
390 [  --enable-old-bitops    Use old (non-standard but native) bitmask operations],
391 if test "$enableval" = "no"
392 then
393         echo "Using new (standard) bitmask operations"
394 else
395         AC_DEFINE(EXT2_OLD_BITOPS)
396         echo "Using old (native) bitmask operations"
397
398 fi
399 ,
400 echo "Using standard bitmask operations by default"
401 )
402 dnl
403 dnl Add internationalization support, using gettext.
404 dnl
405 PACKAGE=e2fsprogs
406 VERSION="$E2FSPROGS_VERSION"
407 AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE")
408 AC_DEFINE_UNQUOTED(VERSION, "$VERSION")
409 AC_SUBST(PACKAGE)
410 AC_SUBST(VERSION)
411
412 ALL_LINGUAS="it nyc tr"
413 AM_GNU_GETTEXT
414 dnl
415 dnl End of configuration options
416 dnl
417 AC_SUBST(BINARY_TYPE)
418 AC_PROG_MAKE_SET
419 AC_PATH_PROG(LN, ln, ln)
420 AC_PROG_LN_S
421 AC_PATH_PROG(MV, mv, mv)
422 AC_PATH_PROG(CP, cp, cp)
423 AC_PATH_PROG(RM, rm, rm)
424 AC_PATH_PROG(CHMOD, chmod, :)
425 AC_PATH_PROG(AWK, awk, awk)
426 AC_PATH_PROG(SED, sed, sed)
427 AC_PATH_PROG(PERL, perl, perl)
428 AC_PATH_PROG(LDCONFIG, ldconfig, :)
429 AC_CHECK_TOOL(AR, ar, ar)
430 AC_CHECK_TOOL(RANLIB, ranlib, :)
431 AC_CHECK_TOOL(STRIP, strip, :)
432 AC_PROG_INSTALL
433 # See if we need a separate native compiler.
434 if test $cross_compiling = no; then
435   BUILD_CC="$CC"
436   AC_SUBST(BUILD_CC)
437 else
438   AC_CHECK_PROGS(BUILD_CC, gcc cc)
439 fi
440 AC_CHECK_HEADERS(stdlib.h unistd.h stdarg.h errno.h malloc.h mntent.h paths.h dirent.h getopt.h setjmp.h signal.h termios.h linux/fd.h linux/major.h sys/disklabel.h sys/ioctl.h sys/mkdev.h sys/mount.h sys/sockio.h sys/sysmacros.h sys/time.h sys/stat.h sys/types.h net/if.h netinet/in.h asm/page.h)
441 AC_FUNC_VPRINTF
442 dnl
443 dnl See if struct dirent has a d_namlen field (like bsd systems), implying
444 dnl that the actual length of the structure may be grater than the declared
445 dnl length. 
446 dnl
447 AC_MSG_CHECKING(whether struct dirent has a d_namlen field)
448 AC_CACHE_VAL(e2fsprogs_cv_struct_d_namlen,
449         AC_TRY_COMPILE(
450 [#include <sys/types.h>
451 #include <dirent.h>],
452                 [struct dirent de; de.d_namlen = 0;],
453                 [e2fsprogs_cv_struct_d_namlen=yes],
454                 [e2fsprogs_cv_struct_d_namlen=no]))
455 AC_MSG_RESULT($e2fsprogs_cv_struct_d_namlen)
456 if test "$e2fsprogs_cv_struct_d_namlen" = yes; then
457   AC_DEFINE(HAVE_DIRENT_NAMLEN)
458 fi
459 dnl
460 dnl Check to see if llseek() is declared in unistd.h.  On some libc's 
461 dnl it is, and on others it isn't..... Thank you glibc developers....
462 dnl
463 dnl Warning!  Use of --enable-gcc-wall may throw off this test.
464 dnl
465 dnl
466 AC_MSG_CHECKING(whether llseek declared in unistd.h)
467 AC_CACHE_VAL(e2fsprogs_cv_have_llseek_prototype,
468         AC_TRY_COMPILE(
469 [#include <unistd.h>], [extern int llseek(int);],
470         [e2fsprogs_cv_have_llseek_prototype=no],
471         [e2fsprogs_cv_have_llseek_prototype=yes]))
472 AC_MSG_RESULT($e2fsprogs_cv_have_llseek_prototype)
473 if test "$e2fsprogs_cv_have_llseek_prototype" = yes; then
474    AC_DEFINE(HAVE_LLSEEK_PROTOTYPE)
475 fi
476 dnl
477 dnl Check to see if lseek64() is declared in unistd.h.  Glibc's header files
478 dnl are so convoluted that I can't tell whether it will always be defined,
479 dnl and if it isn't defined while lseek64 is defined in the library, 
480 dnl disaster will strike.  
481 dnl
482 dnl Warning!  Use of --enable-gcc-wall may throw off this test.
483 dnl
484 dnl
485 AC_MSG_CHECKING(whether lseek64 declared in unistd.h)
486 AC_CACHE_VAL(e2fsprogs_cv_have_lseek64_prototype,
487         AC_TRY_COMPILE(
488 [#define _LARGEFILE_SOURCE
489 #define _LARGEFILE64_SOURCE
490 #include <unistd.h>], [extern int lseek64(int);],
491         [e2fsprogs_cv_have_lseek64_prototype=no],
492         [e2fsprogs_cv_have_lseek64_prototype=yes]))
493 AC_MSG_RESULT($e2fsprogs_cv_have_lseek64_prototype)
494 if test "$e2fsprogs_cv_have_lseek64_prototype" = yes; then
495    AC_DEFINE(HAVE_LSEEK64_PROTOTYPE)
496 fi
497 dnl
498 dnl Word sizes...
499 dnl
500 if test "$cross_compiling" = yes -a "$ac_cv_sizeof_long" = ""; then
501   # if cross-compiling, with no cached values, just assume something common. 
502   ac_cv_sizeof_short=2
503   ac_cv_sizeof_int=4
504   ac_cv_sizeof_long=4
505   ac_cv_sizeof_long_long=8
506   AC_MSG_WARN([Cross-compiling, so cannot check type sizes; assuming short=2, int=4, long=4, long long=8])
507 fi
508 AC_CHECK_SIZEOF(short)
509 AC_CHECK_SIZEOF(int)
510 AC_CHECK_SIZEOF(long)
511 AC_CHECK_SIZEOF(long long)
512 SIZEOF_SHORT=$ac_cv_sizeof_short
513 SIZEOF_INT=$ac_cv_sizeof_int
514 SIZEOF_LONG=$ac_cv_sizeof_long
515 SIZEOF_LONG_LONG=$ac_cv_sizeof_long_long
516 AC_SUBST(SIZEOF_SHORT)
517 AC_SUBST(SIZEOF_INT)
518 AC_SUBST(SIZEOF_LONG)
519 AC_SUBST(SIZEOF_LONG_LONG)
520 AC_C_BIGENDIAN
521 dnl
522 dnl See if struct stat has a st_flags field, in which case we can get file
523 dnl flags somewhat portably.  Also check for the analogous setter, chflags().
524 dnl
525 AC_MSG_CHECKING(whether struct stat has a st_flags field)
526 AC_CACHE_VAL(e2fsprogs_cv_struct_st_flags,
527         AC_TRY_COMPILE([#include <sys/stat.h>],
528                 [struct stat stat; stat.st_flags = 0;],
529                 [e2fsprogs_cv_struct_st_flags=yes],
530                 [e2fsprogs_cv_struct_st_flags=no]))
531 AC_MSG_RESULT($e2fsprogs_cv_struct_st_flags)
532 if test "$e2fsprogs_cv_struct_st_flags" = yes; then
533   AC_MSG_CHECKING(whether st_flags field is useful)
534   AC_CACHE_VAL(e2fsprogs_cv_struct_st_flags_immut,
535         AC_TRY_COMPILE([#include <sys/stat.h>],
536                 [struct stat stat; stat.st_flags |= UF_IMMUTABLE;],
537                 [e2fsprogs_cv_struct_st_flags_immut=yes],
538                 [e2fsprogs_cv_struct_st_flags_immut=no]))
539   AC_MSG_RESULT($e2fsprogs_cv_struct_st_flags_immut)
540   if test "$e2fsprogs_cv_struct_st_flags_immut" = yes; then
541           AC_DEFINE(HAVE_STAT_FLAGS)
542   fi
543 fi
544 AC_CHECK_FUNCS(chflags getrusage llseek lseek64 open64 getmntinfo strcasecmp srandom fchown mallinfo fdatasync strnlen)
545 dnl
546 dnl Check to see if -lsocket is required (solaris) to make something
547 dnl that uses socket() to compile; this is needed for the UUID library
548 dnl
549 SOCKET_LIB=''
550 AC_CHECK_LIB(socket, socket, [SOCKET_LIB=-lsocket])
551 AC_SUBST(SOCKET_LIB)
552 dnl
553 dnl See if optreset exists
554 dnl
555 AC_MSG_CHECKING(for optreset)
556 AC_CACHE_VAL(ac_cv_have_optreset,
557 [AC_EGREP_HEADER(optreset, unistd.h,
558   ac_cv_have_optreset=yes, ac_cv_have_optreset=no)])dnl
559 AC_MSG_RESULT($ac_cv_have_optreset)
560 if test $ac_cv_have_optreset = yes; then
561   AC_DEFINE(HAVE_OPTRESET)
562 fi
563 dnl
564 dnl We use the EXT2 ioctls only under Linux
565 dnl
566 case "$host_os" in
567 linux*)
568         AC_DEFINE(HAVE_EXT2_IOCTLS)
569         ;;
570 esac
571 dnl
572 dnl Linux and Hurd places root files in the / by default
573 dnl
574 case "$host_os" in
575 linux* | gnu*)
576         if test "$prefix" = NONE -a "$root_prefix" = NONE ; then
577                 root_prefix="";
578                 echo "On $host_os systems, root_prefix defaults to ''"
579         fi
580         ;;
581 esac
582 dnl
583 dnl On Linux/hurd, force the prefix to be /usr
584 dnl
585 case "$host_os" in
586 linux* | gnu*)
587         if test "$prefix" = NONE ; then
588                 prefix="/usr";
589                 echo "On $host_os systems, prefix defaults to /usr"
590         fi
591 ;;
592 esac
593 if test "$root_prefix" = NONE ; then
594         if test "$prefix" = NONE ; then
595                 root_prefix="$ac_default_prefix"
596         else
597                 root_prefix="$prefix"
598         fi
599         root_bindir=$bindir
600         root_sbindir=$sbindir
601         root_libdir=$libdir
602         root_sysconfdir=$sysconfdir
603 else
604         root_bindir='${root_prefix}/bin'
605         root_sbindir='${root_prefix}/sbin'
606         root_libdir='${root_prefix}/lib'
607         root_sysconfdir='${root_prefix}/etc'
608 fi
609 AC_SUBST(root_prefix)
610 AC_SUBST(root_bindir)
611 AC_SUBST(root_sbindir)
612 AC_SUBST(root_libdir)
613 AC_SUBST(root_sysconfdir)
614 dnl
615 dnl See if -static works.
616 dnl
617 AC_MSG_CHECKING([whether linker accepts -static])
618 AC_CACHE_VAL(ac_cv_e2fsprogs_use_static,
619 [SAVE_LDFLAGS=$LDFLAGS; LDFLAGS="$LDFLAGS -static"
620 AC_TRY_LINK([#include <stdio.h>],[fflush(stdout);],
621  ac_cv_e2fsprogs_use_static=yes, ac_cv_e2fsprogs_use_static=no)
622 LDFLAGS=$SAVE_LDFLAGS])
623 dnl
624 dnl Regardless of how the test turns out, Solaris doesn't handle -static
625 dnl This is caused by the socket library requiring the nsl library, which
626 dnl requires the -dl library, which only works for dynamically linked 
627 dnl programs.  It basically means you can't have statically linked programs
628 dnl which use the network under Solaris.  
629 dnl
630 case "$host_os" in
631 solaris2.*)
632         ac_cv_e2fsprogs_use_static=no   
633 ;;
634 esac
635 AC_MSG_RESULT($ac_cv_e2fsprogs_use_static)
636 LDFLAG_STATIC=
637 if test $ac_cv_e2fsprogs_use_static = yes; then
638         LDFLAG_STATIC=-static
639 fi
640 AC_SUBST(LDFLAG_STATIC)
641 dnl
642 dnl Make the ss and et directories work correctly.
643 dnl
644 SS_DIR=`cd ${srcdir}/lib/ss; pwd`
645 ET_DIR=`cd ${srcdir}/lib/et; pwd`
646 AC_SUBST(SS_DIR)
647 AC_SUBST(ET_DIR)
648 dnl
649 dnl Only try to run the test suite if we're not cross compiling.
650 dnl
651 if test "$cross_compiling" = yes ; then
652   DO_TEST_SUITE=
653 else
654   DO_TEST_SUITE=check
655 fi
656 AC_SUBST(DO_TEST_SUITE)
657 dnl
658 dnl Make our output files, being sure that we create the some miscellaneous 
659 dnl directories
660 dnl
661 test -d lib || mkdir lib
662 test -d include || mkdir include
663 test -d include/linux || mkdir include/linux
664 test -d include/asm || mkdir include/asm
665 rmakefile=
666 if test -d ${srcdir}/resize ; then
667    rmakefile=resize/Makefile
668 fi
669 AC_OUTPUT(MCONFIG Makefile util/Makefile util/subst.conf lib/et/Makefile 
670         lib/ss/Makefile lib/ext2fs/Makefile lib/e2p/Makefile lib/uuid/Makefile
671         misc/Makefile ext2ed/Makefile e2fsck/Makefile debugfs/Makefile \
672         tests/Makefile tests/progs/Makefile $rmakefile doc/Makefile 
673         intl/Makefile po/Makefile.in)