Whamcloud - gitweb
LU-10638 build: add support for Scientific
[tools/e2fsprogs.git] / configure
index fdbb3e9..9cd95fb 100755 (executable)
--- a/configure
+++ b/configure
@@ -639,6 +639,7 @@ CYGWIN_CMT
 LINUX_CMT
 UNI_DIFF_OPTS
 SEM_INIT_LIB
+SQLITE3_LIB
 SOCKET_LIB
 SIZEOF_OFF_T
 SIZEOF_LONG_LONG
@@ -707,6 +708,8 @@ FSCK_PROG
 DEFRAG_CMT
 RESIZER_CMT
 IMAGER_CMT
+E2SCAN_MAN
+E2SCAN_CMT
 DEBUGFS_CMT
 QUOTA_CMT
 DEPPROFILED_LIBQUOTA
@@ -715,6 +718,7 @@ DEPSTATIC_LIBQUOTA
 STATIC_LIBQUOTA
 DEPLIBQUOTA
 LIBQUOTA
+QUOTA_MAN_COMMENT
 BLKID_CMT
 DEPPROFILED_LIBBLKID
 PROFILED_LIBBLKID
@@ -736,7 +740,6 @@ LDFLAG_DYNAMIC
 PROFILED_LIB_EXT
 STATIC_LIB_EXT
 LIB_EXT
-CHECKER_CMT
 PROFILE_CMT
 BSDLIB_CMT
 ELF_CMT
@@ -813,7 +816,6 @@ ac_subst_files='MCONFIG
 MAKEFILE_ELF
 MAKEFILE_BSDLIB
 MAKEFILE_PROFILE
-MAKEFILE_CHECKER
 MAKEFILE_LIBRARY
 ASM_TYPES_HEADER
 PUBLIC_CONFIG_HEADER'
@@ -835,14 +837,16 @@ enable_htree
 enable_elf_shlibs
 enable_bsd_shlibs
 enable_profile
-enable_checker
+enable_gcov
 enable_jbd_debug
 enable_blkid_debug
 enable_testio_debug
 enable_libuuid
 enable_libblkid
 enable_quota
+enable_backtrace
 enable_debugfs
+enable_e2scan
 enable_imager
 enable_resizer
 enable_defrag
@@ -856,6 +860,7 @@ enable_rpath
 with_libiconv_prefix
 with_included_gettext
 with_libintl_prefix
+with_sqlite3
 with_multiarch
 '
       ac_precious_vars='build_alias
@@ -1490,14 +1495,16 @@ Optional Features:
   --enable-elf-shlibs    select ELF shared libraries
   --enable-bsd-shlibs    select BSD shared libraries
   --enable-profile       build profiling libraries
-  --enable-checker       build checker libraries
+  --enable-gcov                  build for coverage testing using gcov
   --enable-jbd-debug     enable journal debugging
   --enable-blkid-debug    enable blkid debugging
   --disable-testio-debug  disable the use of the test I/O manager for debugging
   --disable-libuuid      do not build private uuid library
   --disable-libblkid     do not build private blkid library
-  --enable-quota         enable quota support
+  --disable-quota        disable quota support
+  --disable-backtrace    disable use backtrace
   --disable-debugfs      disable support of debugfs program
+  --disable-e2scan       disable support of e2scan program
   --disable-imager       disable support of e2image program
   --disable-resizer      disable support of e2resize program
   --disable-defrag       disable support of e4defrag program
@@ -1522,6 +1529,7 @@ Optional Packages:
   --with-included-gettext use the GNU gettext library included here
   --with-libintl-prefix[=DIR]  search for libintl in DIR/include and DIR/lib
   --without-libintl-prefix     don't search for libintl in includedir and libdir
+  --with-sqlite3=DIR      location of sqlite3 library (default /usr/lib)
   --with-multiarch=ARCH specify the multiarch triplet
 
 Some influential environment variables:
@@ -2750,6 +2758,21 @@ $as_echo "Release date is ${E2FSPROGS_MONTH}, ${E2FSPROGS_YEAR}" >&6; }
 
 
 
+WITH_DIET_LIBC=
+
+# Check whether --with-diet-libc was given.
+if test "${with_diet_libc+set}" = set; then :
+  withval=$with_diet_libc; CC="diet cc -nostdinc"
+WITH_DIET_LIBC=yes
+if test -z "$LIBS"
+then
+       LIBS="-lcompat"
+else
+       LIBS="$LIBS -lcompat"
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: CC=$CC" >&5
+$as_echo "CC=$CC" >&6; }
+fi
 # Make sure we can run config.sub.
 $SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 ||
   as_fn_error $? "cannot run $SHELL $ac_aux_dir/config.sub" "$LINENO" 5
