Release: captive1 -> captive2cvs
[ntfsprogs.git] / configure.ac
1 AC_PREREQ(2.57)
2 AC_INIT(TODO.libntfs)
3 AC_CANONICAL_TARGET([])
4 AC_CONFIG_SRCDIR([config.h.in])
5 AM_CONFIG_HEADER([config.h])
6 VERSION_BASE=200309071734
7 VERSION_EXT=captive2cvs
8 AC_SUBST(VERSION_BASE)
9 AC_SUBST(VERSION_EXT)
10 AM_INIT_AUTOMAKE(ntfsprogs,$VERSION_BASE$VERSION_EXT)
11
12 # This is required to get past a stupid configure bug when making the rpm.
13 # Basically it is broken to specify the host as a command line argument to
14 # configure on its own, i.e. without giving --host=. It is supposed to work
15 # but doesn't. So this sets host and erases nonopt effectively moving the
16 # standalone command line option into the --host= form.
17 if test "x$nonopt" != "xNONE"; then
18   host="$nonopt"
19   nonopt="NONE"
20 fi
21
22 AM_MAINTAINER_MODE
23 if test "$USE_MAINTAINER_MODE" = "yes";then
24   CFLAGS="$CFLAGS -ggdb3 -Wall -Wstrict-prototypes -Wsign-compare"  ## FIXME: fix all sources: -Wsign-compare
25   fi
26
27 AC_PREFIX_DEFAULT(/usr/local)
28 if test "x$prefix" = "xNONE"; then
29   prefix=$ac_default_prefix
30   ac_configure_args="$ac_configure_args --prefix $prefix"
31 fi
32
33 # Command-line options.
34 AC_ARG_ENABLE(debug,
35         [  --enable-debug          enable debugging], ,
36         enable_debug=no
37 )
38
39 AC_ARG_ENABLE(really-static,
40         [  --enable-really-static  completely static binaries], ,
41         enable_really_static=no
42 )
43
44 AM_CONDITIONAL(DEBUG, test "$enable_debug" = yes)
45 AM_CONDITIONAL(REALLYSTATIC, test "$enable_really_static" = yes)
46
47 # Checks for programs.
48 AC_PROG_CC
49 AC_PROG_INSTALL
50 AC_PROG_LN_S
51 AC_PROG_MAKE_SET
52
53 # create a working libtool-script
54 if test -z "$LIBTOOL"; then
55   AC_LANG_PUSH(C)
56   AM_PROG_LIBTOOL
57   #LIBTOOL="$LIBTOOL --silent"
58   AC_LANG_POP
59   AC_SUBST(LIBTOOL_DEPS)
60   LIBTOOL_SHELL='/bin/sh ./libtool'
61 else
62   LIBTOOL_SHELL=$LIBTOOL
63 fi
64
65 # add --with-extra-includes and --with-extra-libs switch to ./configure
66 all_libraries="$all_libraries $USER_LDFLAGS"
67 all_includes="$all_includes $USER_INCLUDES"
68 AC_SUBST(all_includes)
69 AC_SUBST(all_libraries)
70
71 AC_SUBST(CFLAGS)
72 AC_SUBST(CPPFLAGS)
73 AC_SUBST(LDFLAGS)
74
75 AC_SUBST(AUTODIRS)
76
77 # Get compiler name
78 if test ! -z "$CC"; then
79         _cc="$CC"
80 else
81         _cc="gcc"
82 fi
83
84 # Check for gcc version being >= 2.96.
85 AC_MSG_CHECKING(version of $_cc)
86 cc_version=`./getgccver $_cc`
87 cc_major=`echo $cc_version | cut -d'.' -f1`
88 cc_minor=`echo $cc_version | cut -d'.' -f2`
89 if test -z "$cc_version"; then
90         cc_version="v. ?.??"
91         cc_major=1
92         cc_minor=1
93 fi
94 if test $cc_major -lt 2 -o \( $cc_major -eq 2 -a $cc_minor -lt 96 \) ; then
95 cc_version="$cc_version, bad"
96 AC_MSG_RESULT($cc_version)
97 AC_MSG_ERROR(Please upgrade your gcc compiler to gcc-2.96+ or gcc-3+ version!\
98  Earlier compiler versions will NOT work as these do not support \
99 unnamed/annonymous structures and unions which are used heavily in linux-ntfs.)
100 fi
101 cc_version="$cc_version, ok"
102 AC_MSG_RESULT($cc_version)
103
104 # Add -fms-extensions for gcc-3.2+.
105 AM_CONDITIONAL(GCC_NEEDS_MS_EXTENSIONS, test $cc_major -gt 3 -o \( $cc_major -eq 3 -a $cc_minor -ge 2 \))
106
107 # Checks for libraries.
108
109 # Checks for header files.
110 AC_HEADER_STDC
111 AC_CHECK_HEADERS([fcntl.h libintl.h limits.h locale.h mntent.h stddef.h \
112         stdint.h stdlib.h stdio.h stdarg.h string.h strings.h errno.h time.h \
113         sys/ioctl.h sys/mount.h unistd.h utime.h wchar.h getopt.h sys/stat.h \
114         sys/types.h asm/byteorder.h linux/major.h linux/fd.h])
115
116 # Checks for typedefs, structures, and compiler characteristics.
117 AC_HEADER_STDBOOL
118 AC_C_CONST
119 AC_C_INLINE
120 AC_C_LONG_DOUBLE
121 AC_TYPE_OFF_T
122 AC_TYPE_SIZE_T
123 AC_STRUCT_ST_BLOCKS
124 AC_CHECK_MEMBERS([struct stat.st_rdev])
125
126 # Checks for library functions.
127 AC_FUNC_GETMNTENT
128 AC_PROG_GCC_TRADITIONAL
129 AC_FUNC_MALLOC
130 AC_FUNC_MBRTOWC
131 AC_FUNC_MEMCMP
132 AC_FUNC_REALLOC
133 AC_FUNC_STAT
134 AC_FUNC_STRFTIME
135 AC_FUNC_UTIME_NULL
136 AC_FUNC_VPRINTF
137 AC_CHECK_FUNCS([atexit fdatasync hasmntopt memmove memset regcomp setlocale \
138         strcasecmp strchr strdup strerror strtol strtoul utime])
139
140 # Makefiles to be created by configure.
141 AC_CONFIG_FILES([
142         Makefile
143         doc/Makefile
144         include/Makefile
145         libntfs/Makefile
146         ntfsprogs/Makefile
147         ntfsprogs/mkntfs.8
148         ntfsprogs/ntfsfix.8
149         ntfsprogs/ntfsinfo.8
150         ntfsprogs/ntfslabel.8
151         ntfsprogs/ntfsprogs.8
152         ntfsprogs/ntfsresize.8
153         ntfsprogs/ntfsundelete.8
154         ntfsprogs/ntfscluster.8
155         ntfsprogs.spec
156         debian/changelog
157 ])
158 AC_OUTPUT