OSDN Git Service

merge in master-release history after reset to 2079d768f79f636223d89b988a30209adf8dddbe
[android-x86/external-e2fsprogs.git] / configure.in
index c304a8d..6f39cc9 100644 (file)
@@ -1,5 +1,5 @@
 AC_INIT(version.h)
-AC_PREREQ(2.50)
+AC_PREREQ(2.54)
 AC_CONFIG_AUX_DIR(config)
 AC_CONFIG_HEADERS([lib/config.h])
 AH_BOTTOM([#include "dirpaths.h"])
@@ -164,10 +164,43 @@ else
 fi
 ,
 LINK_INSTALL_FLAGS=-f
-AC_MSG_RESULT([Disabling symlinks for install])
+AC_MSG_RESULT([Disabling symlinks for install by default])
 )
 AC_SUBST(LINK_INSTALL_FLAGS)
 dnl
+dnl handle --enable-relative-symlinks
+dnl
+relative_symlink_defined=
+AC_ARG_ENABLE([relative-symlinks],
+[  --enable-relative-symlinks use relative symlinks when installing],
+if test "$enableval" = "no"
+then
+       SYMLINK_RELATIVE=
+       relative_symlink_defined=yes
+       AC_MSG_RESULT([Disabling relative symlinks for install])
+else
+       SYMLINK_RELATIVE=--relative
+       relative_symlink_defined=yes
+       AC_MSG_RESULT([Enabling relative symlinks for install])
+fi)
+AC_ARG_ENABLE([symlink-relative-symlinks],,
+if test "$enableval" = "no"
+then
+       SYMLINK_RELATIVE=yes
+       AC_MSG_RESULT([Disabling relative symlinks for install])
+else
+       SYMLINK_RELATIVE=--relative
+       AC_MSG_RESULT([Enabling relative symlinks for install])
+fi
+,
+if test -z "$relative_symlink_defined"
+then
+       SYMLINK_RELATIVE=
+AC_MSG_RESULT([Disabling relative symlinks for install by default])
+fi
+)
+AC_SUBST(SYMLINK_RELATIVE)
+dnl
 dnl handle --enable-symlink-build
 dnl
 AC_ARG_ENABLE([symlink-build],
@@ -182,7 +215,7 @@ else
 fi
 ,
 LINK_BUILD_FLAGS=
-AC_MSG_RESULT([Disabling symlinks for build])
+AC_MSG_RESULT([Disabling symlinks for build by default])
 )
 AC_SUBST(LINK_BUILD_FLAGS)
 dnl
@@ -194,18 +227,22 @@ if test "$enableval" = "no"
 then
        AC_MSG_RESULT([Disabling verbose make commands])
        E=@echo
+       ES=echo
        Q=@
 else
        AC_MSG_RESULT([Enabling verbose make commands])
        E=@\\#
+       ES=\\#
        Q= 
 fi
 ,
 AC_MSG_RESULT([Disabling verbose make commands])
 E=@echo
+ES=echo
 Q=@
 )
 AC_SUBST(E)
+AC_SUBST(ES)
 AC_SUBST(Q)
 dnl
 dnl handle --enable-compression
@@ -528,18 +565,26 @@ AC_SUBST(BLKID_CMT)
 dnl
 dnl handle --enable-quota
 dnl
+QUOTA_MAN_COMMENT='.\"'
+QUOTA_CMT=
+AC_SUBST(QUOTA_MAN_COMMENT)
 PKG_PROG_PKG_CONFIG
 AH_TEMPLATE([CONFIG_QUOTA], [Define to 1 to enable quota support])
 AC_ARG_ENABLE([quota],
-[  --enable-libquota     enable quota support],
+[  --enable-quota        enable quota support],
 if test "$enableval" = "no"
 then
+       QUOTA_CMT=#
        AC_MSG_RESULT([Disabling quota support])
 else
+       QUOTA_CMT=
        AC_DEFINE(CONFIG_QUOTA, 1)
        AC_MSG_RESULT([Enabling quota support])
+       QUOTA_MAN_COMMENT=""
+       AC_SUBST(QUOTA_MAN_COMMENT)
 fi
 ,
+QUOTA_CMT=#
 AC_MSG_RESULT([Disabling quota support by default])
 )
 dnl