@@ -3656,15 +3679,6 @@ $as_echo "#define HAVE_DLOPEN 1" >>confdefs.h
 fi
 
 
-WITH_DIET_LIBC=
-
-# Check whether --with-diet-libc was given.
-if test "${with_diet_libc+set}" = set; then :
-  withval=$with_diet_libc; CC="diet cc -nostdinc"
-WITH_DIET_LIBC=yes
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: CC=$CC" >&5
-$as_echo "CC=$CC" >&6; }
-fi
 
 # Check whether --with-cc was given.
 if test "${with_cc+set}" = set; then :
@@ -4668,27 +4682,16 @@ fi
 
 
 
-# Check whether --enable-checker was given.
-if test "${enable_checker+set}" = set; then :
-  enableval=$enable_checker; if test "$enableval" = "no"
+# Check whether --enable-gcov was given.
+if test "${enable_gcov+set}" = set; then :
+  enableval=$enable_gcov; if test "$enableval" = "yes"
 then
-       CHECKER_CMT=#
-       MAKEFILE_CHECKER=/dev/null
-       { $as_echo "$as_me:${as_lineno-$LINENO}: result: Disabling checker libraries" >&5
-$as_echo "Disabling checker libraries" >&6; }
-else
-       CHECKER_CMT=
-       MAKEFILE_CHECKER=$srcdir/lib/Makefile.checker
-       { $as_echo "$as_me:${as_lineno-$LINENO}: result: Building checker libraries" >&5
-$as_echo "Building checker libraries" >&6; }
+       CFLAGS="-g -fprofile-arcs -ftest-coverage"
+       LDFLAGS="-fprofile-arcs -ftest-coverage"
+       { $as_echo "$as_me:${as_lineno-$LINENO}: result: Enabling gcov support" >&5
+$as_echo "Enabling gcov support" >&6; }
 fi
 
-else
-  CHECKER_CMT=#
-MAKEFILE_CHECKER=/dev/null
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: Disabling checker libraries by default" >&5
-$as_echo "Disabling checker libraries by default" >&6; }
-
 fi
 
 
@@ -4697,7 +4700,6 @@ fi
 
 
 
-
 # Check whether --enable-jbd-debug was given.
 if test "${enable_jbd_debug+set}" = set; then :
   enableval=$enable_jbd_debug; if test "$enableval" = "no"
@@ -4901,7 +4903,7 @@ if ${ac_cv_lib_uuid_uuid_generate+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
-LIBS="-luuid $LIBUUID $LIBS"
+LIBS="-luuid  $LIBS"
 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
@@ -4938,6 +4940,7 @@ else
   as_fn_error $? "external uuid library not found" "$LINENO" 5
 fi
 
+       PROFILED_LIBUUID=$LIBUUID
        UUID_CMT=#
        { $as_echo "$as_me:${as_lineno-$LINENO}: result: Disabling private uuid library" >&5
 $as_echo "Disabling private uuid library" >&6; }
@@ -5109,7 +5112,7 @@ if ${ac_cv_lib_blkid_blkid_get_cache+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
-LIBS="-lblkid $LIBBLKID $LIBS"
+LIBS="-lblkid -luuid $LIBS"
 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
@@ -5147,6 +5150,7 @@ else
 fi
 
        BLKID_CMT=#
+       PROFILED_LIBBLKID=$LIBBLKID
        { $as_echo "$as_me:${as_lineno-$LINENO}: result: Disabling private blkid library" >&5
 $as_echo "Disabling private blkid library" >&6; }
 else
@@ -5183,6 +5187,9 @@ fi
 
 
 
+QUOTA_MAN_COMMENT='.\"'
+QUOTA_CMT=
+
 
 
 if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
@@ -5304,18 +5311,27 @@ fi
 if test "${enable_quota+set}" = set; then :
   enableval=$enable_quota; if test "$enableval" = "no"
 then
+       QUOTA_CMT=#
        { $as_echo "$as_me:${as_lineno-$LINENO}: result: Disabling quota support" >&5
 $as_echo "Disabling quota support" >&6; }
+       QUOTA_CMT="#"
 else
+       QUOTA_CMT=
        $as_echo "#define CONFIG_QUOTA 1" >>confdefs.h
 
+       QUOTA_CMT=
        { $as_echo "$as_me:${as_lineno-$LINENO}: result: Enabling quota support" >&5
 $as_echo "Enabling quota support" >&6; }
+       QUOTA_MAN_COMMENT=""
+
 fi
 
 else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: Disabling quota support by default" >&5
-$as_echo "Disabling quota support by default" >&6; }
+  $as_echo "#define CONFIG_QUOTA 1" >>confdefs.h
+
+QUOTA_CMT=
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: Enabling quota support by default" >&5
+$as_echo "Enabling quota support by default" >&6; }
 
 fi
 
