blob: 7a9b4f68acd735d5502778b5b6085218e68e75e8 [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
Theodore Ts'o40fa8cc1999-01-09 05:06:02 +000016if expr $YEAR ">" 1900 > /dev/null ; then
17 E2FSPROGS_YEAR=$YEAR
18elif expr $YEAR ">" 90 >/dev/null ; then
Theodore Ts'o74becf31997-04-26 14:37:06 +000019 E2FSPROGS_YEAR=19$YEAR
20else
21 E2FSPROGS_YEAR=20$YEAR
22fi
23
24case $MONTH in
25Jan) E2FSPROGS_MONTH="January" ;;
26Feb) E2FSPROGS_MONTH="February" ;;
27Mar) E2FSPROGS_MONTH="March" ;;
28Apr) E2FSPROGS_MONTH="April" ;;
29May) E2FSPROGS_MONTH="May" ;;
30Jun) E2FSPROGS_MONTH="June" ;;
31Jul) E2FSPROGS_MONTH="July" ;;
32Aug) E2FSPROGS_MONTH="August" ;;
33Sep) E2FSPROGS_MONTH="September" ;;
34Oct) E2FSPROGS_MONTH="October" ;;
35Nov) E2FSPROGS_MONTH="November" ;;
36Dec) E2FSPROGS_MONTH="December" ;;
37*) echo "Unknown month $MONTH??" ;;
38esac
39
40unset DATE MONTH YEAR
41echo "Generating configuration file for e2fsprogs version $E2FSPROGS_VERSION"
42echo "Release date is ${E2FSPROGS_MONTH}, ${E2FSPROGS_YEAR}"
43AC_SUBST(E2FSPROGS_YEAR)
44AC_SUBST(E2FSPROGS_MONTH)
45AC_SUBST(E2FSPROGS_VERSION)
Theodore Ts'ofc6d9d51997-04-29 14:51:31 +000046AC_REQUIRE([AC_CANONICAL_HOST])
Theodore Ts'o74becf31997-04-26 14:37:06 +000047dnl
48dnl set $(CC) from --with-cc=value
49dnl
50AC_ARG_WITH([cc],
51[ --with-cc=COMPILER select compiler to use],
52AC_MSG_RESULT(CC=$withval)
53CC=$withval,
54if test -z "$CC" ; then CC=cc; fi
55[AC_MSG_RESULT(CC defaults to $CC)])dnl
56export CC
57AC_SUBST([CC])
Theodore Ts'o73ae2d42000-02-02 16:13:14 +000058AC_PROG_CC
Theodore Ts'o74becf31997-04-26 14:37:06 +000059dnl
60dnl set $(LD) from --with-linker=value
61dnl
62AC_ARG_WITH([linker],
63[ --with-linker=LINKER select linker to use],
64AC_MSG_RESULT(LD=$withval)
65LD=$withval,
66if test -z "$LD" ; then LD=$CC; fi
67[AC_MSG_RESULT(LD defaults to $LD)])dnl
68export LD
69AC_SUBST([LD])
70dnl
71dnl set $(CCOPTS) from --with-ccopts=value
72dnl
73AC_ARG_WITH([ccopts],
74[ --with-ccopts=CCOPTS select compiler command line options],
75AC_MSG_RESULT(CCOPTS is $withval)
76CCOPTS=$withval
77CFLAGS="$CFLAGS $withval",
78CCOPTS=)dnl
79AC_SUBST(CCOPTS)
80dnl
Theodore Ts'of8bd9801999-10-26 04:19:45 +000081dnl On systems without linux header files, we add an extra include directory
82dnl that holds enough to fake it (hopefully). Note that the $(top_srcdir) here
83dnl is quoted so that it gets expanded by make, not by configure.
84dnl
85AC_CHECK_HEADER(linux/fs.h, [linux_headers=yes], [linux_headers=no])
Theodore Ts'o73ae2d42000-02-02 16:13:14 +000086if test "$linux_headers" != yes; then
87 LINUX_INCLUDE='-I$(top_builddir)/include'
Theodore Ts'of8bd9801999-10-26 04:19:45 +000088fi
89AC_SUBST(LINUX_INCLUDE)
90dnl
Theodore Ts'oa4d09611997-04-29 14:28:00 +000091dnl Set default values for library extentions. Will be dealt with after
92dnl parsing configuration opions, which may modify these
93dnl
94LIB_EXT=.a
95STATIC_LIB_EXT=.a
96PROFILE_LIB_EXT=.a
97dnl
Theodore Ts'o74becf31997-04-26 14:37:06 +000098dnl set $(LDFLAGS) from --with-ldopts=value
99dnl
100AC_ARG_WITH([ldopts],
101[ --with-ldopts=LDOPTS select linker command line options],
102AC_MSG_RESULT(LDFLAGS is $withval)
103LDFLAGS=$withval,
104LDFLAGS=)dnl
105AC_SUBST(LDFLAGS)
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000106dnl
Theodore Ts'oa4b2d3c1998-04-03 16:12:25 +0000107dnl Allow separate `root_prefix' to be specified
Theodore Ts'ofc6d9d51997-04-29 14:51:31 +0000108dnl
Theodore Ts'oa4b2d3c1998-04-03 16:12:25 +0000109AC_ARG_WITH([root-prefix],
110[ --with-root-prefix=PREFIX override prefix variable for files to be placed in the root],
111root_prefix=$withval,
112root_prefix=NONE)dnl
Theodore Ts'ofc6d9d51997-04-29 14:51:31 +0000113dnl
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000114dnl handle --enable-dll-shlibs
115dnl
116AC_ARG_ENABLE([dll-shlibs],
Theodore Ts'oa4d09611997-04-29 14:28:00 +0000117[ --enable-dll-shlibs select DLL libraries],
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000118if test "$enableval" = "no"
119then
120 DLL_CMT=#
121 MAKEFILE_DLL=/dev/null
122 echo "Disabling DLL shared libraries"
123else
124 DLL_CMT=
125 MAKEFILE_DLL=$srcdir/lib/Makefile.dll-lib
Theodore Ts'o74becf31997-04-26 14:37:06 +0000126 BINARY_TYPE=dllbin
Theodore Ts'oa4d09611997-04-29 14:28:00 +0000127 LIB_EXT=.sa
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000128 echo "Enabling DLL shared libraries"
129fi
130,
131MAKEFILE_DLL=/dev/null
132DLL_CMT=#
133echo "Disabling DLL shared libraries by default"
134)
135AC_SUBST(DLL_CMT)
136AC_SUBST_FILE(MAKEFILE_DLL)
137dnl
138dnl handle --enable-elf-shlibs
139dnl
140AC_ARG_ENABLE([elf-shlibs],
Theodore Ts'oa4d09611997-04-29 14:28:00 +0000141[ --enable-elf-shlibs select ELF shared libraries],
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000142if test "$enableval" = "no"
143then
144 ELF_CMT=#
145 MAKEFILE_ELF=/dev/null
146 echo "Disabling ELF shared libraries"
147else
148 ELF_CMT=
149 MAKEFILE_ELF=$srcdir/lib/Makefile.elf-lib
Theodore Ts'o74becf31997-04-26 14:37:06 +0000150 BINARY_TYPE=elfbin
Theodore Ts'oa4d09611997-04-29 14:28:00 +0000151 LIB_EXT=.so
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000152 echo "Enabling ELF shared libraries"
153fi
154,
155MAKEFILE_ELF=/dev/null
156ELF_CMT=#
157echo "Disabling ELF shared libraries by default"
158)
159AC_SUBST(ELF_CMT)
160AC_SUBST_FILE(MAKEFILE_ELF)
161dnl
162dnl handle --enable-bsd-shlibs
163dnl
164AC_ARG_ENABLE([bsd-shlibs],
Theodore Ts'oa4d09611997-04-29 14:28:00 +0000165[ --enable-bsd-shlibs select BSD shared libraries],
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000166if test "$enableval" = "no"
167then
168 BSDLIB_CMT=#
169 MAKEFILE_BSDLIB=/dev/null
170 echo "Disabling BSD shared libraries"
171else
172 BSDLIB_CMT=
173 MAKEFILE_BSDLIB=$srcdir/lib/Makefile.bsd-lib
Theodore Ts'oa4d09611997-04-29 14:28:00 +0000174 LIB_EXT=.so
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000175 echo "Enabling BSD shared libraries"
176fi
177,
178MAKEFILE_BSDLIB=/dev/null
179BSDLIB_CMT=#
180echo "Disabling BSD shared libraries by default"
181)
182AC_SUBST(BSDLIB_CMT)
183AC_SUBST_FILE(MAKEFILE_BSDLIB)
184dnl
Theodore Ts'oa64c9c12000-02-08 20:17:21 +0000185dnl Add internationalization support, using gettext.
186dnl
187PACKAGE=e2fsprogs
188VERSION="$E2FSPROGS_VERSION"
189AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE")
190AC_DEFINE_UNQUOTED(VERSION, "$VERSION")
191AC_SUBST(PACKAGE)
192AC_SUBST(VERSION)
193
194ALL_LINGUAS="it"
195AM_GNU_GETTEXT
196dnl
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000197dnl handle --enable-profile
198dnl
199AC_ARG_ENABLE([profile],
Theodore Ts'oa4d09611997-04-29 14:28:00 +0000200[ --enable-profile build profiling libraries],
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000201if test "$enableval" = "no"
202then
203 PROFILE_CMT=#
204 MAKEFILE_PROFILE=/dev/null
205 echo "Disabling profiling libraries"
206else
207 PROFILE_CMT=
208 MAKEFILE_PROFILE=$srcdir/lib/Makefile.profile
Theodore Ts'oa4d09611997-04-29 14:28:00 +0000209 PROFILED_LIB_EXT=_p.a
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000210 echo "Building profiling libraries"
211fi
212,
213PROFILE_CMT=#
214MAKEFILE_PROFILE=/dev/null
215echo "Disabling profiling libraries by default"
216)
217AC_SUBST(PROFILE_CMT)
218AC_SUBST_FILE(MAKEFILE_PROFILE)
219dnl
220dnl handle --enable-checker
221dnl
222AC_ARG_ENABLE([checker],
Theodore Ts'oa4d09611997-04-29 14:28:00 +0000223[ --enable-checker build checker libraries],
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000224if test "$enableval" = "no"
225then
226 CHECKER_CMT=#
227 MAKEFILE_CHECKER=/dev/null
228 echo "Disabling checker libraries"
229else
230 CHECKER_CMT=
231 MAKEFILE_CHECKER=$srcdir/lib/Makefile.checker
232 echo "Building checker libraries"
233fi
234,
235CHECKER_CMT=#
236MAKEFILE_CHECKER=/dev/null
237echo "Disabling checker libraries by default"
238)
239AC_SUBST(CHECKER_CMT)
240AC_SUBST_FILE(MAKEFILE_CHECKER)
241dnl
Theodore Ts'oa4d09611997-04-29 14:28:00 +0000242dnl Substitute library extensions
243dnl
244AC_SUBST(LIB_EXT)
245AC_SUBST(STATIC_LIB_EXT)
246AC_SUBST(PROFILED_LIB_EXT)
247dnl
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000248dnl handle --enable-gcc-wall
249dnl
250AC_ARG_ENABLE([gcc-wall],
Theodore Ts'ob0b9c4d1997-10-20 23:36:30 +0000251[ --enable-gcc-wall enable GCC anal warnings (DON'T USE IN PRODUCTION)],
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000252if test "$enableval" = "no"
253then
254 W=#
255 echo "Disabling GCC warnings"
256else
257 W=
258 echo "Enabling GCC warnings"
259fi
260,
261W=#
262echo "Disabling GCC warnings by default"
263)
264AC_SUBST(W)
Theodore Ts'oa4d09611997-04-29 14:28:00 +0000265AC_ARG_ENABLE([dynamic-e2fsck],
266[ --enable-dynamic-e2fsck build e2fsck dynamically],
267if test "$enableval" = "no"
268then
269 E2FSCK_TYPE=static
270 echo "Building e2fsck statically"
271else
272 E2FSCK_TYPE=shared
273 echo "Building e2fsck dynamically"
274fi
275,
276E2FSCK_TYPE=static
277echo "Building e2fsck statically by default"
278)
279AC_SUBST(E2FSCK_TYPE)
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000280dnl
Theodore Ts'ofc6d9d51997-04-29 14:51:31 +0000281dnl See whether to install the `fsck' wrapper program (that calls e2fsck)
282dnl
283AC_ARG_ENABLE([fsck],
284[ --enable-fsck build fsck wrapper program],
285[if test "$enableval" = "no"
286then
287 FSCK_PROG='' FSCK_MAN=''
288 echo "Not building fsck wrapper"
289else
290 FSCK_PROG=fsck FSCK_MAN=fsck.8
291 echo "Building fsck wrapper"
292fi]
293,
294[case "$host_os" in
295 gnu*)
296 FSCK_PROG='' FSCK_MAN=''
297 echo "Not building fsck wrapper by default"
298 ;;
299 *)
300 FSCK_PROG=fsck FSCK_MAN=fsck.8
301 echo "Building fsck wrapper by default"
302esac]
303)
304AC_SUBST(FSCK_PROG)
305AC_SUBST(FSCK_MAN)
306dnl
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000307dnl
308MAKEFILE_LIBRARY=$srcdir/lib/Makefile.library
309AC_SUBST_FILE(MAKEFILE_LIBRARY)
310dnl
Theodore Ts'ofc6d9d51997-04-29 14:51:31 +0000311dnl
312AC_ARG_ENABLE([old-bitops],
313[ --enable-old-bitops Use old (non-standard but native) bitmask operations],
314if test "$enableval" = "no"
315then
316 echo "Using new (standard) bitmask operations"
317else
318 AC_DEFINE(EXT2_OLD_BITOPS)
319 echo "Using old (native) bitmask operations"
320
321fi
322,
323echo "Using standard bitmask operations by default"
324)
325dnl
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000326dnl End of configuration options
327dnl
Theodore Ts'o74becf31997-04-26 14:37:06 +0000328AC_SUBST(BINARY_TYPE)
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000329AC_PROG_MAKE_SET
330AC_PATH_PROG(LN, ln, ln)
Theodore Ts'ofc6d9d51997-04-29 14:51:31 +0000331AC_PROG_LN_S
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000332AC_PATH_PROG(MV, mv, mv)
333AC_PATH_PROG(CP, cp, cp)
334AC_PATH_PROG(RM, rm, rm)
335AC_PATH_PROG(CHMOD, chmod, :)
336AC_PATH_PROG(AWK, awk, awk)
337AC_PATH_PROG(SED, sed, sed)
Theodore Ts'o9d564f71999-07-03 20:25:58 +0000338AC_PATH_PROG(PERL, perl, perl)
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000339AC_CHECK_TOOL(AR, ar, ar)
340AC_CHECK_TOOL(RANLIB, ranlib, :)
341AC_CHECK_TOOL(STRIP, strip, :)
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000342AC_PROG_INSTALL
Theodore Ts'o6c133521999-07-03 20:37:03 +0000343# See if we need a separate native compiler.
344if test $cross_compiling = no; then
345 BUILD_CC="$CC"
346 AC_SUBST(BUILD_CC)
347else
348 AC_CHECK_PROGS(BUILD_CC, gcc cc)
349fi
Theodore Ts'oc81c6ce1999-10-26 04:28:53 +0000350AC_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/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 +0000351AC_FUNC_VPRINTF
352dnl
353dnl See if struct dirent has a d_namlen field (like bsd systems), implying
354dnl that the actual length of the structure may be grater than the declared
355dnl length.
356dnl
357AC_MSG_CHECKING(whether struct dirent has a d_namlen field)
358AC_CACHE_VAL(e2fsprogs_cv_struct_d_namlen,
359 AC_TRY_COMPILE(
360[#include <sys/types.h>
361#include <dirent.h>],
362 [struct dirent de; de.d_namlen = 0;],
363 [e2fsprogs_cv_struct_d_namlen=yes],
364 [e2fsprogs_cv_struct_d_namlen=no]))
365AC_MSG_RESULT($e2fsprogs_cv_struct_d_namlen)
366if test "$e2fsprogs_cv_struct_d_namlen" = yes; then
367 AC_DEFINE(HAVE_DIRENT_NAMLEN)
368fi
369dnl
Theodore Ts'ob0b9c4d1997-10-20 23:36:30 +0000370dnl Check to see if llseek() is declared in unistd.h. On some libc's
371dnl it is, and on others it isn't..... Thank you glibc developers....
372dnl
373dnl Warning! Use of --enable-gcc-wall may throw off this test.
374dnl
375dnl
376AC_MSG_CHECKING(whether llseek declared in unistd.h)
377AC_CACHE_VAL(e2fsprogs_cv_have_llseek_prototype,
378 AC_TRY_COMPILE(
379[#include <unistd.h>], [extern int llseek(int);],
380 [e2fsprogs_cv_have_llseek_prototype=no],
381 [e2fsprogs_cv_have_llseek_prototype=yes]))
382AC_MSG_RESULT($e2fsprogs_cv_have_llseek_prototype)
383if test "$e2fsprogs_cv_have_llseek_prototype" = yes; then
384 AC_DEFINE(HAVE_LLSEEK_PROTOTYPE)
385fi
386dnl
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000387dnl Word sizes...
388dnl
389if test "$cross_compiling" = yes -a "$ac_cv_sizeof_long" = ""; then
390 # if cross-compiling, with no cached values, just assume something common.
391 ac_cv_sizeof_short=2
392 ac_cv_sizeof_int=4
393 ac_cv_sizeof_long=4
Theodore Ts'o6c133521999-07-03 20:37:03 +0000394 ac_cv_sizeof_long_long=8
395 AC_MSG_WARN([Cross-compiling, so cannot check type sizes; assuming short=2, int=4, long=4, long long=8])
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000396fi
397AC_CHECK_SIZEOF(short)
398AC_CHECK_SIZEOF(int)
399AC_CHECK_SIZEOF(long)
Theodore Ts'ofc6d9d51997-04-29 14:51:31 +0000400AC_CHECK_SIZEOF(long long)
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000401SIZEOF_SHORT=$ac_cv_sizeof_short
402SIZEOF_INT=$ac_cv_sizeof_int
403SIZEOF_LONG=$ac_cv_sizeof_long
Theodore Ts'ofc6d9d51997-04-29 14:51:31 +0000404SIZEOF_LONG_LONG=$ac_cv_sizeof_long_long
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000405AC_SUBST(SIZEOF_SHORT)
406AC_SUBST(SIZEOF_INT)
407AC_SUBST(SIZEOF_LONG)
Theodore Ts'ofc6d9d51997-04-29 14:51:31 +0000408AC_SUBST(SIZEOF_LONG_LONG)
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000409dnl
410dnl See if struct stat has a st_flags field, in which case we can get file
411dnl flags somewhat portably. Also check for the analogous setter, chflags().
412dnl
413AC_MSG_CHECKING(whether struct stat has a st_flags field)
414AC_CACHE_VAL(e2fsprogs_cv_struct_st_flags,
415 AC_TRY_COMPILE([#include <sys/stat.h>],
416 [struct stat stat; stat.st_flags = 0;],
417 [e2fsprogs_cv_struct_st_flags=yes],
418 [e2fsprogs_cv_struct_st_flags=no]))
419AC_MSG_RESULT($e2fsprogs_cv_struct_st_flags)
420if test "$e2fsprogs_cv_struct_st_flags" = yes; then
Theodore Ts'oc03bc4e1999-10-20 18:20:36 +0000421 AC_MSG_CHECKING(whether st_flags field is useful)
422 AC_CACHE_VAL(e2fsprogs_cv_struct_st_flags_immut,
423 AC_TRY_COMPILE([#include <sys/stat.h>],
424 [struct stat stat; stat.st_flags |= UF_IMMUTABLE;],
425 [e2fsprogs_cv_struct_st_flags_immut=yes],
426 [e2fsprogs_cv_struct_st_flags_immut=no]))
427 AC_MSG_RESULT($e2fsprogs_cv_struct_st_flags_immut)
428 if test "$e2fsprogs_cv_struct_st_flags_immut" = yes; then
429 AC_DEFINE(HAVE_STAT_FLAGS)
430 fi
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000431fi
Theodore Ts'o6454d841999-03-16 19:24:34 +0000432AC_CHECK_FUNCS(chflags getrusage llseek strdup getmntinfo strcasecmp srandom fchown mallinfo)
Theodore Ts'ofc6d9d51997-04-29 14:51:31 +0000433dnl
434dnl Check to see if ino_t is defined
435dnl
436AC_MSG_CHECKING(ino_t defined by sys/types.h)
437AC_CACHE_VAL(e2fsprogs_cv_ino_t,
438 AC_TRY_COMPILE([#include <sys/types.h>],
439 [ino_t ino; ino = 0;],
440 [e2fsprogs_cv_ino_t=yes],
441 [e2fsprogs_cv_ino_t=no]))
442AC_MSG_RESULT($e2fsprogs_cv_ino_t)
443if test "$e2fsprogs_cv_ino_t" = yes; then
444 AC_DEFINE(HAVE_INO_T)
445fi
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000446dnl
Theodore Ts'ofc6d9d51997-04-29 14:51:31 +0000447dnl Check to see if -lsocket is required (solaris) to make something
448dnl that uses socket() to compile; this is needed for the UUID library
449dnl
450SOCKET_LIB=''
451AC_CHECK_LIB(socket, socket, [SOCKET_LIB=-lsocket])
452AC_SUBST(SOCKET_LIB)
453dnl
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000454dnl See if optreset exists
455dnl
456AC_MSG_CHECKING(for optreset)
457AC_CACHE_VAL(ac_cv_have_optreset,
458[AC_EGREP_HEADER(optreset, unistd.h,
459 ac_cv_have_optreset=yes, ac_cv_have_optreset=no)])dnl
460AC_MSG_RESULT($ac_cv_have_optreset)
461if test $ac_cv_have_optreset = yes; then
462 AC_DEFINE(HAVE_OPTRESET)
463fi
464dnl
Theodore Ts'o8f3f29d2000-02-11 05:04:44 +0000465dnl We use the EXT2 ioctls only under Linux
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000466dnl
Theodore Ts'o8f3f29d2000-02-11 05:04:44 +0000467case "$host_os" in
468linux*)
469 AC_DEFINE(HAVE_EXT2_IOCTLS)
470 ;;
471esac
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000472dnl
Theodore Ts'o6c133521999-07-03 20:37:03 +0000473dnl Linux and Hurd places root files in the / by default
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000474dnl
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000475case "$host_os" in
Theodore Ts'o6c133521999-07-03 20:37:03 +0000476linux* | gnu*)
Theodore Ts'oa4b2d3c1998-04-03 16:12:25 +0000477 if test "$prefix" = NONE -a "$root_prefix" = NONE ; then
478 root_prefix="";
479 echo "On $host_os systems, root_prefix defaults to ''"
Theodore Ts'ofc6d9d51997-04-29 14:51:31 +0000480 fi
481 ;;
482esac
Theodore Ts'ofc6d9d51997-04-29 14:51:31 +0000483dnl
Theodore Ts'oa4b2d3c1998-04-03 16:12:25 +0000484dnl On Linux/hurd, force the prefix to be /usr
Theodore Ts'ofc6d9d51997-04-29 14:51:31 +0000485dnl
486case "$host_os" in
487linux* | gnu*)
488 if test "$prefix" = NONE ; then
Theodore Ts'oa4b2d3c1998-04-03 16:12:25 +0000489 prefix="/usr";
490 echo "On $host_os systems, prefix defaults to /usr"
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000491 fi
492;;
493esac
Theodore Ts'oa4b2d3c1998-04-03 16:12:25 +0000494if test "$root_prefix" = NONE ; then
Theodore Ts'offe19911998-04-08 06:05:49 +0000495 if test "$prefix" = NONE ; then
Theodore Ts'oa4b2d3c1998-04-03 16:12:25 +0000496 root_prefix="$ac_default_prefix"
497 else
498 root_prefix="$prefix"
499 fi
500fi
501AC_SUBST(root_prefix)
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000502dnl
503dnl See if -static works.
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000504dnl
Theodore Ts'oae851481997-04-29 18:13:24 +0000505AC_MSG_CHECKING([whether linker accepts -static])
506AC_CACHE_VAL(ac_cv_e2fsprogs_use_static,
507[SAVE_LDFLAGS=$LDFLAGS; LDFLAGS="$LDFLAGS -static"
508AC_TRY_LINK([#include <stdio.h>],[fflush(stdout);],
509 ac_cv_e2fsprogs_use_static=yes, ac_cv_e2fsprogs_use_static=no)
510LDFLAGS=$SAVE_LDFLAGS])
Theodore Ts'odefde781999-01-04 07:39:19 +0000511dnl
512dnl Regardless of how the test turns out, Solaris doesn't handle -static
513dnl This is caused by the socket library requiring the nsl library, which
514dnl requires the -dl library, which only works for dynamically linked
515dnl programs. It basically means you can't have statically linked programs
516dnl which use the network under Solaris.
517dnl
518case "$host_os" in
519solaris2.*)
520 ac_cv_e2fsprogs_use_static=no
521;;
522esac
Theodore Ts'oae851481997-04-29 18:13:24 +0000523AC_MSG_RESULT($ac_cv_e2fsprogs_use_static)
Theodore Ts'o74becf31997-04-26 14:37:06 +0000524LDFLAG_STATIC=
Theodore Ts'oae851481997-04-29 18:13:24 +0000525if test $ac_cv_e2fsprogs_use_static = yes; then
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000526 LDFLAG_STATIC=-static
Theodore Ts'oae851481997-04-29 18:13:24 +0000527fi
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000528AC_SUBST(LDFLAG_STATIC)
529dnl
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000530dnl Make the ss and et directories work correctly.
531dnl
532SS_DIR=`cd ${srcdir}/lib/ss; pwd`
533ET_DIR=`cd ${srcdir}/lib/et; pwd`
534AC_SUBST(SS_DIR)
535AC_SUBST(ET_DIR)
536dnl
537dnl Only try to run the test suite if we're not cross compiling.
538dnl
539if test "$cross_compiling" = yes ; then
540 DO_TEST_SUITE=
541else
542 DO_TEST_SUITE=check
543fi
544AC_SUBST(DO_TEST_SUITE)
545dnl
Theodore Ts'oa4d09611997-04-29 14:28:00 +0000546dnl
547dnl
548DO_SUBSTITUTE_SCRIPT=$srcdir/lib/do_substitute
549AC_SUBST_FILE(DO_SUBSTITUTE_SCRIPT)
550dnl
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000551dnl Make our output files, being sure that we create the some miscellaneous
552dnl directories
553dnl
554test -d lib || mkdir lib
555test -d include || mkdir include
556test -d include/linux || mkdir include/linux
Theodore Ts'odefde781999-01-04 07:39:19 +0000557test -d include/asm || mkdir include/asm
Theodore Ts'o24b2c7a1997-06-07 20:42:58 +0000558rmakefile=
559if test -d ${srcdir}/resize ; then
560 rmakefile=resize/Makefile
561fi
Theodore Ts'o44339bd1997-10-15 02:47:20 +0000562AC_OUTPUT(MCONFIG Makefile util/Makefile util/subst.conf lib/et/Makefile
Theodore Ts'ofc6d9d51997-04-29 14:51:31 +0000563 lib/ss/Makefile lib/ext2fs/Makefile lib/e2p/Makefile lib/uuid/Makefile
564 misc/Makefile e2fsck/Makefile debugfs/Makefile tests/Makefile
Theodore Ts'oa64c9c12000-02-08 20:17:21 +0000565 tests/progs/Makefile $rmakefile doc/Makefile
566 intl/Makefile po/Makefile.in)