@@ -559,6 +604,22 @@ AC_SUBST(PROFILED_LIBQUOTA)
 AC_SUBST(DEPPROFILED_LIBQUOTA)
 AC_SUBST(QUOTA_CMT)
 dnl
+dnl handle --disable-backtrace
+dnl
+AH_TEMPLATE([DISABLE_BACKTRACE], [Define to 1 to disable use of backtrace])
+AC_ARG_ENABLE([backtrace],
+[  --disable-backtrace   disable use backtrace],
+if test "$enableval" = "no"
+then
+       AC_MSG_RESULT([Disabling use of backtrace])
+       AC_DEFINE(DISABLE_BACKTRACE, 1)
+else
+       AC_MSG_RESULT([Enabling use of backtrace])
+fi
+,
+AC_MSG_RESULT([Enabling use of backtrace by default])
+)
+dnl
 dnl handle --enable-debugfs
 dnl
 AC_ARG_ENABLE([debugfs],
@@ -784,7 +845,49 @@ if test $cross_compiling = no; then
 else
   AC_CHECK_PROGS(BUILD_CC, gcc cc)
 fi
-AC_CHECK_HEADERS(dirent.h errno.h execinfo.h getopt.h malloc.h mntent.h paths.h semaphore.h setjmp.h signal.h stdarg.h stdint.h stdlib.h termios.h termio.h unistd.h utime.h linux/falloc.h linux/fd.h linux/major.h net/if_dl.h netinet/in.h sys/disklabel.h sys/file.h sys/ioctl.h sys/mkdev.h sys/mman.h sys/prctl.h sys/queue.h sys/quota.h sys/resource.h sys/select.h sys/socket.h sys/sockio.h sys/stat.h sys/syscall.h sys/sysmacros.h sys/time.h sys/types.h sys/un.h sys/wait.h)
+AC_CHECK_HEADERS(m4_flatten([
+       dirent.h
+       errno.h
+       execinfo.h
+       getopt.h
+       malloc.h
+       mntent.h
+       paths.h
+       semaphore.h
+       setjmp.h
+       signal.h
+       stdarg.h
+       stdint.h
+       stdlib.h
+       termios.h
+       termio.h
+       unistd.h
+       utime.h
+       linux/falloc.h
+       linux/fd.h
+       linux/major.h
+       linux/loop.h
+       net/if_dl.h
+       netinet/in.h
+       sys/disklabel.h
+       sys/file.h
+       sys/ioctl.h
+       sys/mkdev.h
+       sys/mman.h
+       sys/prctl.h
+       sys/queue.h
+       sys/resource.h
+       sys/select.h
+       sys/socket.h
+       sys/sockio.h
+       sys/stat.h
+       sys/syscall.h
+       sys/sysmacros.h
+       sys/time.h
+       sys/types.h
+       sys/un.h
+       sys/wait.h
+]))
 AC_CHECK_HEADERS(sys/disk.h sys/mount.h,,,
 [[
 #if HAVE_SYS_QUEUE_H
@@ -838,14 +941,17 @@ AC_CHECK_SIZEOF(short)
 AC_CHECK_SIZEOF(int)
 AC_CHECK_SIZEOF(long)
 AC_CHECK_SIZEOF(long long)
+AC_CHECK_SIZEOF(off_t)
 SIZEOF_SHORT=$ac_cv_sizeof_short
 SIZEOF_INT=$ac_cv_sizeof_int
 SIZEOF_LONG=$ac_cv_sizeof_long
 SIZEOF_LONG_LONG=$ac_cv_sizeof_long_long
+SIZEOF_OFF_T=$ac_cv_sizeof_off_t
 AC_SUBST(SIZEOF_SHORT)
 AC_SUBST(SIZEOF_INT)
 AC_SUBST(SIZEOF_LONG)
 AC_SUBST(SIZEOF_LONG_LONG)
+AC_SUBST(SIZEOF_OFF_T)
 AC_C_BIGENDIAN
 BUILD_CC="$BUILD_CC" CPP="$CPP" /bin/sh $ac_aux_dir/parse-types.sh
 ASM_TYPES_HEADER=./asm_types.h
@@ -914,7 +1020,52 @@ if test -n "$BLKID_CMT"; then
   AC_SEARCH_LIBS([blkid_probe_all], [blkid])
 fi
 dnl
-AC_CHECK_FUNCS(chflags getrusage llseek lseek64 open64 fstat64 ftruncate64 getmntinfo strtoull strcasecmp srandom jrand48 fchown mallinfo fdatasync quotactl strnlen strptime strdup sysconf pathconf posix_memalign memalign valloc __secure_getenv prctl mmap msync utime setresuid setresgid usleep nanosleep getdtablesize getrlimit sync_file_range posix_fadvise fallocate fallocate64 blkid_probe_get_topology mbstowcs backtrace)
+AC_CHECK_FUNCS(m4_flatten([
+       __secure_getenv
+       backtrace
+       blkid_probe_get_topology
+       chflags
+       fallocate
+       fallocate64
+       fchown
+       fdatasync
+       fstat64
+       ftruncate64
+       getdtablesize
+       getmntinfo
+       getpwuid_r
+       getrlimit
+       getrusage
+       jrand48
+       llseek
+       lseek64
+       mallinfo
+       mbstowcs
+       memalign
+       mmap
+       msync
+       nanosleep
+       open64
+       pathconf
+       posix_fadvise
+       posix_memalign
+       prctl
+       secure_getenv
+       setmntent
+       setresgid
+       setresuid
+       srandom
+       strcasecmp
+       strdup
+       strnlen
+       strptime
+       strtoull
+       sync_file_range
+       sysconf
+       usleep
+       utime
+       valloc
+]))
 dnl
 dnl Check to see if -lsocket is required (solaris) to make something
 dnl that uses socket() to compile; this is needed for the UUID library
@@ -1058,9 +1209,11 @@ libdir=$libdir/$withval
 root_libdir=$root_libdir/$withval
 )dnl
 dnl
-dnl See if -static works.
+dnl See if -static works.  This could fail if the linker does not
+dnl support -static, or if required external libraries are not available
+dnl in static form.
 dnl
-AC_MSG_CHECKING([whether linker accepts -static])
+AC_MSG_CHECKING([whether we can link with -static])
 AC_CACHE_VAL(ac_cv_e2fsprogs_use_static,
 [SAVE_LDFLAGS=$LDFLAGS; LDFLAGS="$LDFLAGS -static"
 AC_TRY_LINK([#include <stdio.h>],[fflush(stdout);],
@@ -1127,7 +1280,7 @@ dnl
 dnl Build CFLAGS
 dnl
 if test $cross_compiling = no; then
-   BUILD_CFLAGS="$CFLAGS"
+   BUILD_CFLAGS="$CFLAGS $CPPFLAGS"
    BUILD_LDFLAGS="$LDFLAGS"
 else
    BUILD_CFLAGS=
@@ -1144,7 +1297,7 @@ test -d include || mkdir include
 test -d include/linux || mkdir include/linux
 test -d include/asm || mkdir include/asm
 for i in MCONFIG Makefile e2fsprogs.spec \
-       util/Makefile util/subst.conf util/gen-tarball \
+       util/Makefile util/subst.conf util/gen-tarball util/install-symlink \
        lib/et/Makefile lib/ss/Makefile lib/e2p/Makefile \
        lib/ext2fs/Makefile lib/ext2fs/ext2_types.h \
        lib/uuid/Makefile lib/uuid/uuid_types.h \