@@ -5332,6 +5348,26 @@ DEPPROFILED_LIBQUOTA=$PROFILED_LIBQUOTA
 
 
 
+
+# Check whether --enable-backtrace was given.
+if test "${enable_backtrace+set}" = set; then :
+  enableval=$enable_backtrace; if test "$enableval" = "no"
+then
+       { $as_echo "$as_me:${as_lineno-$LINENO}: result: Disabling use of backtrace" >&5
+$as_echo "Disabling use of backtrace" >&6; }
+       $as_echo "#define DISABLE_BACKTRACE 1" >>confdefs.h
+
+else
+       { $as_echo "$as_me:${as_lineno-$LINENO}: result: Enabling use of backtrace" >&5
+$as_echo "Enabling use of backtrace" >&6; }
+fi
+
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: Enabling use of backtrace by default" >&5
+$as_echo "Enabling use of backtrace by default" >&6; }
+
+fi
+
 # Check whether --enable-debugfs was given.
 if test "${enable_debugfs+set}" = set; then :
   enableval=$enable_debugfs; if test "$enableval" = "no"
@@ -5353,6 +5389,28 @@ DEBUGFS_CMT=
 fi
 
 
+# Check whether --enable-e2scan was given.
+if test "${enable_e2scan+set}" = set; then :
+  enableval=$enable_e2scan; if test "$enableval" = "no"
+then
+       echo "Disabling e2scan support"
+       E2SCAN_CMT="#"
+       E2SCAN_MAN='.\"'
+else
+       E2SCAN_CMT=
+       E2SCAN_MAN=
+       echo "Enabling e2scan support"
+fi
+
+else
+  echo "Enabling e2scan support by default"
+E2SCAN_CMT=
+E2SCAN_MAN=
+
+fi
+
+
+
 # Check whether --enable-imager was given.
 if test "${enable_imager+set}" = set; then :
   enableval=$enable_imager; if test "$enableval" = "no"
@@ -5409,9 +5467,16 @@ $as_echo "Enabling e4defrag support" >&6; }
 fi
 
 else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: Enabling e4defrag support by default" >&5
+  if test -z "$WITH_DIET_LIBC"
+then
+       { $as_echo "$as_me:${as_lineno-$LINENO}: result: Enabling e4defrag support by default" >&5
 $as_echo "Enabling e4defrag support by default" >&6; }
-DEFRAG_CMT=
+       DEFRAG_CMT=
+else
+       { $as_echo "$as_me:${as_lineno-$LINENO}: result: Disabling e4defrag support by default" >&5
+$as_echo "Disabling e4defrag support by default" >&6; }
+       DEFRAG_CMT="#"
+fi
 
 fi
 
@@ -5568,9 +5633,16 @@ fi
 else
   $as_echo "#define USE_UUIDD 1" >>confdefs.h
 
-UUIDD_CMT=""
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: Building uuidd by default" >&5
+if test -z "$UUID_CMT"
+then
+       UUIDD_CMT=""
+       { $as_echo "$as_me:${as_lineno-$LINENO}: result: Building uuidd by default" >&5
 $as_echo "Building uuidd by default" >&6; }
+else
+       UUIDD_CMT="#"
+       { $as_echo "$as_me:${as_lineno-$LINENO}: result: Disabling uuidd by default" >&5
+$as_echo "Disabling uuidd by default" >&6; }
+fi
 
 fi
 
@@ -10339,7 +10411,7 @@ fi
 done
 
 fi
-for ac_header in       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/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
+for ac_header in       attr/xattr.h    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/disk.h      sys/file.h      sys/ioctl.h     sys/mkdev.h     sys/mman.h      sys/mount.h     sys/prctl.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      sys/xattr.h
 do :
   as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
 ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
 
 done
 
-for ac_header in sys/disk.h sys/mount.h
-do :
-  as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
-ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "
-#if HAVE_SYS_QUEUE_H
-#include <sys/queue.h>
-#endif
-
-"
-if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
-  cat >>confdefs.h <<_ACEOF
-#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
-_ACEOF
-
-fi
-
-done
-
 for ac_header in net/if.h
 do :
   ac_fn_c_check_header_compile "$LINENO" "net/if.h" "ac_cv_header_net_if_h" "
 
 done
 
