Whamcloud - gitweb
Fix miscellaneous gcc -Wall warnings
[tools/e2fsprogs.git] / configure
index 8b88bcd..6a46e3c 100755 (executable)
--- a/configure
+++ b/configure
@@ -684,19 +684,19 @@ CHECKER_CMT
 LIB_EXT
 STATIC_LIB_EXT
 PROFILED_LIB_EXT
-SWAPFS_CMT
 DEBUGFS_CMT
 IMAGER_CMT
 RESIZER_CMT
-E2FSCK_TYPE
 FSCK_PROG
 FSCK_MAN
 E2INITRD_PROG
 E2INITRD_MAN
+PKG_CONFIG
 DEVMAPPER_REQ
 DEVMAPPER_PC_LIBS
 DEVMAPPER_LIBS
 STATIC_DEVMAPPER_LIBS
+STATIC_BLKID_DEVMAPPER_LIBS
 UUIDD_CMT
 GETTEXT_PACKAGE
 PACKAGE
@@ -786,7 +786,8 @@ CFLAGS
 LDFLAGS
 LIBS
 CPPFLAGS
-CPP'
+CPP
+PKG_CONFIG'
 
 
 # Initialize some variables set by options.
@@ -1369,11 +1370,9 @@ Optional Features:
   --enable-jbd-debug     enable journal debugging
   --enable-blkid-debug    enable blkid debugging
   --enable-testio-debug   enable the use of the test I/O manager for debugging
-  --disable-swapfs       disable support of legacy byte-swapped filesystems
   --disable-debugfs      disable support of debugfs program
   --disable-imager       disable support of e2image program
   --disable-resizer      disable support of e2resize program
-  --enable-dynamic-e2fsck build e2fsck dynamically
   --enable-fsck           build fsck wrapper program
   --enable-e2initrd-helper build e2initrd-helper program
   --enable-blkid-devmapper  build with device-mapper support
@@ -1407,6 +1406,7 @@ Some influential environment variables:
   CPPFLAGS    C/C++/Objective C preprocessor flags, e.g. -I<include dir> if
               you have headers in a nonstandard directory <include dir>
   CPP         C preprocessor
