blob: 1b1a9f4c668adc16f4c8cf325573b5c27a353acf [file] [log] [blame]
Theodore Ts'o50e1e101997-04-26 13:58:21 +00001AC_INIT(version.h)
Theodore Ts'oa4b2d3c1998-04-03 16:12:25 +00002AC_PREREQ(2.12)
Theodore Ts'o50e1e101997-04-26 13:58:21 +00003MCONFIG=./MCONFIG
4AC_SUBST_FILE(MCONFIG)
Theodore Ts'o74becf31997-04-26 14:37:06 +00005BINARY_TYPE=bin
6dnl
7dnl This is to figure out the version number and the date....
8dnl
9E2FSPROGS_VERSION=`grep E2FSPROGS_VERSION ${srcdir}/version.h \
10 | awk '{print $3}' | tr \" " " | awk '{print $1}'`
11DATE=`grep E2FSPROGS_DATE ${srcdir}/version.h | awk '{print $3}' \
12 | tr \" " "`
13MONTH=`echo $DATE | awk -F- '{print $2}'`
14YEAR=`echo $DATE | awk -F- '{print $3}'`
15
16if expr $YEAR ">" 90 >/dev/null ; then
17 E2FSPROGS_YEAR=19$YEAR
18else
19 E2FSPROGS_YEAR=20$YEAR
20fi
21
22case $MONTH in
23Jan) E2FSPROGS_MONTH="January" ;;
24Feb) E2FSPROGS_MONTH="February" ;;
25Mar) E2FSPROGS_MONTH="March" ;;
26Apr) E2FSPROGS_MONTH="April" ;;
27May) E2FSPROGS_MONTH="May" ;;
28Jun) E2FSPROGS_MONTH="June" ;;
29Jul) E2FSPROGS_MONTH="July" ;;
30Aug) E2FSPROGS_MONTH="August" ;;
31Sep) E2FSPROGS_MONTH="September" ;;
32Oct) E2FSPROGS_MONTH="October" ;;
33Nov) E2FSPROGS_MONTH="November" ;;
34Dec) E2FSPROGS_MONTH="December" ;;
35*) echo "Unknown month $MONTH??" ;;
36esac
37
38unset DATE MONTH YEAR
39echo "Generating configuration file for e2fsprogs version $E2FSPROGS_VERSION"
40echo "Release date is ${E2FSPROGS_MONTH}, ${E2FSPROGS_YEAR}"
41AC_SUBST(E2FSPROGS_YEAR)
42AC_SUBST(E2FSPROGS_MONTH)
43AC_SUBST(E2FSPROGS_VERSION)
Theodore Ts'ofc6d9d51997-04-29 14:51:31 +000044AC_REQUIRE([AC_CANONICAL_HOST])
Theodore Ts'o74becf31997-04-26 14:37:06 +000045dnl
46dnl set $(CC) from --with-cc=value
47dnl
48AC_ARG_WITH([cc],
49[ --with-cc=COMPILER select compiler to use],
50AC_MSG_RESULT(CC=$withval)
51CC=$withval,
52if test -z "$CC" ; then CC=cc; fi
53[AC_MSG_RESULT(CC defaults to $CC)])dnl
54export CC
55AC_SUBST([CC])
56dnl
57dnl set $(LD) from --with-linker=value
58dnl
59AC_ARG_WITH([linker],
60[ --with-linker=LINKER select linker to use],
61AC_MSG_RESULT(LD=$withval)
62LD=$withval,
63if test -z "$LD" ; then LD=$CC; fi
64[AC_MSG_RESULT(LD defaults to $LD)])dnl
65export LD
66AC_SUBST([LD])
67dnl
68dnl set $(CCOPTS) from --with-ccopts=value
69dnl
70AC_ARG_WITH([ccopts],
71[ --with-ccopts=CCOPTS select compiler command line options],
72AC_MSG_RESULT(CCOPTS is $withval)
73CCOPTS=$withval
74CFLAGS="$CFLAGS $withval",
75CCOPTS=)dnl
76AC_SUBST(CCOPTS)
77dnl
Theodore Ts'oa4d09611997-04-29 14:28:00 +000078dnl Set default values for library extentions. Will be dealt with after
79dnl parsing configuration opions, which may modify these
80dnl
81LIB_EXT=.a
82STATIC_LIB_EXT=.a
83PROFILE_LIB_EXT=.a
84dnl
Theodore Ts'o74becf31997-04-26 14:37:06 +000085dnl set $(LDFLAGS) from --with-ldopts=value
86dnl
87AC_ARG_WITH([ldopts],
88[ --with-ldopts=LDOPTS select linker command line options],
89AC_MSG_RESULT(LDFLAGS is $withval)
90LDFLAGS=$withval,
91LDFLAGS=)dnl
92AC_SUBST(LDFLAGS)
Theodore Ts'o50e1e101997-04-26 13:58:21 +000093dnl
Theodore Ts'oa4b2d3c1998-04-03 16:12:25 +000094dnl Allow separate `root_prefix' to be specified
Theodore Ts'ofc6d9d51997-04-29 14:51:31 +000095dnl
Theodore Ts'oa4b2d3c1998-04-03 16:12:25 +000096AC_ARG_WITH([root-prefix],
97[ --with-root-prefix=PREFIX override prefix variable for files to be placed in the root],
98root_prefix=$withval,
99root_prefix=NONE)dnl
Theodore Ts'ofc6d9d51997-04-29 14:51:31 +0000100dnl
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000101dnl handle --enable-dll-shlibs
102dnl
103AC_ARG_ENABLE([dll-shlibs],
Theodore Ts'oa4d09611997-04-29 14:28:00 +0000104[ --enable-dll-shlibs select DLL libraries],
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000105if test "$enableval" = "no"
106then
107 DLL_CMT=#
108 MAKEFILE_DLL=/dev/null
109 echo "Disabling DLL shared libraries"
110else
111 DLL_CMT=
112 MAKEFILE_DLL=$srcdir/lib/Makefile.dll-lib
Theodore Ts'o74becf31997-04-26 14:37:06 +0000113 BINARY_TYPE=dllbin
Theodore Ts'oa4d09611997-04-29 14:28:00 +0000114 LIB_EXT=.sa
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000115 echo "Enabling DLL shared libraries"
116fi
117,
118MAKEFILE_DLL=/dev/null
119DLL_CMT=#
120echo "Disabling DLL shared libraries by default"
121)
122AC_SUBST(DLL_CMT)
123AC_SUBST_FILE(MAKEFILE_DLL)
124dnl
125dnl handle --enable-elf-shlibs
126dnl
127AC_ARG_ENABLE([elf-shlibs],
Theodore Ts'oa4d09611997-04-29 14:28:00 +0000128[ --enable-elf-shlibs select ELF shared libraries],
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000129if test "$enableval" = "no"
130then
131 ELF_CMT=#
132 MAKEFILE_ELF=/dev/null
133 echo "Disabling ELF shared libraries"
134else
135 ELF_CMT=
136 MAKEFILE_ELF=$srcdir/lib/Makefile.elf-lib
Theodore Ts'o74becf31997-04-26 14:37:06 +0000137 BINARY_TYPE=elfbin
Theodore Ts'oa4d09611997-04-29 14:28:00 +0000138 LIB_EXT=.so
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000139 echo "Enabling ELF shared libraries"
140fi
141,
142MAKEFILE_ELF=/dev/null
143ELF_CMT=#
144echo "Disabling ELF shared libraries by default"
145)
146AC_SUBST(ELF_CMT)
147AC_SUBST_FILE(MAKEFILE_ELF)
148dnl
149dnl handle --enable-bsd-shlibs
150dnl
151AC_ARG_ENABLE([bsd-shlibs],
Theodore Ts'oa4d09611997-04-29 14:28:00 +0000152[ --enable-bsd-shlibs select BSD shared libraries],
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000153if test "$enableval" = "no"
154then
155 BSDLIB_CMT=#
156 MAKEFILE_BSDLIB=/dev/null
157 echo "Disabling BSD shared libraries"
158else
159 BSDLIB_CMT=
160 MAKEFILE_BSDLIB=$srcdir/lib/Makefile.bsd-lib
Theodore Ts'oa4d09611997-04-29 14:28:00 +0000161 LIB_EXT=.so
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000162 echo "Enabling BSD shared libraries"
163fi
164,
165MAKEFILE_BSDLIB=/dev/null
166BSDLIB_CMT=#
167echo "Disabling BSD shared libraries by default"
168)
169AC_SUBST(BSDLIB_CMT)
170AC_SUBST_FILE(MAKEFILE_BSDLIB)
171dnl
172dnl handle --enable-profile
173dnl
174AC_ARG_ENABLE([profile],
Theodore Ts'oa4d09611997-04-29 14:28:00 +0000175[ --enable-profile build profiling libraries],
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000176if test "$enableval" = "no"
177then
178 PROFILE_CMT=#
179 MAKEFILE_PROFILE=/dev/null
180 echo "Disabling profiling libraries"
181else
182 PROFILE_CMT=
183 MAKEFILE_PROFILE=$srcdir/lib/Makefile.profile
Theodore Ts'oa4d09611997-04-29 14:28:00 +0000184 PROFILED_LIB_EXT=_p.a
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000185 echo "Building profiling libraries"
186fi
187,
188PROFILE_CMT=#
189MAKEFILE_PROFILE=/dev/null
190echo "Disabling profiling libraries by default"
191)
192AC_SUBST(PROFILE_CMT)
193AC_SUBST_FILE(MAKEFILE_PROFILE)
194dnl
195dnl handle --enable-checker
196dnl
197AC_ARG_ENABLE([checker],
Theodore Ts'oa4d09611997-04-29 14:28:00 +0000198[ --enable-checker build checker libraries],
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000199if test "$enableval" = "no"
200then
201 CHECKER_CMT=#
202 MAKEFILE_CHECKER=/dev/null
203 echo "Disabling checker libraries"
204else
205 CHECKER_CMT=
206 MAKEFILE_CHECKER=$srcdir/lib/Makefile.checker
207 echo "Building checker libraries"
208fi
209,
210CHECKER_CMT=#
211MAKEFILE_CHECKER=/dev/null
212echo "Disabling checker libraries by default"
213)
214AC_SUBST(CHECKER_CMT)
215AC_SUBST_FILE(MAKEFILE_CHECKER)
216dnl
Theodore Ts'oa4d09611997-04-29 14:28:00 +0000217dnl Substitute library extensions
218dnl
219AC_SUBST(LIB_EXT)
220AC_SUBST(STATIC_LIB_EXT)
221AC_SUBST(PROFILED_LIB_EXT)
222dnl
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000223dnl handle --enable-gcc-wall
224dnl
225AC_ARG_ENABLE([gcc-wall],
Theodore Ts'ob0b9c4d1997-10-20 23:36:30 +0000226[ --enable-gcc-wall enable GCC anal warnings (DON'T USE IN PRODUCTION)],
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000227if test "$enableval" = "no"
228then
229 W=#
230 echo "Disabling GCC warnings"
231else
232 W=
233 echo "Enabling GCC warnings"
234fi
235,
236W=#
237echo "Disabling GCC warnings by default"
238)
239AC_SUBST(W)
Theodore Ts'oa4d09611997-04-29 14:28:00 +0000240AC_ARG_ENABLE([dynamic-e2fsck],
241[ --enable-dynamic-e2fsck build e2fsck dynamically],
242if test "$enableval" = "no"
243then
244 E2FSCK_TYPE=static
245 echo "Building e2fsck statically"
246else
247 E2FSCK_TYPE=shared
248 echo "Building e2fsck dynamically"
249fi
250,
251E2FSCK_TYPE=static
252echo "Building e2fsck statically by default"
253)
254AC_SUBST(E2FSCK_TYPE)
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000255dnl
Theodore Ts'ofc6d9d51997-04-29 14:51:31 +0000256dnl See whether to install the `fsck' wrapper program (that calls e2fsck)
257dnl
258AC_ARG_ENABLE([fsck],
259[ --enable-fsck build fsck wrapper program],
260[if test "$enableval" = "no"
261then
262 FSCK_PROG='' FSCK_MAN=''
263 echo "Not building fsck wrapper"
264else
265 FSCK_PROG=fsck FSCK_MAN=fsck.8
266 echo "Building fsck wrapper"
267fi]
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"
277esac]
278)
279AC_SUBST(FSCK_PROG)
280AC_SUBST(FSCK_MAN)
281dnl
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000282dnl
283MAKEFILE_LIBRARY=$srcdir/lib/Makefile.library
284AC_SUBST_FILE(MAKEFILE_LIBRARY)
285dnl
Theodore Ts'ofc6d9d51997-04-29 14:51:31 +0000286dnl
287AC_ARG_ENABLE([old-bitops],
288[ --enable-old-bitops Use old (non-standard but native) bitmask operations],
289if test "$enableval" = "no"
290then
291 echo "Using new (standard) bitmask operations"
292else
293 AC_DEFINE(EXT2_OLD_BITOPS)
294 echo "Using old (native) bitmask operations"
295
296fi
297,
298echo "Using standard bitmask operations by default"
299)
300dnl
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000301dnl End of configuration options
302dnl
Theodore Ts'o74becf31997-04-26 14:37:06 +0000303AC_SUBST(BINARY_TYPE)
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000304AC_PROG_MAKE_SET
305AC_PATH_PROG(LN, ln, ln)
Theodore Ts'ofc6d9d51997-04-29 14:51:31 +0000306AC_PROG_LN_S
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000307AC_PATH_PROG(MV, mv, mv)
308AC_PATH_PROG(CP, cp, cp)
309AC_PATH_PROG(RM, rm, rm)
310AC_PATH_PROG(CHMOD, chmod, :)
311AC_PATH_PROG(AWK, awk, awk)
312AC_PATH_PROG(SED, sed, sed)
313AC_CHECK_TOOL(AR, ar, ar)
314AC_CHECK_TOOL(RANLIB, ranlib, :)
315AC_CHECK_TOOL(STRIP, strip, :)
316AC_PROG_CC
317AC_PROG_INSTALL
318AC_C_CROSS
Theodore Ts'oa9f95f41997-11-10 16:14:16 +0000319AC_CHECK_HEADERS(stdlib.h unistd.h stdarg.h errno.h mntent.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)
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000320AC_FUNC_VPRINTF
321dnl
322dnl See if struct dirent has a d_namlen field (like bsd systems), implying
323dnl that the actual length of the structure may be grater than the declared
324dnl length.
325dnl
326AC_MSG_CHECKING(whether struct dirent has a d_namlen field)
327AC_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]))
334AC_MSG_RESULT($e2fsprogs_cv_struct_d_namlen)
335if test "$e2fsprogs_cv_struct_d_namlen" = yes; then
336 AC_DEFINE(HAVE_DIRENT_NAMLEN)
337fi
338dnl
Theodore Ts'ob0b9c4d1997-10-20 23:36:30 +0000339dnl Check to see if llseek() is declared in unistd.h. On some libc's
340dnl it is, and on others it isn't..... Thank you glibc developers....
341dnl
342dnl Warning! Use of --enable-gcc-wall may throw off this test.
343dnl
344dnl
345AC_MSG_CHECKING(whether llseek declared in unistd.h)
346AC_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]))
351AC_MSG_RESULT($e2fsprogs_cv_have_llseek_prototype)
352if test "$e2fsprogs_cv_have_llseek_prototype" = yes; then
353 AC_DEFINE(HAVE_LLSEEK_PROTOTYPE)
354fi
355dnl
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000356dnl Word sizes...
357dnl
358if 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
Theodore Ts'ofc6d9d51997-04-29 14:51:31 +0000363 ac_cv_sizeof_long_long=0
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000364 AC_MSG_WARN([Cross-compiling, so cannot check type sizes; assuming short=2, int=4, long=4])
365fi
366AC_CHECK_SIZEOF(short)
367AC_CHECK_SIZEOF(int)
368AC_CHECK_SIZEOF(long)
Theodore Ts'ofc6d9d51997-04-29 14:51:31 +0000369AC_CHECK_SIZEOF(long long)
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000370SIZEOF_SHORT=$ac_cv_sizeof_short
371SIZEOF_INT=$ac_cv_sizeof_int
372SIZEOF_LONG=$ac_cv_sizeof_long
Theodore Ts'ofc6d9d51997-04-29 14:51:31 +0000373SIZEOF_LONG_LONG=$ac_cv_sizeof_long_long
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000374AC_SUBST(SIZEOF_SHORT)
375AC_SUBST(SIZEOF_INT)
376AC_SUBST(SIZEOF_LONG)
Theodore Ts'ofc6d9d51997-04-29 14:51:31 +0000377AC_SUBST(SIZEOF_LONG_LONG)
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000378dnl
379dnl See if struct stat has a st_flags field, in which case we can get file
380dnl flags somewhat portably. Also check for the analogous setter, chflags().
381dnl
382AC_MSG_CHECKING(whether struct stat has a st_flags field)
383AC_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]))
388AC_MSG_RESULT($e2fsprogs_cv_struct_st_flags)
389if test "$e2fsprogs_cv_struct_st_flags" = yes; then
390 AC_DEFINE(HAVE_STAT_FLAGS)
391fi
Theodore Ts'ofc6d9d51997-04-29 14:51:31 +0000392AC_CHECK_FUNCS(chflags getrusage llseek strdup getmntinfo strcasecmp srandom fchown)
393dnl
394dnl Check to see if ino_t is defined
395dnl
396AC_MSG_CHECKING(ino_t defined by sys/types.h)
397AC_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]))
402AC_MSG_RESULT($e2fsprogs_cv_ino_t)
403if test "$e2fsprogs_cv_ino_t" = yes; then
404 AC_DEFINE(HAVE_INO_T)
405fi
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000406dnl
407dnl On systems without linux header files, we add an extra include directory
408dnl that holds enough to fake it (hopefully). Note that the $(top_srcdir) here
409dnl is quoted so that it gets expanded by make, not by configure.
410dnl
411AC_CHECK_HEADER(linux/fs.h, [linux_headers=yes], [linux_headers=no])
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000412if test "$linux_headers" = yes; then
413 AC_DEFINE(HAVE_LINUX_FS_H)
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000414else
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"
418fi
419AC_SUBST(LINUX_INCLUDE)
420dnl
Theodore Ts'ofc6d9d51997-04-29 14:51:31 +0000421dnl Check to see if -lsocket is required (solaris) to make something
422dnl that uses socket() to compile; this is needed for the UUID library
423dnl
424SOCKET_LIB=''
425AC_CHECK_LIB(socket, socket, [SOCKET_LIB=-lsocket])
426AC_SUBST(SOCKET_LIB)
427dnl
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000428dnl See if optreset exists
429dnl
430AC_MSG_CHECKING(for optreset)
431AC_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
434AC_MSG_RESULT($ac_cv_have_optreset)
435if test $ac_cv_have_optreset = yes; then
436 AC_DEFINE(HAVE_OPTRESET)
437fi
438dnl
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000439dnl See if using the EXT2 ioctls causes a compile-time barf (as on the hurd).
440dnl
441AC_MSG_CHECKING(whether the ext2 ioctls compile)
442AC_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]))
448AC_MSG_RESULT($e2fsprogs_cv_ioctl_ext2)
449if test "$e2fsprogs_cv_ioctl_ext2" = yes; then
450 AC_DEFINE(HAVE_EXT2_IOCTLS)
451fi
452dnl
Theodore Ts'oa4b2d3c1998-04-03 16:12:25 +0000453dnl Linux places root files in the / by default
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000454dnl
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000455case "$host_os" in
456linux*)
Theodore Ts'oa4b2d3c1998-04-03 16:12:25 +0000457 if test "$prefix" = NONE -a "$root_prefix" = NONE ; then
458 root_prefix="";
459 echo "On $host_os systems, root_prefix defaults to ''"
Theodore Ts'ofc6d9d51997-04-29 14:51:31 +0000460 fi
461 ;;
462esac
Theodore Ts'ofc6d9d51997-04-29 14:51:31 +0000463dnl
Theodore Ts'oa4b2d3c1998-04-03 16:12:25 +0000464dnl On Linux/hurd, force the prefix to be /usr
Theodore Ts'ofc6d9d51997-04-29 14:51:31 +0000465dnl
466case "$host_os" in
467linux* | gnu*)
468 if test "$prefix" = NONE ; then
Theodore Ts'oa4b2d3c1998-04-03 16:12:25 +0000469 prefix="/usr";
470 echo "On $host_os systems, prefix defaults to /usr"
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000471 fi
472;;
473esac
Theodore Ts'oa4b2d3c1998-04-03 16:12:25 +0000474if test "$root_prefix" = NONE ; then
Theodore Ts'offe19911998-04-08 06:05:49 +0000475 if test "$prefix" = NONE ; then
Theodore Ts'oa4b2d3c1998-04-03 16:12:25 +0000476 root_prefix="$ac_default_prefix"
477 else
478 root_prefix="$prefix"
479 fi
480fi
481AC_SUBST(root_prefix)
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000482dnl
483dnl See if -static works.
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000484dnl
Theodore Ts'oae851481997-04-29 18:13:24 +0000485AC_MSG_CHECKING([whether linker accepts -static])
486AC_CACHE_VAL(ac_cv_e2fsprogs_use_static,
487[SAVE_LDFLAGS=$LDFLAGS; LDFLAGS="$LDFLAGS -static"
488AC_TRY_LINK([#include <stdio.h>],[fflush(stdout);],
489 ac_cv_e2fsprogs_use_static=yes, ac_cv_e2fsprogs_use_static=no)
490LDFLAGS=$SAVE_LDFLAGS])
491AC_MSG_RESULT($ac_cv_e2fsprogs_use_static)
Theodore Ts'o74becf31997-04-26 14:37:06 +0000492LDFLAG_STATIC=
Theodore Ts'oae851481997-04-29 18:13:24 +0000493if test $ac_cv_e2fsprogs_use_static = yes; then
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000494 LDFLAG_STATIC=-static
Theodore Ts'oae851481997-04-29 18:13:24 +0000495fi
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000496AC_SUBST(LDFLAG_STATIC)
497dnl
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000498dnl Make the ss and et directories work correctly.
499dnl
500SS_DIR=`cd ${srcdir}/lib/ss; pwd`
501ET_DIR=`cd ${srcdir}/lib/et; pwd`
502AC_SUBST(SS_DIR)
503AC_SUBST(ET_DIR)
504dnl
505dnl Only try to run the test suite if we're not cross compiling.
506dnl
507if test "$cross_compiling" = yes ; then
508 DO_TEST_SUITE=
509else
510 DO_TEST_SUITE=check
511fi
512AC_SUBST(DO_TEST_SUITE)
513dnl
Theodore Ts'oa4d09611997-04-29 14:28:00 +0000514dnl
515dnl
516DO_SUBSTITUTE_SCRIPT=$srcdir/lib/do_substitute
517AC_SUBST_FILE(DO_SUBSTITUTE_SCRIPT)
518dnl
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000519dnl Make our output files, being sure that we create the some miscellaneous
520dnl directories
521dnl
522test -d lib || mkdir lib
523test -d include || mkdir include
524test -d include/linux || mkdir include/linux
Theodore Ts'o24b2c7a1997-06-07 20:42:58 +0000525rmakefile=
526if test -d ${srcdir}/resize ; then
527 rmakefile=resize/Makefile
528fi
Theodore Ts'o44339bd1997-10-15 02:47:20 +0000529AC_OUTPUT(MCONFIG Makefile util/Makefile util/subst.conf lib/et/Makefile
Theodore Ts'ofc6d9d51997-04-29 14:51:31 +0000530 lib/ss/Makefile lib/ext2fs/Makefile lib/e2p/Makefile lib/uuid/Makefile
531 misc/Makefile e2fsck/Makefile debugfs/Makefile tests/Makefile
Theodore Ts'o24b2c7a1997-06-07 20:42:58 +0000532 tests/progs/Makefile $rmakefile doc/Makefile)