+if test x"$E2SCAN_CMT" == x; then
+for ac_header in sqlite3.h
+do :
+  ac_fn_c_check_header_mongrel "$LINENO" "sqlite3.h" "ac_cv_header_sqlite3_h" "$ac_includes_default"
+if test "x$ac_cv_header_sqlite3_h" = xyes; then :
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_SQLITE3_H 1
+_ACEOF
+
+fi
+
+done
+
+fi
 for ac_func in vprintf
 do :
   ac_fn_c_check_func "$LINENO" "vprintf" "ac_cv_func_vprintf"
@@ -10417,6 +10485,16 @@ $as_echo "#define HAVE_RECLEN_DIRENT 1" >>confdefs.h
 
 fi
 
+ac_fn_c_check_member "$LINENO" "struct stat" "st_atim" "ac_cv_member_struct_stat_st_atim" "$ac_includes_default"
+if test "x$ac_cv_member_struct_stat_st_atim" = xyes; then :
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_STRUCT_STAT_ST_ATIM 1
+_ACEOF
+
+
+fi
+
 ac_fn_c_check_type "$LINENO" "ssize_t" "ac_cv_type_ssize_t" "#include <sys/types.h>
 "
 if test "x$ac_cv_type_ssize_t" = xyes; then :
@@ -10842,7 +10920,11 @@ $as_echo "#define AC_APPLE_UNIVERSAL_BUILD 1" >>confdefs.h
  presetting ac_cv_c_bigendian=no (or yes) will help" "$LINENO" 5 ;;
  esac
 
-BUILD_CC="$BUILD_CC" CPP="$CPP" /bin/sh $ac_aux_dir/parse-types.sh
+if test $cross_compiling = no; then
+  BUILD_CC="$BUILD_CC" CPP="$CPP" /bin/sh $ac_aux_dir/parse-types.sh
+else
+  CROSS_COMPILE="1" BUILD_CC="$BUILD_CC" CPP="$CPP" /bin/sh $ac_aux_dir/parse-types.sh
+fi
 ASM_TYPES_HEADER=./asm_types.h
 
 echo "/* These defines are needed for the public ext2fs.h header file */" \
@@ -11010,7 +11092,7 @@ if test "$ac_res" != no; then :
 fi
 
 fi
-for ac_func in         __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
+for ac_func in         __secure_getenv         backtrace       blkid_probe_get_topology        blkid_probe_enable_partitions   chflags         fadvise64       fallocate       fallocate64     fchown  fdatasync       fstat64         ftruncate64     futimes         getcwd  getdtablesize   getmntinfo      getpwuid_r      getrlimit       getrusage       jrand48         llseek  lseek64         mallinfo        mbstowcs        memalign        mempcpy         mmap    msync   nanosleep       open64  pathconf        posix_fadvise   posix_fadvise64         posix_memalign  prctl   pread   pwrite  pread64         pwrite64        secure_getenv   setmntent       setresgid       setresuid       snprintf        srandom         stpcpy  strcasecmp      strdup  strnlen         strptime        strtoull        sync_file_range         sysconf         usleep  utime   utimes  valloc
 do :
   as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
 ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
@@ -11064,6 +11146,125 @@ if test "x$ac_cv_lib_socket_socket" = xyes; then :
 fi
 
 
