2 # configure.ac - Source file to generate "./configure" to prepare package for
5 # Copyright (c) 2000-2006 Anton Altaparmakov
6 # Copyright (c) 2005-2009 Szabolcs Szakacsits
7 # Copyright (C) 2007-2008 Alon Bar-Lev
9 # This program/include file is free software; you can redistribute it and/or
10 # modify it under the terms of the GNU General Public License as published
11 # by the Free Software Foundation; either version 2 of the License, or
12 # (at your option) any later version.
14 # This program/include file is distributed in the hope that it will be
15 # useful, but WITHOUT ANY WARRANTY; without even the implied warranty
16 # of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 # GNU General Public License for more details.
19 # You should have received a copy of the GNU General Public License
20 # along with this program (in the main directory of the NTFS-3G
21 # distribution in the file COPYING); if not, write to the Free Software
22 # Foundation,Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
26 AC_INIT([ntfs-3g],[2010.3.6],[ntfs-3g-devel@lists.sf.net])
27 LIBNTFS_3G_VERSION="75"
28 AC_CONFIG_SRCDIR([src/ntfs-3g.c])
35 AM_INIT_AUTOMAKE([${PACKAGE_NAME}], [${PACKAGE_VERSION}])
36 AC_CONFIG_HEADERS([config.h])
37 AC_CONFIG_MACRO_DIR([m4])
43 [AS_HELP_STRING([--enable-debug],[enable debugging code and output])],
50 [AS_HELP_STRING([--enable-warnings],[enable lots of compiler warnings])],
52 [enable_warnings="no"]
57 [AS_HELP_STRING([--enable-pedantic],[enable compile pedantic mode])],
59 [enable_pedantic="no"]
64 [AS_HELP_STRING([--enable-really-static],[create fully static binaries])],
66 [enable_really_static="no"]
71 [AS_HELP_STRING([--enable-mount-helper],[install mount helper @<:@default=enabled for linux@:>@])],
74 case "${target_os}" in
75 linux*) enable_mount_helper="yes" ;;
76 *) enable_mount_helper="no" ;;
83 [AS_HELP_STRING([--enable-ldscript],[use ldscript instead of .so symlink])],
85 [enable_ldscript="no"]
90 [AS_HELP_STRING([--disable-ldconfig],[do not update dynamic linker cache using ldconfig])],
92 [enable_ldconfig="yes"]
97 [AS_HELP_STRING([--disable-library],[do not install libntfs-3g but link it into ntfs-3g])],
99 [enable_library="yes"]
104 [AS_HELP_STRING([--disable-mtab],[disable and ignore usage of /etc/mtab])],
111 [AS_HELP_STRING([--enable-posix-acls],[enable POSIX ACL support])],
113 [enable_posix_acls="no"]
117 [device-default-io-ops],
118 [AS_HELP_STRING([--disable-device-default-io-ops],[install default IO ops])],
120 [enable_device_default_io_ops="yes"]
125 [AS_HELP_STRING([--disable-nfconv],[disable the 'nfconv' patch, which adds support for Unicode normalization form conversion when built on Mac OS X @<:@default=enabled for Mac OS X@:>@])],
126 [enable_nfconv="no"],
128 case "${target_os}" in
129 darwin*) enable_nfconv="yes" ;;
130 *) enable_nfconv="no" ;;
135 # pthread_rwlock_t requires _GNU_SOURCE
149 AC_PATH_PROG([MV], [mv])
150 AC_PATH_PROG([RM], [rm])
151 AC_PATH_PROG([SED], [sed])
152 AC_ARG_VAR([LDCONFIG], [ldconfig utility])
153 AC_PATH_PROG([LDCONFIG], [ldconfig], [true], [/sbin /usr/sbin $PATH])
156 AC_MSG_CHECKING([Windows OS])
158 *-mingw32*|*-winnt*|*-cygwin*)
164 [Define to 1 if this is a Windows OS]
173 AC_MSG_CHECKING([fuse compatibility])
174 case "${target_os}" in
178 [AS_HELP_STRING([--with-fuse=<internal|external>],[Select FUSE library: internal or external @<:@default=internal@:>@])],
180 [with_fuse="internal"]
183 darwin*|netbsd*|solaris*)
187 AC_MSG_ERROR([Please see FreeBSD support at http://www.freshports.org/sysutils/fusefs-ntfs])
190 AC_MSG_ERROR([ntfs-3g can be built for Linux, FreeBSD, Mac OS X, NetBSD, and Solaris only.])
193 AC_MSG_RESULT([${with_fuse}])
195 case "${target_os}" in
197 if test "x$GCC" != "xyes" ; then
198 AC_MSG_ERROR([ntfs-3g can be built only with gcc on Solaris. Install it by 'pkg install gcc-dev' and retry.)])
203 if test "${enable_ldscript}" = "yes"; then
204 AC_MSG_CHECKING([Output format])
205 OUTPUT_FORMAT="$(${CC} ${CFLAGS} ${LDFLAGS} -Wl,--verbose 2>&1 | ${SED} -n 's/^OUTPUT_FORMAT("\([[^"]]*\)",.*/\1/p')"
206 if test -z "${OUTPUT_FORMAT}"; then
207 AC_MSG_RESULT([None])
209 AC_MSG_RESULT([${OUTPUT_FORMAT}])
210 OUTPUT_FORMAT="OUTPUT_FORMAT ( ${OUTPUT_FORMAT} )"
215 if test "${with_fuse}" = "internal"; then
219 [LIBFUSE_LITE_LIBS="${LIBFUSE_LITE_LIBS} -lpthread"],
220 [AC_MSG_ERROR([Cannot find pthread library])]
225 [Required define if using POSIX threads]
227 # required so that we re-compile anything
231 [Define to 1 if using internal fuse]
234 if test -z "$PKG_CONFIG"; then
235 AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
237 test "x${PKG_CONFIG}" = "xno" && AC_MSG_ERROR([pkg-config wasn't found! Please install from your vendor, or see http://pkg-config.freedesktop.org/wiki/])
238 # Libraries often install their metadata .pc files in directories
239 # not searched by pkg-config. Let's workaround this.
240 export PKG_CONFIG_PATH=${PKG_CONFIG_PATH}:/lib/pkgconfig:/usr/lib/pkgconfig:/opt/gnome/lib/pkgconfig:/usr/share/pkgconfig:/usr/local/lib/pkgconfig:$prefix/lib/pkgconfig:/opt/gnome/share/pkgconfig:/usr/local/share/pkgconfig
246 AC_MSG_ERROR([FUSE >= 2.6.0 was not found. Either older FUSE is still present, or FUSE is not fully installed (e.g. fuse, libfuse, libfuse2, libfuse-dev, etc packages). Source code: http://fuse.sf.net])
249 FUSE_LIB_PATH=`$PKG_CONFIG --libs-only-L fuse | sed -e 's,/[/]*,/,g' -e 's,[ ]*$,,'`
252 # Checks for header files.
254 AC_CHECK_HEADERS([ctype.h fcntl.h libgen.h libintl.h limits.h locale.h \
255 mntent.h stddef.h stdint.h stdlib.h stdio.h stdarg.h string.h \
256 strings.h errno.h time.h unistd.h utime.h wchar.h getopt.h features.h \
257 endian.h byteswap.h sys/byteorder.h sys/endian.h sys/param.h \
258 sys/ioctl.h sys/mkdev.h sys/mount.h sys/stat.h sys/types.h sys/vfs.h \
259 sys/statvfs.h sys/sysmacros.h linux/major.h linux/fd.h linux/hdreg.h \
260 machine/endian.h windows.h syslog.h])
262 # Checks for typedefs, structures, and compiler characteristics.
268 [WORDS_LITTLEENDIAN],
270 [Define to 1 if your processor stores words with the least significant
271 byte first (like Intel and VAX, unlike Motorola and SPARC).]
280 AC_CHECK_MEMBERS([struct stat.st_rdev])
281 AC_CHECK_MEMBERS([struct stat.st_atim])
282 AC_CHECK_MEMBERS([struct stat.st_atimespec])
284 # For the 'nfconv' patch (Mac OS X only):
285 case "${target_os}" in
287 if test "${enable_nfconv}" = "yes"; then
289 [CoreFoundation/CoreFoundation.h],
291 LDFLAGS="${LDFLAGS} -framework CoreFoundation"
295 [Define to 1 if the nfconv patch should be enabled]
298 AC_MSG_ERROR([[Cannot find CoreFoundation required for 'nfconv' functionality Mac OS X. You may use the --disable-nfconv 'configure' option to avoid this error.]])
304 # Checks for library functions.
313 atexit basename daemon dup2 fdatasync ffs getopt_long hasmntopt \
314 mbsinit memmove memset realpath regcomp setlocale setxattr \
315 strcasecmp strchr strdup strerror strnlen strsep strtol strtoul \
316 sysconf utime utimensat gettimeofday clock_gettime fork \
320 if test "$GCC" = "yes" ; then
321 # We add -Wall to enable some compiler warnings.
322 CFLAGS="${CFLAGS} -Wall"
325 if test "${enable_pedantic}" = "yes"; then
326 enable_warnings="yes"
327 CFLAGS="${CFLAGS} -pedantic"
330 if test "${enable_warnings}" = "yes"; then
331 CFLAGS="${CFLAGS} -W -Wall -Waggregate-return -Wbad-function-cast -Wcast-align -Wcast-qual -Wdisabled-optimization -Wdiv-by-zero -Wfloat-equal -Winline -Wmissing-declarations -Wmissing-format-attribute -Wmissing-noreturn -Wmissing-prototypes -Wmultichar -Wnested-externs -Wpointer-arith -Wredundant-decls -Wshadow -Wsign-compare -Wstrict-prototypes -Wundef -Wwrite-strings -Wformat -Wformat-security -Wuninitialized"
334 if test "${enable_debug}" = "yes"; then
335 CFLAGS="${CFLAGS} -ggdb3 -DDEBUG"
339 [Define to 1 if debug should be enabled]
343 test "${enable_device_default_io_ops}" = "no" && AC_DEFINE(
344 [NO_NTFS_DEVICE_DEFAULT_IO_OPS],
346 [Don't use default IO ops]
349 test "${enable_mtab}" = "no" && AC_DEFINE([IGNORE_MTAB], [1], [Don't update /etc/mtab])
350 test "${enable_posix_acls}" != "no" && AC_DEFINE([POSIXACLS], [1], [POSIX ACL support])
352 test "${enable_really_static}" = "yes" && enable_library="no"
353 test "${enable_library}" = "no" && enable_ldconfig="no"
355 if test "x${DISTCHECK_HACK}" != "x"; then
356 enable_mount_helper="no"
361 pkgconfigdir="\$(libdir)/pkgconfig"
362 ntfs3gincludedir="\$(includedir)/ntfs-3g"
363 # Executables should be installed to the root filesystem, otherwise
364 # automounting NTFS volumes can fail during boot if the driver binaries
365 # and their dependencies are on an unmounted partition. Use --exec-prefix
367 if test "x${exec_prefix}" = "xNONE"; then
370 rootlibdir="/lib${libdir##*/lib}"
372 rootbindir="\$(bindir)"
373 rootsbindir="\$(sbindir)"
374 rootlibdir="\$(libdir)"
376 AC_SUBST([pkgconfigdir])
377 AC_SUBST([ntfs3gincludedir])
378 AC_SUBST([rootbindir])
379 AC_SUBST([rootsbindir])
380 AC_SUBST([rootlibdir])
381 AC_SUBST([LIBNTFS_3G_VERSION])
382 AC_SUBST([LIBFUSE_LITE_LIBS])
383 AC_SUBST([OUTPUT_FORMAT])
384 AM_CONDITIONAL([FUSE_INTERNAL], [test "${with_fuse}" = "internal"])
385 AM_CONDITIONAL([GENERATE_LDSCRIPT], [test "${enable_ldscript}" = "yes"])
386 AM_CONDITIONAL([WINDOWS], [test "${WINDOWS}" = "yes"])
387 AM_CONDITIONAL([NTFS_DEVICE_DEFAULT_IO_OPS], [test "${enable_device_default_io_ops}" = "yes"])
388 AM_CONDITIONAL([RUN_LDCONFIG], [test "${enable_ldconfig}" = "yes"])
389 AM_CONDITIONAL([REALLYSTATIC], [test "${enable_really_static}" = "yes"])
390 AM_CONDITIONAL([INSTALL_LIBRARY], [test "${enable_library}" = "yes"])
391 AM_CONDITIONAL([ENABLE_MOUNT_HELPER], [test "${enable_mount_helper}" = "yes"])
393 # workaround for <autoconf-2.60
394 if test -z "${docdir}"; then
395 docdir="\$(datarootdir)/doc/\$(PACKAGE_NAME)"
398 # workaround for <automake-1.10
399 if test -z "${MKDIR_P}"; then
400 MKDIR_P="\$(mkdir_p)"
408 include/fuse-lite/Makefile
409 include/ntfs-3g/Makefile
410 libfuse-lite/Makefile
412 libntfs-3g/libntfs-3g.pc
413 libntfs-3g/libntfs-3g.script.so
417 src/ntfs-3g.usermap.8
418 src/ntfs-3g.secaudit.8
422 if test "${with_fuse}" = "external"; then
423 if ! echo "x$FUSE_LIB_PATH" | grep -- "x-L/lib" > /dev/null; then
425 ****************************************************************************
426 * WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING *
427 * The FUSE user space binaries were NOT installed with root directory *
428 * executable prefix. This means that automounting NTFS volumes during boot *
429 * could fail. This can be fixed the below way by reinstalling FUSE using *
430 * the right 'configure' option during FUSE compilation: *
431 * ./configure --exec-prefix=/ *
432 * make && sudo make install *
433 * WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING *
434 ****************************************************************************
439 echo "You can type now 'make' to build ntfs-3g."