blob: 6e811257e0d89f113f2d53c11a65dec47ffb820c [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'o19178752000-02-11 15:55:07 +0000114dnl handle --enable-compression
115dnl
116AC_ARG_ENABLE([compression],
117[ --enable-compression enable EXPERIMENTAL compression support],
118if test "$enableval" = "no"
119then
120 echo "Disabling compression support"
121else
122 AC_DEFINE(ENABLE_COMPRESSION)
123 echo "Enabling compression support"
124 echo "WARNING: Compression support is experimental"
125fi
126,
127echo "Disabling compression support by default"
128)
129dnl
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000130dnl handle --enable-dll-shlibs
131dnl
132AC_ARG_ENABLE([dll-shlibs],
Theodore Ts'oa4d09611997-04-29 14:28:00 +0000133[ --enable-dll-shlibs select DLL libraries],
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000134if test "$enableval" = "no"
135then
136 DLL_CMT=#
137 MAKEFILE_DLL=/dev/null
138 echo "Disabling DLL shared libraries"
139else
140 DLL_CMT=
141 MAKEFILE_DLL=$srcdir/lib/Makefile.dll-lib
Theodore Ts'o74becf31997-04-26 14:37:06 +0000142 BINARY_TYPE=dllbin
Theodore Ts'oa4d09611997-04-29 14:28:00 +0000143 LIB_EXT=.sa
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000144 echo "Enabling DLL shared libraries"
145fi
146,
147MAKEFILE_DLL=/dev/null
148DLL_CMT=#
149echo "Disabling DLL shared libraries by default"
150)
151AC_SUBST(DLL_CMT)
152AC_SUBST_FILE(MAKEFILE_DLL)
153dnl
154dnl handle --enable-elf-shlibs
155dnl
156AC_ARG_ENABLE([elf-shlibs],
Theodore Ts'oa4d09611997-04-29 14:28:00 +0000157[ --enable-elf-shlibs select ELF shared libraries],
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000158if test "$enableval" = "no"
159then
160 ELF_CMT=#
161 MAKEFILE_ELF=/dev/null
162 echo "Disabling ELF shared libraries"
163else
164 ELF_CMT=
165 MAKEFILE_ELF=$srcdir/lib/Makefile.elf-lib
Theodore Ts'o74becf31997-04-26 14:37:06 +0000166 BINARY_TYPE=elfbin
Theodore Ts'oa4d09611997-04-29 14:28:00 +0000167 LIB_EXT=.so
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000168 echo "Enabling ELF shared libraries"
169fi
170,
171MAKEFILE_ELF=/dev/null
172ELF_CMT=#
173echo "Disabling ELF shared libraries by default"
174)
175AC_SUBST(ELF_CMT)
176AC_SUBST_FILE(MAKEFILE_ELF)
177dnl
178dnl handle --enable-bsd-shlibs
179dnl
180AC_ARG_ENABLE([bsd-shlibs],
Theodore Ts'oa4d09611997-04-29 14:28:00 +0000181[ --enable-bsd-shlibs select BSD shared libraries],
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000182if test "$enableval" = "no"
183then
184 BSDLIB_CMT=#
185 MAKEFILE_BSDLIB=/dev/null
186 echo "Disabling BSD shared libraries"
187else
188 BSDLIB_CMT=
189 MAKEFILE_BSDLIB=$srcdir/lib/Makefile.bsd-lib
Theodore Ts'oa4d09611997-04-29 14:28:00 +0000190 LIB_EXT=.so
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000191 echo "Enabling BSD shared libraries"
192fi
193,
194MAKEFILE_BSDLIB=/dev/null
195BSDLIB_CMT=#
196echo "Disabling BSD shared libraries by default"
197)
198AC_SUBST(BSDLIB_CMT)
199AC_SUBST_FILE(MAKEFILE_BSDLIB)
200dnl
Theodore Ts'oa64c9c12000-02-08 20:17:21 +0000201dnl Add internationalization support, using gettext.
202dnl
203PACKAGE=e2fsprogs
204VERSION="$E2FSPROGS_VERSION"
205AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE")
206AC_DEFINE_UNQUOTED(VERSION, "$VERSION")
207AC_SUBST(PACKAGE)
208AC_SUBST(VERSION)
209
Theodore Ts'o19178752000-02-11 15:55:07 +0000210ALL_LINGUAS="it nyc"
Theodore Ts'oa64c9c12000-02-08 20:17:21 +0000211AM_GNU_GETTEXT
212dnl
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000213dnl handle --enable-profile
214dnl
215AC_ARG_ENABLE([profile],
Theodore Ts'oa4d09611997-04-29 14:28:00 +0000216[ --enable-profile build profiling libraries],
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000217if test "$enableval" = "no"
218then
219 PROFILE_CMT=#
220 MAKEFILE_PROFILE=/dev/null
221 echo "Disabling profiling libraries"
222else
223 PROFILE_CMT=
224 MAKEFILE_PROFILE=$srcdir/lib/Makefile.profile
Theodore Ts'oa4d09611997-04-29 14:28:00 +0000225 PROFILED_LIB_EXT=_p.a
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000226 echo "Building profiling libraries"
227fi
228,
229PROFILE_CMT=#
230MAKEFILE_PROFILE=/dev/null
231echo "Disabling profiling libraries by default"
232)
233AC_SUBST(PROFILE_CMT)
234AC_SUBST_FILE(MAKEFILE_PROFILE)
235dnl
236dnl handle --enable-checker
237dnl
238AC_ARG_ENABLE([checker],
Theodore Ts'oa4d09611997-04-29 14:28:00 +0000239[ --enable-checker build checker libraries],
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000240if test "$enableval" = "no"
241then
242 CHECKER_CMT=#
243 MAKEFILE_CHECKER=/dev/null
244 echo "Disabling checker libraries"
245else
246 CHECKER_CMT=
247 MAKEFILE_CHECKER=$srcdir/lib/Makefile.checker
248 echo "Building checker libraries"
249fi
250,
251CHECKER_CMT=#
252MAKEFILE_CHECKER=/dev/null
253echo "Disabling checker libraries by default"
254)
255AC_SUBST(CHECKER_CMT)
256AC_SUBST_FILE(MAKEFILE_CHECKER)
257dnl
Theodore Ts'oa4d09611997-04-29 14:28:00 +0000258dnl Substitute library extensions
259dnl
260AC_SUBST(LIB_EXT)
261AC_SUBST(STATIC_LIB_EXT)
262AC_SUBST(PROFILED_LIB_EXT)
263dnl
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000264dnl handle --enable-gcc-wall
265dnl
266AC_ARG_ENABLE([gcc-wall],
Theodore Ts'ob0b9c4d1997-10-20 23:36:30 +0000267[ --enable-gcc-wall enable GCC anal warnings (DON'T USE IN PRODUCTION)],
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000268if test "$enableval" = "no"
269then
270 W=#
271 echo "Disabling GCC warnings"
272else
273 W=
274 echo "Enabling GCC warnings"
275fi
276,
277W=#
278echo "Disabling GCC warnings by default"
279)
280AC_SUBST(W)
Theodore Ts'oa4d09611997-04-29 14:28:00 +0000281AC_ARG_ENABLE([dynamic-e2fsck],
282[ --enable-dynamic-e2fsck build e2fsck dynamically],
283if test "$enableval" = "no"
284then
285 E2FSCK_TYPE=static
286 echo "Building e2fsck statically"
287else
288 E2FSCK_TYPE=shared
289 echo "Building e2fsck dynamically"
290fi
291,
292E2FSCK_TYPE=static
293echo "Building e2fsck statically by default"
294)
295AC_SUBST(E2FSCK_TYPE)
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000296dnl
Theodore Ts'ofc6d9d51997-04-29 14:51:31 +0000297dnl See whether to install the `fsck' wrapper program (that calls e2fsck)
298dnl
299AC_ARG_ENABLE([fsck],
300[ --enable-fsck build fsck wrapper program],
301[if test "$enableval" = "no"
302then
303 FSCK_PROG='' FSCK_MAN=''
304 echo "Not building fsck wrapper"
305else
306 FSCK_PROG=fsck FSCK_MAN=fsck.8
307 echo "Building fsck wrapper"
308fi]
309,
310[case "$host_os" in
311 gnu*)
312 FSCK_PROG='' FSCK_MAN=''
313 echo "Not building fsck wrapper by default"
314 ;;
315 *)
316 FSCK_PROG=fsck FSCK_MAN=fsck.8
317 echo "Building fsck wrapper by default"
318esac]
319)
320AC_SUBST(FSCK_PROG)
321AC_SUBST(FSCK_MAN)
322dnl
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000323dnl
324MAKEFILE_LIBRARY=$srcdir/lib/Makefile.library
325AC_SUBST_FILE(MAKEFILE_LIBRARY)
326dnl
Theodore Ts'ofc6d9d51997-04-29 14:51:31 +0000327dnl
328AC_ARG_ENABLE([old-bitops],
329[ --enable-old-bitops Use old (non-standard but native) bitmask operations],
330if test "$enableval" = "no"
331then
332 echo "Using new (standard) bitmask operations"
333else
334 AC_DEFINE(EXT2_OLD_BITOPS)
335 echo "Using old (native) bitmask operations"
336
337fi
338,
339echo "Using standard bitmask operations by default"
340)
341dnl
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000342dnl End of configuration options
343dnl
Theodore Ts'o74becf31997-04-26 14:37:06 +0000344AC_SUBST(BINARY_TYPE)
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000345AC_PROG_MAKE_SET
346AC_PATH_PROG(LN, ln, ln)
Theodore Ts'ofc6d9d51997-04-29 14:51:31 +0000347AC_PROG_LN_S
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000348AC_PATH_PROG(MV, mv, mv)
349AC_PATH_PROG(CP, cp, cp)
350AC_PATH_PROG(RM, rm, rm)
351AC_PATH_PROG(CHMOD, chmod, :)
352AC_PATH_PROG(AWK, awk, awk)
353AC_PATH_PROG(SED, sed, sed)
Theodore Ts'o9d564f71999-07-03 20:25:58 +0000354AC_PATH_PROG(PERL, perl, perl)
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000355AC_CHECK_TOOL(AR, ar, ar)
356AC_CHECK_TOOL(RANLIB, ranlib, :)
357AC_CHECK_TOOL(STRIP, strip, :)
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000358AC_PROG_INSTALL
Theodore Ts'o6c133521999-07-03 20:37:03 +0000359# See if we need a separate native compiler.
360if test $cross_compiling = no; then
361 BUILD_CC="$CC"
362 AC_SUBST(BUILD_CC)
363else
364 AC_CHECK_PROGS(BUILD_CC, gcc cc)
365fi
Theodore Ts'oc81c6ce1999-10-26 04:28:53 +0000366AC_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 +0000367AC_FUNC_VPRINTF
368dnl
369dnl See if struct dirent has a d_namlen field (like bsd systems), implying
370dnl that the actual length of the structure may be grater than the declared
371dnl length.
372dnl
373AC_MSG_CHECKING(whether struct dirent has a d_namlen field)
374AC_CACHE_VAL(e2fsprogs_cv_struct_d_namlen,
375 AC_TRY_COMPILE(
376[#include <sys/types.h>
377#include <dirent.h>],
378 [struct dirent de; de.d_namlen = 0;],
379 [e2fsprogs_cv_struct_d_namlen=yes],
380 [e2fsprogs_cv_struct_d_namlen=no]))
381AC_MSG_RESULT($e2fsprogs_cv_struct_d_namlen)
382if test "$e2fsprogs_cv_struct_d_namlen" = yes; then
383 AC_DEFINE(HAVE_DIRENT_NAMLEN)
384fi
385dnl
Theodore Ts'ob0b9c4d1997-10-20 23:36:30 +0000386dnl Check to see if llseek() is declared in unistd.h. On some libc's
387dnl it is, and on others it isn't..... Thank you glibc developers....
388dnl
389dnl Warning! Use of --enable-gcc-wall may throw off this test.
390dnl
391dnl
392AC_MSG_CHECKING(whether llseek declared in unistd.h)
393AC_CACHE_VAL(e2fsprogs_cv_have_llseek_prototype,
394 AC_TRY_COMPILE(
395[#include <unistd.h>], [extern int llseek(int);],
396 [e2fsprogs_cv_have_llseek_prototype=no],
397 [e2fsprogs_cv_have_llseek_prototype=yes]))
398AC_MSG_RESULT($e2fsprogs_cv_have_llseek_prototype)
399if test "$e2fsprogs_cv_have_llseek_prototype" = yes; then
400 AC_DEFINE(HAVE_LLSEEK_PROTOTYPE)
401fi
402dnl
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000403dnl Word sizes...
404dnl
405if test "$cross_compiling" = yes -a "$ac_cv_sizeof_long" = ""; then
406 # if cross-compiling, with no cached values, just assume something common.
407 ac_cv_sizeof_short=2
408 ac_cv_sizeof_int=4
409 ac_cv_sizeof_long=4
Theodore Ts'o6c133521999-07-03 20:37:03 +0000410 ac_cv_sizeof_long_long=8
411 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 +0000412fi
413AC_CHECK_SIZEOF(short)
414AC_CHECK_SIZEOF(int)
415AC_CHECK_SIZEOF(long)
Theodore Ts'ofc6d9d51997-04-29 14:51:31 +0000416AC_CHECK_SIZEOF(long long)
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000417SIZEOF_SHORT=$ac_cv_sizeof_short
418SIZEOF_INT=$ac_cv_sizeof_int
419SIZEOF_LONG=$ac_cv_sizeof_long
Theodore Ts'ofc6d9d51997-04-29 14:51:31 +0000420SIZEOF_LONG_LONG=$ac_cv_sizeof_long_long
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000421AC_SUBST(SIZEOF_SHORT)
422AC_SUBST(SIZEOF_INT)
423AC_SUBST(SIZEOF_LONG)
Theodore Ts'ofc6d9d51997-04-29 14:51:31 +0000424AC_SUBST(SIZEOF_LONG_LONG)
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000425dnl
426dnl See if struct stat has a st_flags field, in which case we can get file
427dnl flags somewhat portably. Also check for the analogous setter, chflags().
428dnl
429AC_MSG_CHECKING(whether struct stat has a st_flags field)
430AC_CACHE_VAL(e2fsprogs_cv_struct_st_flags,
431 AC_TRY_COMPILE([#include <sys/stat.h>],
432 [struct stat stat; stat.st_flags = 0;],
433 [e2fsprogs_cv_struct_st_flags=yes],
434 [e2fsprogs_cv_struct_st_flags=no]))
435AC_MSG_RESULT($e2fsprogs_cv_struct_st_flags)
436if test "$e2fsprogs_cv_struct_st_flags" = yes; then
Theodore Ts'oc03bc4e1999-10-20 18:20:36 +0000437 AC_MSG_CHECKING(whether st_flags field is useful)
438 AC_CACHE_VAL(e2fsprogs_cv_struct_st_flags_immut,
439 AC_TRY_COMPILE([#include <sys/stat.h>],
440 [struct stat stat; stat.st_flags |= UF_IMMUTABLE;],
441 [e2fsprogs_cv_struct_st_flags_immut=yes],
442 [e2fsprogs_cv_struct_st_flags_immut=no]))
443 AC_MSG_RESULT($e2fsprogs_cv_struct_st_flags_immut)
444 if test "$e2fsprogs_cv_struct_st_flags_immut" = yes; then
445 AC_DEFINE(HAVE_STAT_FLAGS)
446 fi
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000447fi
Theodore Ts'o6454d841999-03-16 19:24:34 +0000448AC_CHECK_FUNCS(chflags getrusage llseek strdup getmntinfo strcasecmp srandom fchown mallinfo)
Theodore Ts'ofc6d9d51997-04-29 14:51:31 +0000449dnl
450dnl Check to see if ino_t is defined
451dnl
452AC_MSG_CHECKING(ino_t defined by sys/types.h)
453AC_CACHE_VAL(e2fsprogs_cv_ino_t,
454 AC_TRY_COMPILE([#include <sys/types.h>],
455 [ino_t ino; ino = 0;],
456 [e2fsprogs_cv_ino_t=yes],
457 [e2fsprogs_cv_ino_t=no]))
458AC_MSG_RESULT($e2fsprogs_cv_ino_t)
459if test "$e2fsprogs_cv_ino_t" = yes; then
460 AC_DEFINE(HAVE_INO_T)
461fi
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000462dnl
Theodore Ts'ofc6d9d51997-04-29 14:51:31 +0000463dnl Check to see if -lsocket is required (solaris) to make something
464dnl that uses socket() to compile; this is needed for the UUID library
465dnl
466SOCKET_LIB=''
467AC_CHECK_LIB(socket, socket, [SOCKET_LIB=-lsocket])
468AC_SUBST(SOCKET_LIB)
469dnl
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000470dnl See if optreset exists
471dnl
472AC_MSG_CHECKING(for optreset)
473AC_CACHE_VAL(ac_cv_have_optreset,
474[AC_EGREP_HEADER(optreset, unistd.h,
475 ac_cv_have_optreset=yes, ac_cv_have_optreset=no)])dnl
476AC_MSG_RESULT($ac_cv_have_optreset)
477if test $ac_cv_have_optreset = yes; then
478 AC_DEFINE(HAVE_OPTRESET)
479fi
480dnl
Theodore Ts'o8f3f29d2000-02-11 05:04:44 +0000481dnl We use the EXT2 ioctls only under Linux
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000482dnl
Theodore Ts'o8f3f29d2000-02-11 05:04:44 +0000483case "$host_os" in
484linux*)
485 AC_DEFINE(HAVE_EXT2_IOCTLS)
486 ;;
487esac
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000488dnl
Theodore Ts'o6c133521999-07-03 20:37:03 +0000489dnl Linux and Hurd places root files in the / by default
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000490dnl
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000491case "$host_os" in
Theodore Ts'o6c133521999-07-03 20:37:03 +0000492linux* | gnu*)
Theodore Ts'oa4b2d3c1998-04-03 16:12:25 +0000493 if test "$prefix" = NONE -a "$root_prefix" = NONE ; then
494 root_prefix="";
495 echo "On $host_os systems, root_prefix defaults to ''"
Theodore Ts'ofc6d9d51997-04-29 14:51:31 +0000496 fi
497 ;;
498esac
Theodore Ts'ofc6d9d51997-04-29 14:51:31 +0000499dnl
Theodore Ts'oa4b2d3c1998-04-03 16:12:25 +0000500dnl On Linux/hurd, force the prefix to be /usr
Theodore Ts'ofc6d9d51997-04-29 14:51:31 +0000501dnl
502case "$host_os" in
503linux* | gnu*)
504 if test "$prefix" = NONE ; then
Theodore Ts'oa4b2d3c1998-04-03 16:12:25 +0000505 prefix="/usr";
506 echo "On $host_os systems, prefix defaults to /usr"
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000507 fi
508;;
509esac
Theodore Ts'oa4b2d3c1998-04-03 16:12:25 +0000510if test "$root_prefix" = NONE ; then
Theodore Ts'offe19911998-04-08 06:05:49 +0000511 if test "$prefix" = NONE ; then
Theodore Ts'oa4b2d3c1998-04-03 16:12:25 +0000512 root_prefix="$ac_default_prefix"
513 else
514 root_prefix="$prefix"
515 fi
516fi
517AC_SUBST(root_prefix)
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000518dnl
519dnl See if -static works.
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000520dnl
Theodore Ts'oae851481997-04-29 18:13:24 +0000521AC_MSG_CHECKING([whether linker accepts -static])
522AC_CACHE_VAL(ac_cv_e2fsprogs_use_static,
523[SAVE_LDFLAGS=$LDFLAGS; LDFLAGS="$LDFLAGS -static"
524AC_TRY_LINK([#include <stdio.h>],[fflush(stdout);],
525 ac_cv_e2fsprogs_use_static=yes, ac_cv_e2fsprogs_use_static=no)
526LDFLAGS=$SAVE_LDFLAGS])
Theodore Ts'odefde781999-01-04 07:39:19 +0000527dnl
528dnl Regardless of how the test turns out, Solaris doesn't handle -static
529dnl This is caused by the socket library requiring the nsl library, which
530dnl requires the -dl library, which only works for dynamically linked
531dnl programs. It basically means you can't have statically linked programs
532dnl which use the network under Solaris.
533dnl
534case "$host_os" in
535solaris2.*)
536 ac_cv_e2fsprogs_use_static=no
537;;
538esac
Theodore Ts'oae851481997-04-29 18:13:24 +0000539AC_MSG_RESULT($ac_cv_e2fsprogs_use_static)
Theodore Ts'o74becf31997-04-26 14:37:06 +0000540LDFLAG_STATIC=
Theodore Ts'oae851481997-04-29 18:13:24 +0000541if test $ac_cv_e2fsprogs_use_static = yes; then
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000542 LDFLAG_STATIC=-static
Theodore Ts'oae851481997-04-29 18:13:24 +0000543fi
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000544AC_SUBST(LDFLAG_STATIC)
545dnl
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000546dnl Make the ss and et directories work correctly.
547dnl
548SS_DIR=`cd ${srcdir}/lib/ss; pwd`
549ET_DIR=`cd ${srcdir}/lib/et; pwd`
550AC_SUBST(SS_DIR)
551AC_SUBST(ET_DIR)
552dnl
553dnl Only try to run the test suite if we're not cross compiling.
554dnl
555if test "$cross_compiling" = yes ; then
556 DO_TEST_SUITE=
557else
558 DO_TEST_SUITE=check
559fi
560AC_SUBST(DO_TEST_SUITE)
561dnl
Theodore Ts'oa4d09611997-04-29 14:28:00 +0000562dnl
563dnl
564DO_SUBSTITUTE_SCRIPT=$srcdir/lib/do_substitute
565AC_SUBST_FILE(DO_SUBSTITUTE_SCRIPT)
566dnl
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000567dnl Make our output files, being sure that we create the some miscellaneous
568dnl directories
569dnl
570test -d lib || mkdir lib
571test -d include || mkdir include
572test -d include/linux || mkdir include/linux
Theodore Ts'odefde781999-01-04 07:39:19 +0000573test -d include/asm || mkdir include/asm
Theodore Ts'o24b2c7a1997-06-07 20:42:58 +0000574rmakefile=
575if test -d ${srcdir}/resize ; then
576 rmakefile=resize/Makefile
577fi
Theodore Ts'o44339bd1997-10-15 02:47:20 +0000578AC_OUTPUT(MCONFIG Makefile util/Makefile util/subst.conf lib/et/Makefile
Theodore Ts'ofc6d9d51997-04-29 14:51:31 +0000579 lib/ss/Makefile lib/ext2fs/Makefile lib/e2p/Makefile lib/uuid/Makefile
580 misc/Makefile e2fsck/Makefile debugfs/Makefile tests/Makefile
Theodore Ts'oa64c9c12000-02-08 20:17:21 +0000581 tests/progs/Makefile $rmakefile doc/Makefile
582 intl/Makefile po/Makefile.in)