blob: 8b86b5dad5b6807e0985802bd39c9d3dbde54f65 [file] [log] [blame]
Theodore Ts'o50e1e101997-04-26 13:58:21 +00001AC_INIT(version.h)
2MCONFIG=./MCONFIG
3AC_SUBST_FILE(MCONFIG)
Theodore Ts'o74becf31997-04-26 14:37:06 +00004BINARY_TYPE=bin
5dnl
6dnl This is to figure out the version number and the date....
7dnl
8E2FSPROGS_VERSION=`grep E2FSPROGS_VERSION ${srcdir}/version.h \
9 | awk '{print $3}' | tr \" " " | awk '{print $1}'`
10DATE=`grep E2FSPROGS_DATE ${srcdir}/version.h | awk '{print $3}' \
11 | tr \" " "`
12MONTH=`echo $DATE | awk -F- '{print $2}'`
13YEAR=`echo $DATE | awk -F- '{print $3}'`
14
15if expr $YEAR ">" 90 >/dev/null ; then
16 E2FSPROGS_YEAR=19$YEAR
17else
18 E2FSPROGS_YEAR=20$YEAR
19fi
20
21case $MONTH in
22Jan) E2FSPROGS_MONTH="January" ;;
23Feb) E2FSPROGS_MONTH="February" ;;
24Mar) E2FSPROGS_MONTH="March" ;;
25Apr) E2FSPROGS_MONTH="April" ;;
26May) E2FSPROGS_MONTH="May" ;;
27Jun) E2FSPROGS_MONTH="June" ;;
28Jul) E2FSPROGS_MONTH="July" ;;
29Aug) E2FSPROGS_MONTH="August" ;;
30Sep) E2FSPROGS_MONTH="September" ;;
31Oct) E2FSPROGS_MONTH="October" ;;
32Nov) E2FSPROGS_MONTH="November" ;;
33Dec) E2FSPROGS_MONTH="December" ;;
34*) echo "Unknown month $MONTH??" ;;
35esac
36
37unset DATE MONTH YEAR
38echo "Generating configuration file for e2fsprogs version $E2FSPROGS_VERSION"
39echo "Release date is ${E2FSPROGS_MONTH}, ${E2FSPROGS_YEAR}"
40AC_SUBST(E2FSPROGS_YEAR)
41AC_SUBST(E2FSPROGS_MONTH)
42AC_SUBST(E2FSPROGS_VERSION)
Theodore Ts'ofc6d9d51997-04-29 14:51:31 +000043AC_REQUIRE([AC_CANONICAL_HOST])
Theodore Ts'o74becf31997-04-26 14:37:06 +000044dnl
45dnl set $(CC) from --with-cc=value
46dnl
47AC_ARG_WITH([cc],
48[ --with-cc=COMPILER select compiler to use],
49AC_MSG_RESULT(CC=$withval)
50CC=$withval,
51if test -z "$CC" ; then CC=cc; fi
52[AC_MSG_RESULT(CC defaults to $CC)])dnl
53export CC
54AC_SUBST([CC])
55dnl
56dnl set $(LD) from --with-linker=value
57dnl
58AC_ARG_WITH([linker],
59[ --with-linker=LINKER select linker to use],
60AC_MSG_RESULT(LD=$withval)
61LD=$withval,
62if test -z "$LD" ; then LD=$CC; fi
63[AC_MSG_RESULT(LD defaults to $LD)])dnl
64export LD
65AC_SUBST([LD])
66dnl
67dnl set $(CCOPTS) from --with-ccopts=value
68dnl
69AC_ARG_WITH([ccopts],
70[ --with-ccopts=CCOPTS select compiler command line options],
71AC_MSG_RESULT(CCOPTS is $withval)
72CCOPTS=$withval
73CFLAGS="$CFLAGS $withval",
74CCOPTS=)dnl
75AC_SUBST(CCOPTS)
76dnl
Theodore Ts'oa4d09611997-04-29 14:28:00 +000077dnl Set default values for library extentions. Will be dealt with after
78dnl parsing configuration opions, which may modify these
79dnl
80LIB_EXT=.a
81STATIC_LIB_EXT=.a
82PROFILE_LIB_EXT=.a
83dnl
Theodore Ts'o74becf31997-04-26 14:37:06 +000084dnl set $(LDFLAGS) from --with-ldopts=value
85dnl
86AC_ARG_WITH([ldopts],
87[ --with-ldopts=LDOPTS select linker command line options],
88AC_MSG_RESULT(LDFLAGS is $withval)
89LDFLAGS=$withval,
90LDFLAGS=)dnl
91AC_SUBST(LDFLAGS)
Theodore Ts'o50e1e101997-04-26 13:58:21 +000092dnl
Theodore Ts'ofc6d9d51997-04-29 14:51:31 +000093dnl Allow separate `usr_prefix' to be specified
94dnl
95AC_ARG_WITH([usr-prefix],
96[ --with-usr-prefx=PREFIX specify a prefix corresponding to /usr (default ${prefix})],
97usr_prefix=$withval,
98usr_prefix=NONE)dnl
99dnl
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000100dnl handle --enable-dll-shlibs
101dnl
102AC_ARG_ENABLE([dll-shlibs],
Theodore Ts'oa4d09611997-04-29 14:28:00 +0000103[ --enable-dll-shlibs select DLL libraries],
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000104if test "$enableval" = "no"
105then
106 DLL_CMT=#
107 MAKEFILE_DLL=/dev/null
108 echo "Disabling DLL shared libraries"
109else
110 DLL_CMT=
111 MAKEFILE_DLL=$srcdir/lib/Makefile.dll-lib
Theodore Ts'o74becf31997-04-26 14:37:06 +0000112 BINARY_TYPE=dllbin
Theodore Ts'oa4d09611997-04-29 14:28:00 +0000113 LIB_EXT=.sa
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000114 echo "Enabling DLL shared libraries"
115fi
116,
117MAKEFILE_DLL=/dev/null
118DLL_CMT=#
119echo "Disabling DLL shared libraries by default"
120)
121AC_SUBST(DLL_CMT)
122AC_SUBST_FILE(MAKEFILE_DLL)
123dnl
124dnl handle --enable-elf-shlibs
125dnl
126AC_ARG_ENABLE([elf-shlibs],
Theodore Ts'oa4d09611997-04-29 14:28:00 +0000127[ --enable-elf-shlibs select ELF shared libraries],
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000128if test "$enableval" = "no"
129then
130 ELF_CMT=#
131 MAKEFILE_ELF=/dev/null
132 echo "Disabling ELF shared libraries"
133else
134 ELF_CMT=
135 MAKEFILE_ELF=$srcdir/lib/Makefile.elf-lib
Theodore Ts'o74becf31997-04-26 14:37:06 +0000136 BINARY_TYPE=elfbin
Theodore Ts'oa4d09611997-04-29 14:28:00 +0000137 LIB_EXT=.so
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000138 echo "Enabling ELF shared libraries"
139fi
140,
141MAKEFILE_ELF=/dev/null
142ELF_CMT=#
143echo "Disabling ELF shared libraries by default"
144)
145AC_SUBST(ELF_CMT)
146AC_SUBST_FILE(MAKEFILE_ELF)
147dnl
148dnl handle --enable-bsd-shlibs
149dnl
150AC_ARG_ENABLE([bsd-shlibs],
Theodore Ts'oa4d09611997-04-29 14:28:00 +0000151[ --enable-bsd-shlibs select BSD shared libraries],
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000152if test "$enableval" = "no"
153then
154 BSDLIB_CMT=#
155 MAKEFILE_BSDLIB=/dev/null
156 echo "Disabling BSD shared libraries"
157else
158 BSDLIB_CMT=
159 MAKEFILE_BSDLIB=$srcdir/lib/Makefile.bsd-lib
Theodore Ts'oa4d09611997-04-29 14:28:00 +0000160 LIB_EXT=.so
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000161 echo "Enabling BSD shared libraries"
162fi
163,
164MAKEFILE_BSDLIB=/dev/null
165BSDLIB_CMT=#
166echo "Disabling BSD shared libraries by default"
167)
168AC_SUBST(BSDLIB_CMT)
169AC_SUBST_FILE(MAKEFILE_BSDLIB)
170dnl
171dnl handle --enable-profile
172dnl
173AC_ARG_ENABLE([profile],
Theodore Ts'oa4d09611997-04-29 14:28:00 +0000174[ --enable-profile build profiling libraries],
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000175if test "$enableval" = "no"
176then
177 PROFILE_CMT=#
178 MAKEFILE_PROFILE=/dev/null
179 echo "Disabling profiling libraries"
180else
181 PROFILE_CMT=
182 MAKEFILE_PROFILE=$srcdir/lib/Makefile.profile
Theodore Ts'oa4d09611997-04-29 14:28:00 +0000183 PROFILED_LIB_EXT=_p.a
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000184 echo "Building profiling libraries"
185fi
186,
187PROFILE_CMT=#
188MAKEFILE_PROFILE=/dev/null
189echo "Disabling profiling libraries by default"
190)
191AC_SUBST(PROFILE_CMT)
192AC_SUBST_FILE(MAKEFILE_PROFILE)
193dnl
194dnl handle --enable-checker
195dnl
196AC_ARG_ENABLE([checker],
Theodore Ts'oa4d09611997-04-29 14:28:00 +0000197[ --enable-checker build checker libraries],
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000198if test "$enableval" = "no"
199then
200 CHECKER_CMT=#
201 MAKEFILE_CHECKER=/dev/null
202 echo "Disabling checker libraries"
203else
204 CHECKER_CMT=
205 MAKEFILE_CHECKER=$srcdir/lib/Makefile.checker
206 echo "Building checker libraries"
207fi
208,
209CHECKER_CMT=#
210MAKEFILE_CHECKER=/dev/null
211echo "Disabling checker libraries by default"
212)
213AC_SUBST(CHECKER_CMT)
214AC_SUBST_FILE(MAKEFILE_CHECKER)
215dnl
Theodore Ts'oa4d09611997-04-29 14:28:00 +0000216dnl Substitute library extensions
217dnl
218AC_SUBST(LIB_EXT)
219AC_SUBST(STATIC_LIB_EXT)
220AC_SUBST(PROFILED_LIB_EXT)
221dnl
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000222dnl handle --enable-gcc-wall
223dnl
224AC_ARG_ENABLE([gcc-wall],
Theodore Ts'ob0b9c4d1997-10-20 23:36:30 +0000225[ --enable-gcc-wall enable GCC anal warnings (DON'T USE IN PRODUCTION)],
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000226if test "$enableval" = "no"
227then
228 W=#
229 echo "Disabling GCC warnings"
230else
231 W=
232 echo "Enabling GCC warnings"
233fi
234,
235W=#
236echo "Disabling GCC warnings by default"
237)
238AC_SUBST(W)
Theodore Ts'oa4d09611997-04-29 14:28:00 +0000239AC_ARG_ENABLE([dynamic-e2fsck],
240[ --enable-dynamic-e2fsck build e2fsck dynamically],
241if test "$enableval" = "no"
242then
243 E2FSCK_TYPE=static
244 echo "Building e2fsck statically"
245else
246 E2FSCK_TYPE=shared
247 echo "Building e2fsck dynamically"
248fi
249,
250E2FSCK_TYPE=static
251echo "Building e2fsck statically by default"
252)
253AC_SUBST(E2FSCK_TYPE)
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000254dnl
Theodore Ts'ofc6d9d51997-04-29 14:51:31 +0000255dnl See whether to install the `fsck' wrapper program (that calls e2fsck)
256dnl
257AC_ARG_ENABLE([fsck],
258[ --enable-fsck build fsck wrapper program],
259[if test "$enableval" = "no"
260then
261 FSCK_PROG='' FSCK_MAN=''
262 echo "Not building fsck wrapper"
263else
264 FSCK_PROG=fsck FSCK_MAN=fsck.8
265 echo "Building fsck wrapper"
266fi]
267,
268[case "$host_os" in
269 gnu*)
270 FSCK_PROG='' FSCK_MAN=''
271 echo "Not building fsck wrapper by default"
272 ;;
273 *)
274 FSCK_PROG=fsck FSCK_MAN=fsck.8
275 echo "Building fsck wrapper by default"
276esac]
277)
278AC_SUBST(FSCK_PROG)
279AC_SUBST(FSCK_MAN)
280dnl
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000281dnl
282MAKEFILE_LIBRARY=$srcdir/lib/Makefile.library
283AC_SUBST_FILE(MAKEFILE_LIBRARY)
284dnl
Theodore Ts'ofc6d9d51997-04-29 14:51:31 +0000285dnl
286AC_ARG_ENABLE([old-bitops],
287[ --enable-old-bitops Use old (non-standard but native) bitmask operations],
288if test "$enableval" = "no"
289then
290 echo "Using new (standard) bitmask operations"
291else
292 AC_DEFINE(EXT2_OLD_BITOPS)
293 echo "Using old (native) bitmask operations"
294
295fi
296,
297echo "Using standard bitmask operations by default"
298)
299dnl
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000300dnl End of configuration options
301dnl
Theodore Ts'o74becf31997-04-26 14:37:06 +0000302AC_SUBST(BINARY_TYPE)
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000303AC_PROG_MAKE_SET
304AC_PATH_PROG(LN, ln, ln)
Theodore Ts'ofc6d9d51997-04-29 14:51:31 +0000305AC_PROG_LN_S
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000306AC_PATH_PROG(MV, mv, mv)
307AC_PATH_PROG(CP, cp, cp)
308AC_PATH_PROG(RM, rm, rm)
309AC_PATH_PROG(CHMOD, chmod, :)
310AC_PATH_PROG(AWK, awk, awk)
311AC_PATH_PROG(SED, sed, sed)
312AC_CHECK_TOOL(AR, ar, ar)
313AC_CHECK_TOOL(RANLIB, ranlib, :)
314AC_CHECK_TOOL(STRIP, strip, :)
315AC_PROG_CC
316AC_PROG_INSTALL
317AC_C_CROSS
Theodore Ts'oaa1e55e1997-10-19 23:13:26 +0000318AC_CHECK_HEADERS(stdlib.h unistd.h stdarg.h errno.h mntent.h dirent.h getopt.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 +0000319AC_FUNC_VPRINTF
320dnl
321dnl See if struct dirent has a d_namlen field (like bsd systems), implying
322dnl that the actual length of the structure may be grater than the declared
323dnl length.
324dnl
325AC_MSG_CHECKING(whether struct dirent has a d_namlen field)
326AC_CACHE_VAL(e2fsprogs_cv_struct_d_namlen,
327 AC_TRY_COMPILE(
328[#include <sys/types.h>
329#include <dirent.h>],
330 [struct dirent de; de.d_namlen = 0;],
331 [e2fsprogs_cv_struct_d_namlen=yes],
332 [e2fsprogs_cv_struct_d_namlen=no]))
333AC_MSG_RESULT($e2fsprogs_cv_struct_d_namlen)
334if test "$e2fsprogs_cv_struct_d_namlen" = yes; then
335 AC_DEFINE(HAVE_DIRENT_NAMLEN)
336fi
337dnl
Theodore Ts'ob0b9c4d1997-10-20 23:36:30 +0000338dnl Check to see if llseek() is declared in unistd.h. On some libc's
339dnl it is, and on others it isn't..... Thank you glibc developers....
340dnl
341dnl Warning! Use of --enable-gcc-wall may throw off this test.
342dnl
343dnl
344AC_MSG_CHECKING(whether llseek declared in unistd.h)
345AC_CACHE_VAL(e2fsprogs_cv_have_llseek_prototype,
346 AC_TRY_COMPILE(
347[#include <unistd.h>], [extern int llseek(int);],
348 [e2fsprogs_cv_have_llseek_prototype=no],
349 [e2fsprogs_cv_have_llseek_prototype=yes]))
350AC_MSG_RESULT($e2fsprogs_cv_have_llseek_prototype)
351if test "$e2fsprogs_cv_have_llseek_prototype" = yes; then
352 AC_DEFINE(HAVE_LLSEEK_PROTOTYPE)
353fi
354dnl
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000355dnl Word sizes...
356dnl
357if test "$cross_compiling" = yes -a "$ac_cv_sizeof_long" = ""; then
358 # if cross-compiling, with no cached values, just assume something common.
359 ac_cv_sizeof_short=2
360 ac_cv_sizeof_int=4
361 ac_cv_sizeof_long=4
Theodore Ts'ofc6d9d51997-04-29 14:51:31 +0000362 ac_cv_sizeof_long_long=0
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000363 AC_MSG_WARN([Cross-compiling, so cannot check type sizes; assuming short=2, int=4, long=4])
364fi
365AC_CHECK_SIZEOF(short)
366AC_CHECK_SIZEOF(int)
367AC_CHECK_SIZEOF(long)
Theodore Ts'ofc6d9d51997-04-29 14:51:31 +0000368AC_CHECK_SIZEOF(long long)
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000369SIZEOF_SHORT=$ac_cv_sizeof_short
370SIZEOF_INT=$ac_cv_sizeof_int
371SIZEOF_LONG=$ac_cv_sizeof_long
Theodore Ts'ofc6d9d51997-04-29 14:51:31 +0000372SIZEOF_LONG_LONG=$ac_cv_sizeof_long_long
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000373AC_SUBST(SIZEOF_SHORT)
374AC_SUBST(SIZEOF_INT)
375AC_SUBST(SIZEOF_LONG)
Theodore Ts'ofc6d9d51997-04-29 14:51:31 +0000376AC_SUBST(SIZEOF_LONG_LONG)
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000377dnl
378dnl See if struct stat has a st_flags field, in which case we can get file
379dnl flags somewhat portably. Also check for the analogous setter, chflags().
380dnl
381AC_MSG_CHECKING(whether struct stat has a st_flags field)
382AC_CACHE_VAL(e2fsprogs_cv_struct_st_flags,
383 AC_TRY_COMPILE([#include <sys/stat.h>],
384 [struct stat stat; stat.st_flags = 0;],
385 [e2fsprogs_cv_struct_st_flags=yes],
386 [e2fsprogs_cv_struct_st_flags=no]))
387AC_MSG_RESULT($e2fsprogs_cv_struct_st_flags)
388if test "$e2fsprogs_cv_struct_st_flags" = yes; then
389 AC_DEFINE(HAVE_STAT_FLAGS)
390fi
Theodore Ts'ofc6d9d51997-04-29 14:51:31 +0000391AC_CHECK_FUNCS(chflags getrusage llseek strdup getmntinfo strcasecmp srandom fchown)
392dnl
393dnl Check to see if ino_t is defined
394dnl
395AC_MSG_CHECKING(ino_t defined by sys/types.h)
396AC_CACHE_VAL(e2fsprogs_cv_ino_t,
397 AC_TRY_COMPILE([#include <sys/types.h>],
398 [ino_t ino; ino = 0;],
399 [e2fsprogs_cv_ino_t=yes],
400 [e2fsprogs_cv_ino_t=no]))
401AC_MSG_RESULT($e2fsprogs_cv_ino_t)
402if test "$e2fsprogs_cv_ino_t" = yes; then
403 AC_DEFINE(HAVE_INO_T)
404fi
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000405dnl
406dnl On systems without linux header files, we add an extra include directory
407dnl that holds enough to fake it (hopefully). Note that the $(top_srcdir) here
408dnl is quoted so that it gets expanded by make, not by configure.
409dnl
410AC_CHECK_HEADER(linux/fs.h, [linux_headers=yes], [linux_headers=no])
411AC_SUBST(EXTRA_PROGS)
412if test "$linux_headers" = yes; then
413 AC_DEFINE(HAVE_LINUX_FS_H)
414 # These are some programs that depend on having linux headers around, and
415 # won't work otherwise. So we only compile them if we can.
416 EXTRA_PROGS="$EXTRA_PROGS flushb"
417else
418 LINUX_INCLUDE='-I$(top_srcdir)/include -I$(top_builddir)/include'
419 # Use this include directory with test compiles in the configure script too.
420 CPPFLAGS="$CPPFLAGS -I$srcdir/include -I./include"
421fi
422AC_SUBST(LINUX_INCLUDE)
423dnl
Theodore Ts'ofc6d9d51997-04-29 14:51:31 +0000424dnl Check to see if -lsocket is required (solaris) to make something
425dnl that uses socket() to compile; this is needed for the UUID library
426dnl
427SOCKET_LIB=''
428AC_CHECK_LIB(socket, socket, [SOCKET_LIB=-lsocket])
429AC_SUBST(SOCKET_LIB)
430dnl
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000431dnl See if optreset exists
432dnl
433AC_MSG_CHECKING(for optreset)
434AC_CACHE_VAL(ac_cv_have_optreset,
435[AC_EGREP_HEADER(optreset, unistd.h,
436 ac_cv_have_optreset=yes, ac_cv_have_optreset=no)])dnl
437AC_MSG_RESULT($ac_cv_have_optreset)
438if test $ac_cv_have_optreset = yes; then
439 AC_DEFINE(HAVE_OPTRESET)
440fi
441dnl
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000442dnl See if using the EXT2 ioctls causes a compile-time barf (as on the hurd).
443dnl
444AC_MSG_CHECKING(whether the ext2 ioctls compile)
445AC_CACHE_VAL(e2fsprogs_cv_ioctl_ext2,
446 AC_TRY_COMPILE([#include <linux/ext2_fs.h>
447#include <sys/ioctl.h>],
448 [ioctl (0, EXT2_IOC_SETVERSION, 0);],
449 [e2fsprogs_cv_ioctl_ext2=yes],
450 [e2fsprogs_cv_ioctl_ext2=no]))
451AC_MSG_RESULT($e2fsprogs_cv_ioctl_ext2)
452if test "$e2fsprogs_cv_ioctl_ext2" = yes; then
453 AC_DEFINE(HAVE_EXT2_IOCTLS)
454fi
455dnl
Theodore Ts'ofc6d9d51997-04-29 14:51:31 +0000456dnl Linux uses a separate usr_prefix by default
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000457dnl
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000458case "$host_os" in
459linux*)
460 if test "$prefix" = NONE ; then
Theodore Ts'ofc6d9d51997-04-29 14:51:31 +0000461 usr_prefix="\${prefix}/usr";
462 echo "On $host_os systems, usr_prefix defaults to $usr_prefix"
463 fi
464 ;;
465esac
466if test "$usr_prefix" = NONE ; then
467 usr_prefix="\${prefix}"
468fi
469AC_SUBST(usr_prefix)
470dnl
471dnl On Linux/hurd, force the prefix to be ''
472dnl
473case "$host_os" in
474linux* | gnu*)
475 if test "$prefix" = NONE ; then
476 prefix='';
477 echo "On $host_os systems, prefix defaults to ''"
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000478 fi
479;;
480esac
481dnl
482dnl See if -static works.
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000483dnl
Theodore Ts'oae851481997-04-29 18:13:24 +0000484AC_MSG_CHECKING([whether linker accepts -static])
485AC_CACHE_VAL(ac_cv_e2fsprogs_use_static,
486[SAVE_LDFLAGS=$LDFLAGS; LDFLAGS="$LDFLAGS -static"
487AC_TRY_LINK([#include <stdio.h>],[fflush(stdout);],
488 ac_cv_e2fsprogs_use_static=yes, ac_cv_e2fsprogs_use_static=no)
489LDFLAGS=$SAVE_LDFLAGS])
490AC_MSG_RESULT($ac_cv_e2fsprogs_use_static)
Theodore Ts'o74becf31997-04-26 14:37:06 +0000491LDFLAG_STATIC=
Theodore Ts'oae851481997-04-29 18:13:24 +0000492if test $ac_cv_e2fsprogs_use_static = yes; then
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000493 LDFLAG_STATIC=-static
Theodore Ts'oae851481997-04-29 18:13:24 +0000494fi
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000495AC_SUBST(LDFLAG_STATIC)
496dnl
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000497dnl Make the ss and et directories work correctly.
498dnl
499SS_DIR=`cd ${srcdir}/lib/ss; pwd`
500ET_DIR=`cd ${srcdir}/lib/et; pwd`
501AC_SUBST(SS_DIR)
502AC_SUBST(ET_DIR)
503dnl
504dnl Only try to run the test suite if we're not cross compiling.
505dnl
506if test "$cross_compiling" = yes ; then
507 DO_TEST_SUITE=
508else
509 DO_TEST_SUITE=check
510fi
511AC_SUBST(DO_TEST_SUITE)
512dnl
Theodore Ts'oa4d09611997-04-29 14:28:00 +0000513dnl
514dnl
515DO_SUBSTITUTE_SCRIPT=$srcdir/lib/do_substitute
516AC_SUBST_FILE(DO_SUBSTITUTE_SCRIPT)
517dnl
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000518dnl Make our output files, being sure that we create the some miscellaneous
519dnl directories
520dnl
521test -d lib || mkdir lib
522test -d include || mkdir include
523test -d include/linux || mkdir include/linux
Theodore Ts'o24b2c7a1997-06-07 20:42:58 +0000524rmakefile=
525if test -d ${srcdir}/resize ; then
526 rmakefile=resize/Makefile
527fi
Theodore Ts'o44339bd1997-10-15 02:47:20 +0000528AC_OUTPUT(MCONFIG Makefile util/Makefile util/subst.conf lib/et/Makefile
Theodore Ts'ofc6d9d51997-04-29 14:51:31 +0000529 lib/ss/Makefile lib/ext2fs/Makefile lib/e2p/Makefile lib/uuid/Makefile
530 misc/Makefile e2fsck/Makefile debugfs/Makefile tests/Makefile
Theodore Ts'o24b2c7a1997-06-07 20:42:58 +0000531 tests/progs/Makefile $rmakefile doc/Makefile)