+  PKG_CONFIG  path to pkg-config utility
 
 Use these variables to override the choices made by `configure' or to help
 it to find libraries and programs with nonstandard names/locations.
@@ -1899,12 +1899,12 @@ esac
 
 base_ver=`echo $E2FSPROGS_VERSION | \
               sed -e 's/-WIP//' -e 's/pre-//' -e 's/-PLUS//'`
-pre_vers=`echo $base_ver 0.01 - p | dc`
 
 date_spec=${E2FSPROGS_YEAR}.${MONTH_NUM}.${E2FSPROGS_DAY}
 
 case $E2FSPROGS_VERSION in
 *-WIP|pre-*)
+       pre_vers=`echo $base_ver 0.01 - p | dc`
        E2FSPROGS_PKGVER="$pre_vers+${base_ver}_WIP_$date_spec"
        ;;
 *)
@@ -3835,6 +3835,7 @@ echo "Enabling htree directory support by default"
 fi
 
 
+E2_PKG_CONFIG_STATIC=--static
 # Check whether --enable-elf-shlibs was given.
 if test "${enable_elf_shlibs+set}" = set; then
   enableval=$enable_elf_shlibs; if test "$enableval" = "no"
@@ -3843,6 +3844,7 @@ then
        MAKEFILE_ELF=/dev/null
        echo "Disabling ELF shared libraries"
 else
+       E2_PKG_CONFIG_STATIC=
        ELF_CMT=
        MAKEFILE_ELF=$srcdir/lib/Makefile.elf-lib
        case "$host_os" in
@@ -3872,6 +3874,7 @@ then
        MAKEFILE_BSDLIB=/dev/null
        echo "Disabling BSD shared libraries"
 else
+       E2_PKG_CONFIG_STATIC=
        BSDLIB_CMT=
        MAKEFILE_BSDLIB=$srcdir/lib/Makefile.bsd-lib
        LIB_EXT=.so
@@ -3995,32 +3998,6 @@ else
 
 fi
 
-# Check whether --enable-swapfs was given.
-if test "${enable_swapfs+set}" = set; then
-  enableval=$enable_swapfs; if test "$enableval" = "no"
-then
-       SWAPFS_CMT=#
-       echo "Disabling swapfs support"
-else
-       SWAPFS_CMT=
-       cat >>confdefs.h <<\_ACEOF
-#define ENABLE_SWAPFS 1
-_ACEOF
-
-       echo "Enabling swapfs support"
-fi
-
-else
-  SWAPFS_CMT=
-echo "Enabling swapfs support by default"
-cat >>confdefs.h <<\_ACEOF
-#define ENABLE_SWAPFS 1
-_ACEOF
-
-
-fi
-
-
 # Check whether --enable-debugfs was given.
 if test "${enable_debugfs+set}" = set; then
   enableval=$enable_debugfs; if test "$enableval" = "no"
@@ -4075,24 +4052,6 @@ RESIZER_CMT=
 fi
 
 
-# Check whether --enable-dynamic-e2fsck was given.
-if test "${enable_dynamic_e2fsck+set}" = set; then
-  enableval=$enable_dynamic_e2fsck; if test "$enableval" = "no"
-then
-       E2FSCK_TYPE=static
-       echo "Building e2fsck statically"
-else
-       E2FSCK_TYPE=shared
-       echo "Building e2fsck dynamically"
-fi
-
-else
-  E2FSCK_TYPE=static
-echo "Building e2fsck statically by default"
-
-fi
-
-
 # Check whether --enable-fsck was given.
 if test "${enable_fsck+set}" = set; then
   enableval=$enable_fsck; if test "$enableval" = "no"
@@ -4138,6 +4097,7 @@ fi
 
 
 
+STATIC_BLKID_DEVMAPPER_LIBS=''
 # Check whether --enable-blkid-devmapper was given.
 if test "${enable_blkid_devmapper+set}" = set; then
   enableval=$enable_blkid_devmapper; if test "$enableval" = "no"
@@ -4153,12 +4113,218 @@ _ACEOF
 
        echo "Enabling device-mapper support"
 
-       DEVMAPPER_REQ='libselinux libsepol'
-       DEVMAPPER_PC_LIBS='-ldevmapper'
-       DEVMAPPER_LIBS='-ldevmapper -lselinux -lsepol -lpthread'
-       STATIC_DEVMAPPER_LIBS='/usr/lib/libdevmapper.a /usr/lib/libselinux.a /usr/lib/libsepol.a -lpthread'
+
+
+if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
+        if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args.
+set dummy ${ac_tool_prefix}pkg-config; ac_word=$2
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
+if test "${ac_cv_path_PKG_CONFIG+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  case $PKG_CONFIG in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+  ;;
+esac
+fi
+PKG_CONFIG=$ac_cv_path_PKG_CONFIG
+if test -n "$PKG_CONFIG"; then
+  { echo "$as_me:$LINENO: result: $PKG_CONFIG" >&5
+echo "${ECHO_T}$PKG_CONFIG" >&6; }
+else
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+fi
+
 
 fi
+if test -z "$ac_cv_path_PKG_CONFIG"; then
+  ac_pt_PKG_CONFIG=$PKG_CONFIG
+  # Extract the first word of "pkg-config", so it can be a program name with args.
+set dummy pkg-config; ac_word=$2
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
+if test "${ac_cv_path_ac_pt_PKG_CONFIG+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  case $ac_pt_PKG_CONFIG in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_path_ac_pt_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+  ;;
+esac
+fi
+ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG
+if test -n "$ac_pt_PKG_CONFIG"; then
+  { echo "$as_me:$LINENO: result: $ac_pt_PKG_CONFIG" >&5
+echo "${ECHO_T}$ac_pt_PKG_CONFIG" >&6; }
+else
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+fi
+
+  if test "x$ac_pt_PKG_CONFIG" = x; then
+    PKG_CONFIG=""
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools
+whose name does not start with the host triplet.  If you think this
+configuration is useful to you, please write to autoconf@gnu.org." >&5
+echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools
+whose name does not start with the host triplet.  If you think this
+configuration is useful to you, please write to autoconf@gnu.org." >&2;}
+ac_tool_warned=yes ;;
+esac
+    PKG_CONFIG=$ac_pt_PKG_CONFIG
+  fi
+else
+  PKG_CONFIG="$ac_cv_path_PKG_CONFIG"
+fi
+
+fi
+if test -n "$PKG_CONFIG"; then
+        _pkg_min_version=0.9.0
+        { echo "$as_me:$LINENO: checking pkg-config is at least version $_pkg_min_version" >&5
+echo $ECHO_N "checking pkg-config is at least version $_pkg_min_version... $ECHO_C" >&6; }
+        if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
+                { echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6; }
+        else
+                { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+                PKG_CONFIG=""
+        fi
+
+fi
+
+       if test -z "$PKG_CONFIG"; then
+               echo "pkg-config not installed; please install it."
+               exit 1;
+       fi
+
+       { echo "$as_me:$LINENO: checking for dm_tree_create in -ldevmapper" >&5
+echo $ECHO_N "checking for dm_tree_create in -ldevmapper... $ECHO_C" >&6; }
+if test "${ac_cv_lib_devmapper_dm_tree_create+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-ldevmapper $DEVMAPPER_LIBS $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char dm_tree_create ();
+int
+main ()
+{
+return dm_tree_create ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
+  ac_cv_lib_devmapper_dm_tree_create=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       ac_cv_lib_devmapper_dm_tree_create=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_lib_devmapper_dm_tree_create" >&5
+echo "${ECHO_T}$ac_cv_lib_devmapper_dm_tree_create" >&6; }
+if test $ac_cv_lib_devmapper_dm_tree_create = yes; then
+  DEVMAPPER_LIBS=`$PKG_CONFIG --libs devmapper`;
+                STATIC_DEVMAPPER_LIBS=`$PKG_CONFIG --static --libs devmapper`;
+                DEVMAPPER_REQ="devmapper";
+                DEVMAPPER_PC_LIBS="-ldevmapper"
+else
+  { { echo "$as_me:$LINENO: error: device-mapper library not found" >&5
+echo "$as_me: error: device-mapper library not found" >&2;}
+   { (exit 1); exit 1; }; }
+fi
+
+       # work around stupid devmapper.pc bug in Debian
+       case "$STATIC_DEVMAPPER_LIBS" in
+       *pthread*)
+           ;;
+       *)
+           echo "Working around Debian bug #390243..."
+           STATIC_DEVMAPPER_LIBS="-pthread $STATIC_DEVMAPPER_LIBS"
+           ;;
+       esac
+       if test "$E2_PKG_CONFIG_STATIC" = "--static"; then
+           DEVMAPPER_LIBS="$STATIC_DEVMAPPER_LIBS"
+           STATIC_BLKID_DEVMAPPER_LIBS="$STATIC_DEVMAPPER_LIBS"
+       fi
+fi
 
 else
   echo "Disabling device-mapper support by default"
@@ -4169,6 +4335,7 @@ fi
 
 
 
+
 # Check whether --enable-tls was given.
 if test "${enable_tls+set}" = set; then
   enableval=$enable_tls; if test "$enableval" = "no"
 
 
 
-for ac_header in stdlib.h unistd.h stdarg.h stdint.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/mman.h sys/mkdev.h sys/prctl.h sys/queue.h sys/sockio.h sys/socket.h sys/sysmacros.h sys/time.h sys/stat.h sys/types.h sys/wait.h sys/resource.h net/if_dl.h netinet/in.h utime.h
+
+
+
+for ac_header in dirent.h errno.h getopt.h malloc.h mntent.h paths.h setjmp.h signal.h stdarg.h stdint.h stdlib.h termios.h unistd.h utime.h linux/fd.h linux/major.h net/if_dl.h netinet/in.h sys/disklabel.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
 do
 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
 if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
@@ -14644,7 +14814,8 @@ fi
 
 
 
-for ac_func in chflags getrusage llseek lseek64 open64 fstat64 getmntinfo strtoull strcasecmp srandom jrand48 fchown mallinfo fdatasync strnlen strptime strdup sysconf pathconf posix_memalign memalign valloc __secure_getenv prctl mmap utime setresuid setresgid
+
+for ac_func in chflags getrusage llseek lseek64 open64 fstat64 ftruncate64 getmntinfo strtoull strcasecmp srandom jrand48 fchown mallinfo fdatasync strnlen strptime strdup sysconf pathconf posix_memalign memalign valloc __secure_getenv prctl mmap utime setresuid setresgid
 do
 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
 { echo "$as_me:$LINENO: checking for $ac_func" >&5
@@ -14975,6 +15146,22 @@ else
        root_libdir='${root_prefix}/lib'
        root_sysconfdir='${root_prefix}/etc'
 fi
+if test "$bindir" != '${exec_prefix}/bin'; then
+    root_bindir=$bindir
+    echo "Setting root_bindir to $root_bindir"
+fi
+if test "$sbindir" != '${exec_prefix}/sbin'; then
+    root_sbindir=$sbindir
+    echo "Setting root_sbindir to $root_sbindir"
+fi
+if test "$libdir" != '${exec_prefix}/lib'; then
+    root_libdir=$libdir
+    echo "Setting root_libdir to $root_libdir"
+fi
+if test "$sysconfdir" != '${prefix}/etc'; then
+    root_sysconfdir=$sysconfdir
+    echo "Setting root_sysconfdir to $root_sysconfdir"
+fi
 
 
 
@@ -15820,11 +16007,11 @@ CHECKER_CMT!$CHECKER_CMT$ac_delim
 LIB_EXT!$LIB_EXT$ac_delim
 STATIC_LIB_EXT!$STATIC_LIB_EXT$ac_delim
 PROFILED_LIB_EXT!$PROFILED_LIB_EXT$ac_delim
-SWAPFS_CMT!$SWAPFS_CMT$ac_delim
 DEBUGFS_CMT!$DEBUGFS_CMT$ac_delim
 IMAGER_CMT!$IMAGER_CMT$ac_delim
 RESIZER_CMT!$RESIZER_CMT$ac_delim
-E2FSCK_TYPE!$E2FSCK_TYPE$ac_delim
+FSCK_PROG!$FSCK_PROG$ac_delim
+FSCK_MAN!$FSCK_MAN$ac_delim
 _ACEOF
 
   if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 76; then
@@ -15894,14 +16081,14 @@ _ACEOF
 ac_delim='%!_!# '
 for ac_last_try in false false false false false :; do
   cat >conf$$subs.sed <<_ACEOF
-FSCK_PROG!$FSCK_PROG$ac_delim
-FSCK_MAN!$FSCK_MAN$ac_delim
 E2INITRD_PROG!$E2INITRD_PROG$ac_delim
 E2INITRD_MAN!$E2INITRD_MAN$ac_delim
+PKG_CONFIG!$PKG_CONFIG$ac_delim
 DEVMAPPER_REQ!$DEVMAPPER_REQ$ac_delim
 DEVMAPPER_PC_LIBS!$DEVMAPPER_PC_LIBS$ac_delim
 DEVMAPPER_LIBS!$DEVMAPPER_LIBS$ac_delim
 STATIC_DEVMAPPER_LIBS!$STATIC_DEVMAPPER_LIBS$ac_delim
+STATIC_BLKID_DEVMAPPER_LIBS!$STATIC_BLKID_DEVMAPPER_LIBS$ac_delim
 UUIDD_CMT!$UUIDD_CMT$ac_delim
 GETTEXT_PACKAGE!$GETTEXT_PACKAGE$ac_delim
 PACKAGE!$PACKAGE$ac_delim