blob: a9b5567194661e6415759f13eb311fac72dbdbc3 [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])
58dnl
59dnl set $(LD) from --with-linker=value
60dnl
61AC_ARG_WITH([linker],
62[ --with-linker=LINKER select linker to use],
63AC_MSG_RESULT(LD=$withval)
64LD=$withval,
65if test -z "$LD" ; then LD=$CC; fi
66[AC_MSG_RESULT(LD defaults to $LD)])dnl
67export LD
68AC_SUBST([LD])
69dnl
70dnl set $(CCOPTS) from --with-ccopts=value
71dnl
72AC_ARG_WITH([ccopts],
73[ --with-ccopts=CCOPTS select compiler command line options],
74AC_MSG_RESULT(CCOPTS is $withval)
75CCOPTS=$withval
76CFLAGS="$CFLAGS $withval",
77CCOPTS=)dnl
78AC_SUBST(CCOPTS)
79dnl
Theodore Ts'oa4d09611997-04-29 14:28:00 +000080dnl Set default values for library extentions. Will be dealt with after
81dnl parsing configuration opions, which may modify these
82dnl
83LIB_EXT=.a
84STATIC_LIB_EXT=.a
85PROFILE_LIB_EXT=.a
86dnl
Theodore Ts'o74becf31997-04-26 14:37:06 +000087dnl set $(LDFLAGS) from --with-ldopts=value
88dnl
89AC_ARG_WITH([ldopts],
90[ --with-ldopts=LDOPTS select linker command line options],
91AC_MSG_RESULT(LDFLAGS is $withval)
92LDFLAGS=$withval,
93LDFLAGS=)dnl
94AC_SUBST(LDFLAGS)
Theodore Ts'o50e1e101997-04-26 13:58:21 +000095dnl
Theodore Ts'oa4b2d3c1998-04-03 16:12:25 +000096dnl Allow separate `root_prefix' to be specified
Theodore Ts'ofc6d9d51997-04-29 14:51:31 +000097dnl
Theodore Ts'oa4b2d3c1998-04-03 16:12:25 +000098AC_ARG_WITH([root-prefix],
99[ --with-root-prefix=PREFIX override prefix variable for files to be placed in the root],
100root_prefix=$withval,
101root_prefix=NONE)dnl
Theodore Ts'ofc6d9d51997-04-29 14:51:31 +0000102dnl
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000103dnl handle --enable-dll-shlibs
104dnl
105AC_ARG_ENABLE([dll-shlibs],
Theodore Ts'oa4d09611997-04-29 14:28:00 +0000106[ --enable-dll-shlibs select DLL libraries],
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000107if test "$enableval" = "no"
108then
109 DLL_CMT=#
110 MAKEFILE_DLL=/dev/null
111 echo "Disabling DLL shared libraries"
112else
113 DLL_CMT=
114 MAKEFILE_DLL=$srcdir/lib/Makefile.dll-lib
Theodore Ts'o74becf31997-04-26 14:37:06 +0000115 BINARY_TYPE=dllbin
Theodore Ts'oa4d09611997-04-29 14:28:00 +0000116 LIB_EXT=.sa
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000117 echo "Enabling DLL shared libraries"
118fi
119,
120MAKEFILE_DLL=/dev/null
121DLL_CMT=#
122echo "Disabling DLL shared libraries by default"
123)
124AC_SUBST(DLL_CMT)
125AC_SUBST_FILE(MAKEFILE_DLL)
126dnl
127dnl handle --enable-elf-shlibs
128dnl
129AC_ARG_ENABLE([elf-shlibs],
Theodore Ts'oa4d09611997-04-29 14:28:00 +0000130[ --enable-elf-shlibs select ELF shared libraries],
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000131if test "$enableval" = "no"
132then
133 ELF_CMT=#
134 MAKEFILE_ELF=/dev/null
135 echo "Disabling ELF shared libraries"
136else
137 ELF_CMT=
138 MAKEFILE_ELF=$srcdir/lib/Makefile.elf-lib
Theodore Ts'o74becf31997-04-26 14:37:06 +0000139 BINARY_TYPE=elfbin
Theodore Ts'oa4d09611997-04-29 14:28:00 +0000140 LIB_EXT=.so
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000141 echo "Enabling ELF shared libraries"
142fi
143,
144MAKEFILE_ELF=/dev/null
145ELF_CMT=#
146echo "Disabling ELF shared libraries by default"
147)
148AC_SUBST(ELF_CMT)
149AC_SUBST_FILE(MAKEFILE_ELF)
150dnl
151dnl handle --enable-bsd-shlibs
152dnl
153AC_ARG_ENABLE([bsd-shlibs],
Theodore Ts'oa4d09611997-04-29 14:28:00 +0000154[ --enable-bsd-shlibs select BSD shared libraries],
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000155if test "$enableval" = "no"
156then
157 BSDLIB_CMT=#
158 MAKEFILE_BSDLIB=/dev/null
159 echo "Disabling BSD shared libraries"
160else
161 BSDLIB_CMT=
162 MAKEFILE_BSDLIB=$srcdir/lib/Makefile.bsd-lib
Theodore Ts'oa4d09611997-04-29 14:28:00 +0000163 LIB_EXT=.so
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000164 echo "Enabling BSD shared libraries"
165fi
166,
167MAKEFILE_BSDLIB=/dev/null
168BSDLIB_CMT=#
169echo "Disabling BSD shared libraries by default"
170)
171AC_SUBST(BSDLIB_CMT)
172AC_SUBST_FILE(MAKEFILE_BSDLIB)
173dnl
174dnl handle --enable-profile
175dnl
176AC_ARG_ENABLE([profile],
Theodore Ts'oa4d09611997-04-29 14:28:00 +0000177[ --enable-profile build profiling libraries],
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000178if test "$enableval" = "no"
179then
180 PROFILE_CMT=#
181 MAKEFILE_PROFILE=/dev/null
182 echo "Disabling profiling libraries"
183else
184 PROFILE_CMT=
185 MAKEFILE_PROFILE=$srcdir/lib/Makefile.profile
Theodore Ts'oa4d09611997-04-29 14:28:00 +0000186 PROFILED_LIB_EXT=_p.a
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000187 echo "Building profiling libraries"
188fi
189,
190PROFILE_CMT=#
191MAKEFILE_PROFILE=/dev/null
192echo "Disabling profiling libraries by default"
193)
194AC_SUBST(PROFILE_CMT)
195AC_SUBST_FILE(MAKEFILE_PROFILE)
196dnl
197dnl handle --enable-checker
198dnl
199AC_ARG_ENABLE([checker],
Theodore Ts'oa4d09611997-04-29 14:28:00 +0000200[ --enable-checker build checker libraries],
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000201if test "$enableval" = "no"
202then
203 CHECKER_CMT=#
204 MAKEFILE_CHECKER=/dev/null
205 echo "Disabling checker libraries"
206else
207 CHECKER_CMT=
208 MAKEFILE_CHECKER=$srcdir/lib/Makefile.checker
209 echo "Building checker libraries"
210fi
211,
212CHECKER_CMT=#
213MAKEFILE_CHECKER=/dev/null
214echo "Disabling checker libraries by default"
215)
216AC_SUBST(CHECKER_CMT)
217AC_SUBST_FILE(MAKEFILE_CHECKER)
218dnl
Theodore Ts'oa4d09611997-04-29 14:28:00 +0000219dnl Substitute library extensions
220dnl
221AC_SUBST(LIB_EXT)
222AC_SUBST(STATIC_LIB_EXT)
223AC_SUBST(PROFILED_LIB_EXT)
224dnl
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000225dnl handle --enable-gcc-wall
226dnl
227AC_ARG_ENABLE([gcc-wall],
Theodore Ts'ob0b9c4d1997-10-20 23:36:30 +0000228[ --enable-gcc-wall enable GCC anal warnings (DON'T USE IN PRODUCTION)],
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000229if test "$enableval" = "no"
230then
231 W=#
232 echo "Disabling GCC warnings"
233else
234 W=
235 echo "Enabling GCC warnings"
236fi
237,
238W=#
239echo "Disabling GCC warnings by default"
240)
241AC_SUBST(W)
Theodore Ts'oa4d09611997-04-29 14:28:00 +0000242AC_ARG_ENABLE([dynamic-e2fsck],
243[ --enable-dynamic-e2fsck build e2fsck dynamically],
244if test "$enableval" = "no"
245then
246 E2FSCK_TYPE=static
247 echo "Building e2fsck statically"
248else
249 E2FSCK_TYPE=shared
250 echo "Building e2fsck dynamically"
251fi
252,
253E2FSCK_TYPE=static
254echo "Building e2fsck statically by default"
255)
256AC_SUBST(E2FSCK_TYPE)
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000257dnl
Theodore Ts'ofc6d9d51997-04-29 14:51:31 +0000258dnl See whether to install the `fsck' wrapper program (that calls e2fsck)
259dnl
260AC_ARG_ENABLE([fsck],
261[ --enable-fsck build fsck wrapper program],
262[if test "$enableval" = "no"
263then
264 FSCK_PROG='' FSCK_MAN=''
265 echo "Not building fsck wrapper"
266else
267 FSCK_PROG=fsck FSCK_MAN=fsck.8
268 echo "Building fsck wrapper"
269fi]
270,
271[case "$host_os" in
272 gnu*)
273 FSCK_PROG='' FSCK_MAN=''
274 echo "Not building fsck wrapper by default"
275 ;;
276 *)
277 FSCK_PROG=fsck FSCK_MAN=fsck.8
278 echo "Building fsck wrapper by default"
279esac]
280)
281AC_SUBST(FSCK_PROG)
282AC_SUBST(FSCK_MAN)
283dnl
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000284dnl
285MAKEFILE_LIBRARY=$srcdir/lib/Makefile.library
286AC_SUBST_FILE(MAKEFILE_LIBRARY)
287dnl
Theodore Ts'ofc6d9d51997-04-29 14:51:31 +0000288dnl
289AC_ARG_ENABLE([old-bitops],
290[ --enable-old-bitops Use old (non-standard but native) bitmask operations],
291if test "$enableval" = "no"
292then
293 echo "Using new (standard) bitmask operations"
294else
295 AC_DEFINE(EXT2_OLD_BITOPS)
296 echo "Using old (native) bitmask operations"
297
298fi
299,
300echo "Using standard bitmask operations by default"
301)
302dnl
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000303dnl End of configuration options
304dnl
Theodore Ts'o74becf31997-04-26 14:37:06 +0000305AC_SUBST(BINARY_TYPE)
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000306AC_PROG_MAKE_SET
307AC_PATH_PROG(LN, ln, ln)
Theodore Ts'ofc6d9d51997-04-29 14:51:31 +0000308AC_PROG_LN_S
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000309AC_PATH_PROG(MV, mv, mv)
310AC_PATH_PROG(CP, cp, cp)
311AC_PATH_PROG(RM, rm, rm)
312AC_PATH_PROG(CHMOD, chmod, :)
313AC_PATH_PROG(AWK, awk, awk)
314AC_PATH_PROG(SED, sed, sed)
315AC_CHECK_TOOL(AR, ar, ar)
316AC_CHECK_TOOL(RANLIB, ranlib, :)
317AC_CHECK_TOOL(STRIP, strip, :)
318AC_PROG_CC
319AC_PROG_INSTALL
320AC_C_CROSS
Theodore Ts'o5a679c81998-12-03 16:40:38 +0000321AC_CHECK_HEADERS(stdlib.h unistd.h stdarg.h errno.h mntent.h paths.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 +0000322AC_FUNC_VPRINTF
323dnl
324dnl See if struct dirent has a d_namlen field (like bsd systems), implying
325dnl that the actual length of the structure may be grater than the declared
326dnl length.
327dnl
328AC_MSG_CHECKING(whether struct dirent has a d_namlen field)
329AC_CACHE_VAL(e2fsprogs_cv_struct_d_namlen,
330 AC_TRY_COMPILE(
331[#include <sys/types.h>
332#include <dirent.h>],
333 [struct dirent de; de.d_namlen = 0;],
334 [e2fsprogs_cv_struct_d_namlen=yes],
335 [e2fsprogs_cv_struct_d_namlen=no]))
336AC_MSG_RESULT($e2fsprogs_cv_struct_d_namlen)
337if test "$e2fsprogs_cv_struct_d_namlen" = yes; then
338 AC_DEFINE(HAVE_DIRENT_NAMLEN)
339fi
340dnl
Theodore Ts'ob0b9c4d1997-10-20 23:36:30 +0000341dnl Check to see if llseek() is declared in unistd.h. On some libc's
342dnl it is, and on others it isn't..... Thank you glibc developers....
343dnl
344dnl Warning! Use of --enable-gcc-wall may throw off this test.
345dnl
346dnl
347AC_MSG_CHECKING(whether llseek declared in unistd.h)
348AC_CACHE_VAL(e2fsprogs_cv_have_llseek_prototype,
349 AC_TRY_COMPILE(
350[#include <unistd.h>], [extern int llseek(int);],
351 [e2fsprogs_cv_have_llseek_prototype=no],
352 [e2fsprogs_cv_have_llseek_prototype=yes]))
353AC_MSG_RESULT($e2fsprogs_cv_have_llseek_prototype)
354if test "$e2fsprogs_cv_have_llseek_prototype" = yes; then
355 AC_DEFINE(HAVE_LLSEEK_PROTOTYPE)
356fi
357dnl
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000358dnl Word sizes...
359dnl
360if test "$cross_compiling" = yes -a "$ac_cv_sizeof_long" = ""; then
361 # if cross-compiling, with no cached values, just assume something common.
362 ac_cv_sizeof_short=2
363 ac_cv_sizeof_int=4
364 ac_cv_sizeof_long=4
Theodore Ts'ofc6d9d51997-04-29 14:51:31 +0000365 ac_cv_sizeof_long_long=0
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000366 AC_MSG_WARN([Cross-compiling, so cannot check type sizes; assuming short=2, int=4, long=4])
367fi
368AC_CHECK_SIZEOF(short)
369AC_CHECK_SIZEOF(int)
370AC_CHECK_SIZEOF(long)
Theodore Ts'ofc6d9d51997-04-29 14:51:31 +0000371AC_CHECK_SIZEOF(long long)
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000372SIZEOF_SHORT=$ac_cv_sizeof_short
373SIZEOF_INT=$ac_cv_sizeof_int
374SIZEOF_LONG=$ac_cv_sizeof_long
Theodore Ts'ofc6d9d51997-04-29 14:51:31 +0000375SIZEOF_LONG_LONG=$ac_cv_sizeof_long_long
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000376AC_SUBST(SIZEOF_SHORT)
377AC_SUBST(SIZEOF_INT)
378AC_SUBST(SIZEOF_LONG)
Theodore Ts'ofc6d9d51997-04-29 14:51:31 +0000379AC_SUBST(SIZEOF_LONG_LONG)
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000380dnl
381dnl See if struct stat has a st_flags field, in which case we can get file
382dnl flags somewhat portably. Also check for the analogous setter, chflags().
383dnl
384AC_MSG_CHECKING(whether struct stat has a st_flags field)
385AC_CACHE_VAL(e2fsprogs_cv_struct_st_flags,
386 AC_TRY_COMPILE([#include <sys/stat.h>],
387 [struct stat stat; stat.st_flags = 0;],
388 [e2fsprogs_cv_struct_st_flags=yes],
389 [e2fsprogs_cv_struct_st_flags=no]))
390AC_MSG_RESULT($e2fsprogs_cv_struct_st_flags)
391if test "$e2fsprogs_cv_struct_st_flags" = yes; then
392 AC_DEFINE(HAVE_STAT_FLAGS)
393fi
Theodore Ts'ofc6d9d51997-04-29 14:51:31 +0000394AC_CHECK_FUNCS(chflags getrusage llseek strdup getmntinfo strcasecmp srandom fchown)
395dnl
396dnl Check to see if ino_t is defined
397dnl
398AC_MSG_CHECKING(ino_t defined by sys/types.h)
399AC_CACHE_VAL(e2fsprogs_cv_ino_t,
400 AC_TRY_COMPILE([#include <sys/types.h>],
401 [ino_t ino; ino = 0;],
402 [e2fsprogs_cv_ino_t=yes],
403 [e2fsprogs_cv_ino_t=no]))
404AC_MSG_RESULT($e2fsprogs_cv_ino_t)
405if test "$e2fsprogs_cv_ino_t" = yes; then
406 AC_DEFINE(HAVE_INO_T)
407fi
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000408dnl
409dnl On systems without linux header files, we add an extra include directory
410dnl that holds enough to fake it (hopefully). Note that the $(top_srcdir) here
411dnl is quoted so that it gets expanded by make, not by configure.
412dnl
413AC_CHECK_HEADER(linux/fs.h, [linux_headers=yes], [linux_headers=no])
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000414if test "$linux_headers" = yes; then
415 AC_DEFINE(HAVE_LINUX_FS_H)
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000416else
417 LINUX_INCLUDE='-I$(top_srcdir)/include -I$(top_builddir)/include'
418 # Use this include directory with test compiles in the configure script too.
419 CPPFLAGS="$CPPFLAGS -I$srcdir/include -I./include"
420fi
421AC_SUBST(LINUX_INCLUDE)
422dnl
Theodore Ts'ofc6d9d51997-04-29 14:51:31 +0000423dnl Check to see if -lsocket is required (solaris) to make something
424dnl that uses socket() to compile; this is needed for the UUID library
425dnl
426SOCKET_LIB=''
427AC_CHECK_LIB(socket, socket, [SOCKET_LIB=-lsocket])
428AC_SUBST(SOCKET_LIB)
429dnl
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000430dnl See if optreset exists
431dnl
432AC_MSG_CHECKING(for optreset)
433AC_CACHE_VAL(ac_cv_have_optreset,
434[AC_EGREP_HEADER(optreset, unistd.h,
435 ac_cv_have_optreset=yes, ac_cv_have_optreset=no)])dnl
436AC_MSG_RESULT($ac_cv_have_optreset)
437if test $ac_cv_have_optreset = yes; then
438 AC_DEFINE(HAVE_OPTRESET)
439fi
440dnl
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000441dnl See if using the EXT2 ioctls causes a compile-time barf (as on the hurd).
442dnl
443AC_MSG_CHECKING(whether the ext2 ioctls compile)
444AC_CACHE_VAL(e2fsprogs_cv_ioctl_ext2,
445 AC_TRY_COMPILE([#include <linux/ext2_fs.h>
446#include <sys/ioctl.h>],
447 [ioctl (0, EXT2_IOC_SETVERSION, 0);],
448 [e2fsprogs_cv_ioctl_ext2=yes],
449 [e2fsprogs_cv_ioctl_ext2=no]))
450AC_MSG_RESULT($e2fsprogs_cv_ioctl_ext2)
451if test "$e2fsprogs_cv_ioctl_ext2" = yes; then
452 AC_DEFINE(HAVE_EXT2_IOCTLS)
453fi
454dnl
Theodore Ts'oa4b2d3c1998-04-03 16:12:25 +0000455dnl Linux places root files in the / by default
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000456dnl
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000457case "$host_os" in
458linux*)
Theodore Ts'oa4b2d3c1998-04-03 16:12:25 +0000459 if test "$prefix" = NONE -a "$root_prefix" = NONE ; then
460 root_prefix="";
461 echo "On $host_os systems, root_prefix defaults to ''"
Theodore Ts'ofc6d9d51997-04-29 14:51:31 +0000462 fi
463 ;;
464esac
Theodore Ts'ofc6d9d51997-04-29 14:51:31 +0000465dnl
Theodore Ts'oa4b2d3c1998-04-03 16:12:25 +0000466dnl On Linux/hurd, force the prefix to be /usr
Theodore Ts'ofc6d9d51997-04-29 14:51:31 +0000467dnl
468case "$host_os" in
469linux* | gnu*)
470 if test "$prefix" = NONE ; then
Theodore Ts'oa4b2d3c1998-04-03 16:12:25 +0000471 prefix="/usr";
472 echo "On $host_os systems, prefix defaults to /usr"
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000473 fi
474;;
475esac
Theodore Ts'oa4b2d3c1998-04-03 16:12:25 +0000476if test "$root_prefix" = NONE ; then
Theodore Ts'offe19911998-04-08 06:05:49 +0000477 if test "$prefix" = NONE ; then
Theodore Ts'oa4b2d3c1998-04-03 16:12:25 +0000478 root_prefix="$ac_default_prefix"
479 else
480 root_prefix="$prefix"
481 fi
482fi
483AC_SUBST(root_prefix)
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000484dnl
485dnl See if -static works.
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000486dnl
Theodore Ts'oae851481997-04-29 18:13:24 +0000487AC_MSG_CHECKING([whether linker accepts -static])
488AC_CACHE_VAL(ac_cv_e2fsprogs_use_static,
489[SAVE_LDFLAGS=$LDFLAGS; LDFLAGS="$LDFLAGS -static"
490AC_TRY_LINK([#include <stdio.h>],[fflush(stdout);],
491 ac_cv_e2fsprogs_use_static=yes, ac_cv_e2fsprogs_use_static=no)
492LDFLAGS=$SAVE_LDFLAGS])
Theodore Ts'odefde781999-01-04 07:39:19 +0000493dnl
494dnl Regardless of how the test turns out, Solaris doesn't handle -static
495dnl This is caused by the socket library requiring the nsl library, which
496dnl requires the -dl library, which only works for dynamically linked
497dnl programs. It basically means you can't have statically linked programs
498dnl which use the network under Solaris.
499dnl
500case "$host_os" in
501solaris2.*)
502 ac_cv_e2fsprogs_use_static=no
503;;
504esac
Theodore Ts'oae851481997-04-29 18:13:24 +0000505AC_MSG_RESULT($ac_cv_e2fsprogs_use_static)
Theodore Ts'o74becf31997-04-26 14:37:06 +0000506LDFLAG_STATIC=
Theodore Ts'oae851481997-04-29 18:13:24 +0000507if test $ac_cv_e2fsprogs_use_static = yes; then
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000508 LDFLAG_STATIC=-static
Theodore Ts'oae851481997-04-29 18:13:24 +0000509fi
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000510AC_SUBST(LDFLAG_STATIC)
511dnl
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000512dnl Make the ss and et directories work correctly.
513dnl
514SS_DIR=`cd ${srcdir}/lib/ss; pwd`
515ET_DIR=`cd ${srcdir}/lib/et; pwd`
516AC_SUBST(SS_DIR)
517AC_SUBST(ET_DIR)
518dnl
519dnl Only try to run the test suite if we're not cross compiling.
520dnl
521if test "$cross_compiling" = yes ; then
522 DO_TEST_SUITE=
523else
524 DO_TEST_SUITE=check
525fi
526AC_SUBST(DO_TEST_SUITE)
527dnl
Theodore Ts'oa4d09611997-04-29 14:28:00 +0000528dnl
529dnl
530DO_SUBSTITUTE_SCRIPT=$srcdir/lib/do_substitute
531AC_SUBST_FILE(DO_SUBSTITUTE_SCRIPT)
532dnl
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000533dnl Make our output files, being sure that we create the some miscellaneous
534dnl directories
535dnl
536test -d lib || mkdir lib
537test -d include || mkdir include
538test -d include/linux || mkdir include/linux
Theodore Ts'odefde781999-01-04 07:39:19 +0000539test -d include/asm || mkdir include/asm
Theodore Ts'o24b2c7a1997-06-07 20:42:58 +0000540rmakefile=
541if test -d ${srcdir}/resize ; then
542 rmakefile=resize/Makefile
543fi
Theodore Ts'o44339bd1997-10-15 02:47:20 +0000544AC_OUTPUT(MCONFIG Makefile util/Makefile util/subst.conf lib/et/Makefile
Theodore Ts'ofc6d9d51997-04-29 14:51:31 +0000545 lib/ss/Makefile lib/ext2fs/Makefile lib/e2p/Makefile lib/uuid/Makefile
546 misc/Makefile e2fsck/Makefile debugfs/Makefile tests/Makefile
Theodore Ts'o24b2c7a1997-06-07 20:42:58 +0000547 tests/progs/Makefile $rmakefile doc/Makefile)