+
+# Check whether --with-sqlite3 was given.
+if test "${with_sqlite3+set}" = set; then :
+  withval=$with_sqlite3; SQLITE3_LIBS="-L$with_sqlite3"
+fi
+
+
+if test x"$E2SCAN_CMT" == x; then
+
+CFLAGS_OLD=$CFLAGS
+SQLITE3_LIB=''
+CFLAGS="$CFLAGS_OLD $SQLITE3_LIBS -static -pthread"
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for sqlite3_open in -lsqlite3" >&5
+$as_echo_n "checking for sqlite3_open in -lsqlite3... " >&6; }
+if ${ac_cv_lib_sqlite3_sqlite3_open+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lsqlite3  $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* 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 sqlite3_open ();
+int
+main ()
+{
+return sqlite3_open ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_sqlite3_sqlite3_open=yes
+else
+  ac_cv_lib_sqlite3_sqlite3_open=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_sqlite3_sqlite3_open" >&5
+$as_echo "$ac_cv_lib_sqlite3_sqlite3_open" >&6; }
+if test "x$ac_cv_lib_sqlite3_sqlite3_open" = xyes; then :
+
+       SQLITE3_LIB="$SQLITE3_LIBS -static -pthread -lsqlite3"
+
+$as_echo "#define HAVE_SQLITE3 1" >>confdefs.h
+
+
+fi
+
+
+if test x"$SQLITE3_LIB" == x; then
+       { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: no static sqlite3 - looking for dynamic one" >&5
+$as_echo "$as_me: WARNING: no static sqlite3 - looking for dynamic one" >&2;}
+       CFLAGS="$CFLAGS_OLD $SQLITE3_LIBS -pthread"
+       { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sqlite3_close in -lsqlite3" >&5
+$as_echo_n "checking for sqlite3_close in -lsqlite3... " >&6; }
+if ${ac_cv_lib_sqlite3_sqlite3_close+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lsqlite3  $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* 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 sqlite3_close ();
+int
+main ()
+{
+return sqlite3_close ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_sqlite3_sqlite3_close=yes
+else
+  ac_cv_lib_sqlite3_sqlite3_close=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_sqlite3_sqlite3_close" >&5
+$as_echo "$ac_cv_lib_sqlite3_sqlite3_close" >&6; }
+if test "x$ac_cv_lib_sqlite3_sqlite3_close" = xyes; then :
+
+               SQLITE3_LIB="$SQLITE3_LIBS -pthread -lsqlite3"
+
+$as_echo "#define HAVE_SQLITE3 1" >>confdefs.h
+
+
+fi
+
+fi
+
+
+CFLAGS=$CFLAGS_OLD
+
+if test x"$SQLITE3_LIB" == x; then
+       { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: no sqlite3 - e2scan will not support database based scanning" >&5
+$as_echo "$as_me: WARNING: no sqlite3 - e2scan will not support database based scanning" >&2;}
+fi
+
+fi
+
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for optreset" >&5
 $as_echo_n "checking for optreset... " >&6; }
 if ${ac_cv_have_optreset+:} false; then :
 
 # Check whether --with-multiarch was given.
 if test "${with_multiarch+set}" = set; then :
-  withval=$with_multiarch; libdir=$libdir/$withval
-root_libdir=$root_libdir/$withval
+  withval=$with_multiarch; if test "$withval" = "lib64"; then
+    libdir=/usr/lib64
+    root_libdir=/lib64
+else
+    libdir=$libdir/$withval
+    root_libdir=$root_libdir/$withval
+fi
 
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we can link with -static" >&5
 if test "$USE_INCLUDED_LIBINTL" = "yes" ; then
        INCLUDES=$INCLUDES' -I$(top_builddir)/intl -I$(top_srcdir)/intl'
 fi
+if test -n "$WITH_DIET_LIBC" ; then
+       INCLUDES="$INCLUDES -D_REENTRANT"
+fi
+
+
+        MKINSTALLDIRS=
+  if test -n "$ac_aux_dir"; then
+    case "$ac_aux_dir" in
+      /*) MKINSTALLDIRS="$ac_aux_dir/mkinstalldirs" ;;
+      *) MKINSTALLDIRS="\$(top_builddir)/$ac_aux_dir/mkinstalldirs" ;;
+    esac
+  fi
+  if test -z "$MKINSTALLDIRS"; then
+    MKINSTALLDIRS="\$(top_srcdir)/mkinstalldirs"
+  fi
+
 
 if test $cross_compiling = no; then
-   BUILD_CFLAGS="$CFLAGS $CPPFLAGS"
+   BUILD_CFLAGS="$CFLAGS $CPPFLAGS $INCLUDES -DHAVE_CONFIG_H"
    BUILD_LDFLAGS="$LDFLAGS"
-else
-   BUILD_CFLAGS=
-   BUILD_LDFLAGS=
 fi
 
 
@@ -11409,6 +11628,10 @@ 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 \
+       e2fsprogs-RHEL-6.spec \
+       e2fsprogs-SUSE_LINUX-11.spec \
+       e2fsprogs-RHEL-7.spec \
+       e2fsprogs-SUSE_LINUX-12.spec \
        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 \
@@ -11417,7 +11640,7 @@ for i in MCONFIG Makefile e2fsprogs.spec \
        lib/ss/ss.pc lib/uuid/uuid.pc lib/et/com_err.pc \
        lib/e2p/e2p.pc lib/blkid/blkid.pc lib/ext2fs/ext2fs.pc \
        misc/Makefile ext2ed/Makefile e2fsck/Makefile \
-       debugfs/Makefile tests/Makefile tests/progs/Makefile \
+       debugfs/Makefile e2scan/Makefile tests/Makefile tests/progs/Makefile \
        resize/Makefile doc/Makefile intl/Makefile \
        intl/libgnuintl.h po/Makefile.in ; do
        if test -d `dirname ${srcdir}/$i` ; then