]> git.ipfire.org Git - thirdparty/e2fsprogs.git/blame - configure.in
Makefile.in:
[thirdparty/e2fsprogs.git] / configure.in
CommitLineData
50e1e10f 1AC_INIT(version.h)
a4b2d3ce 2AC_PREREQ(2.12)
50e1e10f
TT
3MCONFIG=./MCONFIG
4AC_SUBST_FILE(MCONFIG)
74becf3c
TT
5BINARY_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
40fa8cc9
TT
16if expr $YEAR ">" 1900 > /dev/null ; then
17 E2FSPROGS_YEAR=$YEAR
18elif expr $YEAR ">" 90 >/dev/null ; then
74becf3c
TT
19 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)
fc6d9d51 46AC_REQUIRE([AC_CANONICAL_HOST])
74becf3c
TT
47dnl
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])
73ae2d4a 58AC_PROG_CC
74becf3c
TT
59dnl
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)
877eb6d9
TT
76CFLAGS=$withval,
77)dnl
74becf3c 78dnl
f8bd9807
TT
79dnl On systems without linux header files, we add an extra include directory
80dnl that holds enough to fake it (hopefully). Note that the $(top_srcdir) here
81dnl is quoted so that it gets expanded by make, not by configure.
82dnl
83AC_CHECK_HEADER(linux/fs.h, [linux_headers=yes], [linux_headers=no])
73ae2d4a
TT
84if test "$linux_headers" != yes; then
85 LINUX_INCLUDE='-I$(top_builddir)/include'
f8bd9807
TT
86fi
87AC_SUBST(LINUX_INCLUDE)
88dnl
a4d09610
TT
89dnl Set default values for library extentions. Will be dealt with after
90dnl parsing configuration opions, which may modify these
91dnl
92LIB_EXT=.a
93STATIC_LIB_EXT=.a
94PROFILE_LIB_EXT=.a
95dnl
74becf3c
TT
96dnl set $(LDFLAGS) from --with-ldopts=value
97dnl
98AC_ARG_WITH([ldopts],
99[ --with-ldopts=LDOPTS select linker command line options],
100AC_MSG_RESULT(LDFLAGS is $withval)
101LDFLAGS=$withval,
102LDFLAGS=)dnl
103AC_SUBST(LDFLAGS)
50e1e10f 104dnl
a4b2d3ce 105dnl Allow separate `root_prefix' to be specified
fc6d9d51 106dnl
a4b2d3ce
TT
107AC_ARG_WITH([root-prefix],
108[ --with-root-prefix=PREFIX override prefix variable for files to be placed in the root],
109root_prefix=$withval,
110root_prefix=NONE)dnl
fc6d9d51 111dnl
1917875f
TT
112dnl handle --enable-compression
113dnl
114AC_ARG_ENABLE([compression],
115[ --enable-compression enable EXPERIMENTAL compression support],
116if test "$enableval" = "no"
117then
118 echo "Disabling compression support"
119else
120 AC_DEFINE(ENABLE_COMPRESSION)
121 echo "Enabling compression support"
122 echo "WARNING: Compression support is experimental"
123fi
124,
125echo "Disabling compression support by default"
126)
127dnl
50e1e10f
TT
128dnl handle --enable-dll-shlibs
129dnl
130AC_ARG_ENABLE([dll-shlibs],
a4d09610 131[ --enable-dll-shlibs select DLL libraries],
50e1e10f
TT
132if test "$enableval" = "no"
133then
134 DLL_CMT=#
135 MAKEFILE_DLL=/dev/null
136 echo "Disabling DLL shared libraries"
137else
138 DLL_CMT=
139 MAKEFILE_DLL=$srcdir/lib/Makefile.dll-lib
74becf3c 140 BINARY_TYPE=dllbin
a4d09610 141 LIB_EXT=.sa
50e1e10f
TT
142 echo "Enabling DLL shared libraries"
143fi
144,
145MAKEFILE_DLL=/dev/null
146DLL_CMT=#
147echo "Disabling DLL shared libraries by default"
148)
149AC_SUBST(DLL_CMT)
150AC_SUBST_FILE(MAKEFILE_DLL)
151dnl
152dnl handle --enable-elf-shlibs
153dnl
154AC_ARG_ENABLE([elf-shlibs],
a4d09610 155[ --enable-elf-shlibs select ELF shared libraries],
50e1e10f
TT
156if test "$enableval" = "no"
157then
158 ELF_CMT=#
159 MAKEFILE_ELF=/dev/null
160 echo "Disabling ELF shared libraries"
161else
162 ELF_CMT=
163 MAKEFILE_ELF=$srcdir/lib/Makefile.elf-lib
f5955dda
TT
164 [case "$host_os" in
165 solaris2.*)
166 MAKEFILE_ELF=$srcdir/lib/Makefile.solaris-lib
167 ;;
168 esac]
74becf3c 169 BINARY_TYPE=elfbin
a4d09610 170 LIB_EXT=.so
50e1e10f
TT
171 echo "Enabling ELF shared libraries"
172fi
173,
174MAKEFILE_ELF=/dev/null
175ELF_CMT=#
176echo "Disabling ELF shared libraries by default"
177)
178AC_SUBST(ELF_CMT)
179AC_SUBST_FILE(MAKEFILE_ELF)
180dnl
181dnl handle --enable-bsd-shlibs
182dnl
183AC_ARG_ENABLE([bsd-shlibs],
a4d09610 184[ --enable-bsd-shlibs select BSD shared libraries],
50e1e10f
TT
185if test "$enableval" = "no"
186then
187 BSDLIB_CMT=#
188 MAKEFILE_BSDLIB=/dev/null
189 echo "Disabling BSD shared libraries"
190else
191 BSDLIB_CMT=
192 MAKEFILE_BSDLIB=$srcdir/lib/Makefile.bsd-lib
a4d09610 193 LIB_EXT=.so
50e1e10f
TT
194 echo "Enabling BSD shared libraries"
195fi
196,
197MAKEFILE_BSDLIB=/dev/null
198BSDLIB_CMT=#
199echo "Disabling BSD shared libraries by default"
200)
201AC_SUBST(BSDLIB_CMT)
202AC_SUBST_FILE(MAKEFILE_BSDLIB)
203dnl
80bfaa3e
TT
204dnl handle --enable-jfs-debug
205dnl
206AC_ARG_ENABLE([jfs-debug],
207[ --enable-jfs-debug enable journal debugging],
208if test "$enableval" = "no"
209then
210 echo "Disabling journal debugging"
211else
212 AC_DEFINE(JFS_DEBUG)
213 echo "Enabling journal debugging"
214fi
215,
216echo "Disabling journal debugging by default"
217)
218dnl
877eb6d9
TT
219dnl handle --enable-swapfs
220dnl
221AC_ARG_ENABLE([swapfs],
222[ --disable-swapfs disable support of legacy byte-swapped filesystems],
223if test "$enableval" = "no"
224then
225 echo "Disabling swapfs support"
226 SWAPFS_CMT="#"
227else
228 AC_DEFINE(ENABLE_SWAPFS)
229 SWAPFS_CMT=
230 echo "Enabling swapfs support"
231fi
232,
233echo "Enabling swapfs support by default"
234AC_DEFINE(ENABLE_SWAPFS)
235SWAPFS_CMT=
236)
237AC_SUBST(SWAPFS_CMT)
238dnl
a64c9c13
TT
239dnl Add internationalization support, using gettext.
240dnl
241PACKAGE=e2fsprogs
242VERSION="$E2FSPROGS_VERSION"
243AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE")
244AC_DEFINE_UNQUOTED(VERSION, "$VERSION")
245AC_SUBST(PACKAGE)
246AC_SUBST(VERSION)
247
1917875f 248ALL_LINGUAS="it nyc"
a64c9c13
TT
249AM_GNU_GETTEXT
250dnl
50e1e10f
TT
251dnl handle --enable-profile
252dnl
253AC_ARG_ENABLE([profile],
a4d09610 254[ --enable-profile build profiling libraries],
50e1e10f
TT
255if test "$enableval" = "no"
256then
257 PROFILE_CMT=#
258 MAKEFILE_PROFILE=/dev/null
259 echo "Disabling profiling libraries"
260else
261 PROFILE_CMT=
262 MAKEFILE_PROFILE=$srcdir/lib/Makefile.profile
a4d09610 263 PROFILED_LIB_EXT=_p.a
50e1e10f
TT
264 echo "Building profiling libraries"
265fi
266,
267PROFILE_CMT=#
268MAKEFILE_PROFILE=/dev/null
269echo "Disabling profiling libraries by default"
270)
271AC_SUBST(PROFILE_CMT)
272AC_SUBST_FILE(MAKEFILE_PROFILE)
273dnl
274dnl handle --enable-checker
275dnl
276AC_ARG_ENABLE([checker],
a4d09610 277[ --enable-checker build checker libraries],
50e1e10f
TT
278if test "$enableval" = "no"
279then
280 CHECKER_CMT=#
281 MAKEFILE_CHECKER=/dev/null
282 echo "Disabling checker libraries"
283else
284 CHECKER_CMT=
285 MAKEFILE_CHECKER=$srcdir/lib/Makefile.checker
286 echo "Building checker libraries"
287fi
288,
289CHECKER_CMT=#
290MAKEFILE_CHECKER=/dev/null
291echo "Disabling checker libraries by default"
292)
293AC_SUBST(CHECKER_CMT)
294AC_SUBST_FILE(MAKEFILE_CHECKER)
295dnl
a4d09610
TT
296dnl Substitute library extensions
297dnl
298AC_SUBST(LIB_EXT)
299AC_SUBST(STATIC_LIB_EXT)
300AC_SUBST(PROFILED_LIB_EXT)
301dnl
4d0f3e17 302dnl handle --enable-dynamic-e2fsck
50e1e10f 303dnl
a4d09610
TT
304AC_ARG_ENABLE([dynamic-e2fsck],
305[ --enable-dynamic-e2fsck build e2fsck dynamically],
306if test "$enableval" = "no"
307then
308 E2FSCK_TYPE=static
309 echo "Building e2fsck statically"
310else
311 E2FSCK_TYPE=shared
312 echo "Building e2fsck dynamically"
313fi
314,
315E2FSCK_TYPE=static
316echo "Building e2fsck statically by default"
317)
318AC_SUBST(E2FSCK_TYPE)
50e1e10f 319dnl
fc6d9d51
TT
320dnl See whether to install the `fsck' wrapper program (that calls e2fsck)
321dnl
322AC_ARG_ENABLE([fsck],
323[ --enable-fsck build fsck wrapper program],
324[if test "$enableval" = "no"
325then
326 FSCK_PROG='' FSCK_MAN=''
327 echo "Not building fsck wrapper"
328else
329 FSCK_PROG=fsck FSCK_MAN=fsck.8
330 echo "Building fsck wrapper"
331fi]
332,
333[case "$host_os" in
334 gnu*)
335 FSCK_PROG='' FSCK_MAN=''
336 echo "Not building fsck wrapper by default"
337 ;;
338 *)
339 FSCK_PROG=fsck FSCK_MAN=fsck.8
340 echo "Building fsck wrapper by default"
341esac]
342)
343AC_SUBST(FSCK_PROG)
344AC_SUBST(FSCK_MAN)
345dnl
50e1e10f
TT
346dnl
347MAKEFILE_LIBRARY=$srcdir/lib/Makefile.library
348AC_SUBST_FILE(MAKEFILE_LIBRARY)
349dnl
fc6d9d51
TT
350dnl
351AC_ARG_ENABLE([old-bitops],
352[ --enable-old-bitops Use old (non-standard but native) bitmask operations],
353if test "$enableval" = "no"
354then
355 echo "Using new (standard) bitmask operations"
356else
357 AC_DEFINE(EXT2_OLD_BITOPS)
358 echo "Using old (native) bitmask operations"
359
360fi
361,
362echo "Using standard bitmask operations by default"
363)
364dnl
50e1e10f
TT
365dnl End of configuration options
366dnl
74becf3c 367AC_SUBST(BINARY_TYPE)
50e1e10f
TT
368AC_PROG_MAKE_SET
369AC_PATH_PROG(LN, ln, ln)
fc6d9d51 370AC_PROG_LN_S
50e1e10f
TT
371AC_PATH_PROG(MV, mv, mv)
372AC_PATH_PROG(CP, cp, cp)
373AC_PATH_PROG(RM, rm, rm)
374AC_PATH_PROG(CHMOD, chmod, :)
375AC_PATH_PROG(AWK, awk, awk)
376AC_PATH_PROG(SED, sed, sed)
9d564f73 377AC_PATH_PROG(PERL, perl, perl)
250f79f0 378AC_PATH_PROG(LDCONFIG, ldconfig, :)
50e1e10f
TT
379AC_CHECK_TOOL(AR, ar, ar)
380AC_CHECK_TOOL(RANLIB, ranlib, :)
381AC_CHECK_TOOL(STRIP, strip, :)
50e1e10f 382AC_PROG_INSTALL
6c133523
TT
383# See if we need a separate native compiler.
384if test $cross_compiling = no; then
385 BUILD_CC="$CC"
386 AC_SUBST(BUILD_CC)
387else
388 AC_CHECK_PROGS(BUILD_CC, gcc cc)
389fi
4d0f3e17 390AC_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/ioctl.h sys/mkdev.h sys/mount.h sys/sockio.h sys/sysmacros.h sys/time.h sys/stat.h sys/types.h net/if.h netinet/in.h)
50e1e10f
TT
391AC_FUNC_VPRINTF
392dnl
393dnl See if struct dirent has a d_namlen field (like bsd systems), implying
394dnl that the actual length of the structure may be grater than the declared
395dnl length.
396dnl
397AC_MSG_CHECKING(whether struct dirent has a d_namlen field)
398AC_CACHE_VAL(e2fsprogs_cv_struct_d_namlen,
399 AC_TRY_COMPILE(
400[#include <sys/types.h>
401#include <dirent.h>],
402 [struct dirent de; de.d_namlen = 0;],
403 [e2fsprogs_cv_struct_d_namlen=yes],
404 [e2fsprogs_cv_struct_d_namlen=no]))
405AC_MSG_RESULT($e2fsprogs_cv_struct_d_namlen)
406if test "$e2fsprogs_cv_struct_d_namlen" = yes; then
407 AC_DEFINE(HAVE_DIRENT_NAMLEN)
408fi
409dnl
b0b9c4de
TT
410dnl Check to see if llseek() is declared in unistd.h. On some libc's
411dnl it is, and on others it isn't..... Thank you glibc developers....
412dnl
413dnl Warning! Use of --enable-gcc-wall may throw off this test.
414dnl
415dnl
416AC_MSG_CHECKING(whether llseek declared in unistd.h)
417AC_CACHE_VAL(e2fsprogs_cv_have_llseek_prototype,
418 AC_TRY_COMPILE(
419[#include <unistd.h>], [extern int llseek(int);],
420 [e2fsprogs_cv_have_llseek_prototype=no],
421 [e2fsprogs_cv_have_llseek_prototype=yes]))
422AC_MSG_RESULT($e2fsprogs_cv_have_llseek_prototype)
423if test "$e2fsprogs_cv_have_llseek_prototype" = yes; then
424 AC_DEFINE(HAVE_LLSEEK_PROTOTYPE)
425fi
426dnl
6928adc9
TT
427dnl Check to see if lseek64() is declared in unistd.h. Glibc's header files
428dnl are so convoluted that I can't tell whether it will always be defined,
429dnl and if it isn't defined while lseek64 is defined in the library,
430dnl disaster will strike.
431dnl
432dnl Warning! Use of --enable-gcc-wall may throw off this test.
433dnl
434dnl
435AC_MSG_CHECKING(whether lseek64 declared in unistd.h)
436AC_CACHE_VAL(e2fsprogs_cv_have_lseek64_prototype,
437 AC_TRY_COMPILE(
438[#define _LARGEFILE_SOURCE
439#define _LARGEFILE64_SOURCE
440#include <unistd.h>], [extern int lseek64(int);],
441 [e2fsprogs_cv_have_lseek64_prototype=no],
442 [e2fsprogs_cv_have_lseek64_prototype=yes]))
443AC_MSG_RESULT($e2fsprogs_cv_have_lseek64_prototype)
444if test "$e2fsprogs_cv_have_lseek64_prototype" = yes; then
445 AC_DEFINE(HAVE_LSEEK64_PROTOTYPE)
446fi
447dnl
50e1e10f
TT
448dnl Word sizes...
449dnl
450if test "$cross_compiling" = yes -a "$ac_cv_sizeof_long" = ""; then
451 # if cross-compiling, with no cached values, just assume something common.
452 ac_cv_sizeof_short=2
453 ac_cv_sizeof_int=4
454 ac_cv_sizeof_long=4
6c133523
TT
455 ac_cv_sizeof_long_long=8
456 AC_MSG_WARN([Cross-compiling, so cannot check type sizes; assuming short=2, int=4, long=4, long long=8])
50e1e10f
TT
457fi
458AC_CHECK_SIZEOF(short)
459AC_CHECK_SIZEOF(int)
460AC_CHECK_SIZEOF(long)
fc6d9d51 461AC_CHECK_SIZEOF(long long)
50e1e10f
TT
462SIZEOF_SHORT=$ac_cv_sizeof_short
463SIZEOF_INT=$ac_cv_sizeof_int
464SIZEOF_LONG=$ac_cv_sizeof_long
fc6d9d51 465SIZEOF_LONG_LONG=$ac_cv_sizeof_long_long
50e1e10f
TT
466AC_SUBST(SIZEOF_SHORT)
467AC_SUBST(SIZEOF_INT)
468AC_SUBST(SIZEOF_LONG)
fc6d9d51 469AC_SUBST(SIZEOF_LONG_LONG)
877eb6d9 470AC_C_BIGENDIAN
50e1e10f
TT
471dnl
472dnl See if struct stat has a st_flags field, in which case we can get file
473dnl flags somewhat portably. Also check for the analogous setter, chflags().
474dnl
475AC_MSG_CHECKING(whether struct stat has a st_flags field)
476AC_CACHE_VAL(e2fsprogs_cv_struct_st_flags,
477 AC_TRY_COMPILE([#include <sys/stat.h>],
478 [struct stat stat; stat.st_flags = 0;],
479 [e2fsprogs_cv_struct_st_flags=yes],
480 [e2fsprogs_cv_struct_st_flags=no]))
481AC_MSG_RESULT($e2fsprogs_cv_struct_st_flags)
482if test "$e2fsprogs_cv_struct_st_flags" = yes; then
c03bc4e8
TT
483 AC_MSG_CHECKING(whether st_flags field is useful)
484 AC_CACHE_VAL(e2fsprogs_cv_struct_st_flags_immut,
485 AC_TRY_COMPILE([#include <sys/stat.h>],
486 [struct stat stat; stat.st_flags |= UF_IMMUTABLE;],
487 [e2fsprogs_cv_struct_st_flags_immut=yes],
488 [e2fsprogs_cv_struct_st_flags_immut=no]))
489 AC_MSG_RESULT($e2fsprogs_cv_struct_st_flags_immut)
490 if test "$e2fsprogs_cv_struct_st_flags_immut" = yes; then
491 AC_DEFINE(HAVE_STAT_FLAGS)
492 fi
50e1e10f 493fi
6928adc9 494AC_CHECK_FUNCS(chflags getrusage llseek lseek64 open64 strdup getmntinfo strcasecmp srandom fchown mallinfo fdatasync)
fc6d9d51 495dnl
fc6d9d51
TT
496dnl Check to see if -lsocket is required (solaris) to make something
497dnl that uses socket() to compile; this is needed for the UUID library
498dnl
499SOCKET_LIB=''
500AC_CHECK_LIB(socket, socket, [SOCKET_LIB=-lsocket])
501AC_SUBST(SOCKET_LIB)
502dnl
50e1e10f
TT
503dnl See if optreset exists
504dnl
505AC_MSG_CHECKING(for optreset)
506AC_CACHE_VAL(ac_cv_have_optreset,
507[AC_EGREP_HEADER(optreset, unistd.h,
508 ac_cv_have_optreset=yes, ac_cv_have_optreset=no)])dnl
509AC_MSG_RESULT($ac_cv_have_optreset)
510if test $ac_cv_have_optreset = yes; then
511 AC_DEFINE(HAVE_OPTRESET)
512fi
513dnl
8f3f29d3
TT
514dnl We use the EXT2 ioctls only under Linux
515dnl
516case "$host_os" in
517linux*)
518 AC_DEFINE(HAVE_EXT2_IOCTLS)
519 ;;
520esac
50e1e10f 521dnl
6c133523 522dnl Linux and Hurd places root files in the / by default
50e1e10f 523dnl
50e1e10f 524case "$host_os" in
6c133523 525linux* | gnu*)
a4b2d3ce
TT
526 if test "$prefix" = NONE -a "$root_prefix" = NONE ; then
527 root_prefix="";
528 echo "On $host_os systems, root_prefix defaults to ''"
fc6d9d51
TT
529 fi
530 ;;
531esac
fc6d9d51 532dnl
a4b2d3ce 533dnl On Linux/hurd, force the prefix to be /usr
fc6d9d51
TT
534dnl
535case "$host_os" in
536linux* | gnu*)
537 if test "$prefix" = NONE ; then
a4b2d3ce
TT
538 prefix="/usr";
539 echo "On $host_os systems, prefix defaults to /usr"
50e1e10f
TT
540 fi
541;;
542esac
a4b2d3ce 543if test "$root_prefix" = NONE ; then
ffe1991f 544 if test "$prefix" = NONE ; then
a4b2d3ce
TT
545 root_prefix="$ac_default_prefix"
546 else
547 root_prefix="$prefix"
548 fi
549fi
550AC_SUBST(root_prefix)
50e1e10f
TT
551dnl
552dnl See if -static works.
50e1e10f 553dnl
ae851482
TT
554AC_MSG_CHECKING([whether linker accepts -static])
555AC_CACHE_VAL(ac_cv_e2fsprogs_use_static,
556[SAVE_LDFLAGS=$LDFLAGS; LDFLAGS="$LDFLAGS -static"
557AC_TRY_LINK([#include <stdio.h>],[fflush(stdout);],
558 ac_cv_e2fsprogs_use_static=yes, ac_cv_e2fsprogs_use_static=no)
559LDFLAGS=$SAVE_LDFLAGS])
defde784
TT
560dnl
561dnl Regardless of how the test turns out, Solaris doesn't handle -static
562dnl This is caused by the socket library requiring the nsl library, which
563dnl requires the -dl library, which only works for dynamically linked
564dnl programs. It basically means you can't have statically linked programs
565dnl which use the network under Solaris.
566dnl
567case "$host_os" in
568solaris2.*)
569 ac_cv_e2fsprogs_use_static=no
570;;
571esac
ae851482 572AC_MSG_RESULT($ac_cv_e2fsprogs_use_static)
74becf3c 573LDFLAG_STATIC=
ae851482 574if test $ac_cv_e2fsprogs_use_static = yes; then
50e1e10f 575 LDFLAG_STATIC=-static
ae851482 576fi
50e1e10f
TT
577AC_SUBST(LDFLAG_STATIC)
578dnl
50e1e10f
TT
579dnl Make the ss and et directories work correctly.
580dnl
581SS_DIR=`cd ${srcdir}/lib/ss; pwd`
582ET_DIR=`cd ${srcdir}/lib/et; pwd`
583AC_SUBST(SS_DIR)
584AC_SUBST(ET_DIR)
585dnl
586dnl Only try to run the test suite if we're not cross compiling.
587dnl
588if test "$cross_compiling" = yes ; then
589 DO_TEST_SUITE=
590else
591 DO_TEST_SUITE=check
592fi
593AC_SUBST(DO_TEST_SUITE)
594dnl
595dnl Make our output files, being sure that we create the some miscellaneous
596dnl directories
597dnl
598test -d lib || mkdir lib
599test -d include || mkdir include
600test -d include/linux || mkdir include/linux
defde784 601test -d include/asm || mkdir include/asm
24b2c7a7
TT
602rmakefile=
603if test -d ${srcdir}/resize ; then
604 rmakefile=resize/Makefile
605fi
44339bdf 606AC_OUTPUT(MCONFIG Makefile util/Makefile util/subst.conf lib/et/Makefile
fc6d9d51
TT
607 lib/ss/Makefile lib/ext2fs/Makefile lib/e2p/Makefile lib/uuid/Makefile
608 misc/Makefile e2fsck/Makefile debugfs/Makefile tests/Makefile
a64c9c13
TT
609 tests/progs/Makefile $rmakefile doc/Makefile
610 intl/Makefile po/Makefile.in)