From: Alasdair Kergon Date: Wed, 8 Jan 2003 22:44:07 +0000 (+0000) Subject: configure --disable-devmapper if you don't have libdevmapper X-Git-Tag: v2_02_91~5485 X-Git-Url: https://sourceware.org/git/?a=commitdiff_plain;h=199e490e7d71b21a3e5e1495c9981260f570c1bf;p=lvm2.git configure --disable-devmapper if you don't have libdevmapper --- diff --git a/configure b/configure index 0b2b01393..3c94eb3b5 100755 --- a/configure +++ b/configure @@ -28,6 +28,8 @@ ac_help="$ac_help --enable-readline Enable readline support" ac_help="$ac_help --enable-debug Enable debugging" +ac_help="$ac_help + --disable-devmapper Disable device-mapper interaction" # Initialize some variables set by options. # The variables have the same names as the options, with @@ -564,7 +566,7 @@ do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:568: checking for $ac_word" >&5 +echo "configure:570: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_AWK'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -596,7 +598,7 @@ done # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:600: checking for $ac_word" >&5 +echo "configure:602: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -626,7 +628,7 @@ if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:630: checking for $ac_word" >&5 +echo "configure:632: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -677,7 +679,7 @@ fi # Extract the first word of "cl", so it can be a program name with args. set dummy cl; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:681: checking for $ac_word" >&5 +echo "configure:683: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -709,7 +711,7 @@ fi fi echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6 -echo "configure:713: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 +echo "configure:715: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 ac_ext=c # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. @@ -720,12 +722,12 @@ cross_compiling=$ac_cv_prog_cc_cross cat > conftest.$ac_ext << EOF -#line 724 "configure" +#line 726 "configure" #include "confdefs.h" main(){return(0);} EOF -if { (eval echo configure:729: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:731: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ac_cv_prog_cc_works=yes # If we can't run a trivial program, we are probably using a cross compiler. if (./conftest; exit) 2>/dev/null; then @@ -751,12 +753,12 @@ if test $ac_cv_prog_cc_works = no; then { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; } fi echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6 -echo "configure:755: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 +echo "configure:757: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6 cross_compiling=$ac_cv_prog_cc_cross echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6 -echo "configure:760: checking whether we are using GNU C" >&5 +echo "configure:762: checking whether we are using GNU C" >&5 if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -765,7 +767,7 @@ else yes; #endif EOF -if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:769: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then +if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:771: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then ac_cv_prog_gcc=yes else ac_cv_prog_gcc=no @@ -784,7 +786,7 @@ ac_test_CFLAGS="${CFLAGS+set}" ac_save_CFLAGS="$CFLAGS" CFLAGS= echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6 -echo "configure:788: checking whether ${CC-cc} accepts -g" >&5 +echo "configure:790: checking whether ${CC-cc} accepts -g" >&5 if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -827,7 +829,7 @@ fi # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # ./install, which can be erroneously created by make from ./install.sh. echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6 -echo "configure:831: checking for a BSD compatible install" >&5 +echo "configure:833: checking for a BSD compatible install" >&5 if test -z "$INSTALL"; then if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -880,7 +882,7 @@ test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}' test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' echo $ac_n "checking whether ln -s works""... $ac_c" 1>&6 -echo "configure:884: checking whether ln -s works" >&5 +echo "configure:886: checking whether ln -s works" >&5 if eval "test \"`echo '$''{'ac_cv_prog_LN_S'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -901,7 +903,7 @@ else fi echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6 -echo "configure:905: checking whether ${MAKE-make} sets \${MAKE}" >&5 +echo "configure:907: checking whether ${MAKE-make} sets \${MAKE}" >&5 set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -930,7 +932,7 @@ fi # Extract the first word of "ranlib", so it can be a program name with args. set dummy ranlib; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:934: checking for $ac_word" >&5 +echo "configure:936: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -963,12 +965,12 @@ for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr that defines DIR""... $ac_c" 1>&6 -echo "configure:967: checking for $ac_hdr that defines DIR" >&5 +echo "configure:969: checking for $ac_hdr that defines DIR" >&5 if eval "test \"`echo '$''{'ac_cv_header_dirent_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include <$ac_hdr> @@ -976,7 +978,7 @@ int main() { DIR *dirp = 0; ; return 0; } EOF -if { (eval echo configure:980: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:982: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* eval "ac_cv_header_dirent_$ac_safe=yes" else @@ -1001,7 +1003,7 @@ done # Two versions of opendir et al. are in -ldir and -lx on SCO Xenix. if test $ac_header_dirent = dirent.h; then echo $ac_n "checking for opendir in -ldir""... $ac_c" 1>&6 -echo "configure:1005: checking for opendir in -ldir" >&5 +echo "configure:1007: checking for opendir in -ldir" >&5 ac_lib_var=`echo dir'_'opendir | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -1009,7 +1011,7 @@ else ac_save_LIBS="$LIBS" LIBS="-ldir $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1026: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -1042,7 +1044,7 @@ fi else echo $ac_n "checking for opendir in -lx""... $ac_c" 1>&6 -echo "configure:1046: checking for opendir in -lx" >&5 +echo "configure:1048: checking for opendir in -lx" >&5 ac_lib_var=`echo x'_'opendir | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -1050,7 +1052,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lx $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1067: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -1084,7 +1086,7 @@ fi fi echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6 -echo "configure:1088: checking how to run the C preprocessor" >&5 +echo "configure:1090: checking how to run the C preprocessor" >&5 # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= @@ -1099,13 +1101,13 @@ else # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. cat > conftest.$ac_ext < Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1109: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1111: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then : @@ -1116,13 +1118,13 @@ else rm -rf conftest* CPP="${CC-cc} -E -traditional-cpp" cat > conftest.$ac_ext < Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1126: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1128: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then : @@ -1133,13 +1135,13 @@ else rm -rf conftest* CPP="${CC-cc} -nologo -E" cat > conftest.$ac_ext < Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1143: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1145: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then : @@ -1164,12 +1166,12 @@ fi echo "$ac_t""$CPP" 1>&6 echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6 -echo "configure:1168: checking for ANSI C header files" >&5 +echo "configure:1170: checking for ANSI C header files" >&5 if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include @@ -1177,7 +1179,7 @@ else #include EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1181: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1183: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -1194,7 +1196,7 @@ rm -f conftest* if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat > conftest.$ac_ext < EOF @@ -1212,7 +1214,7 @@ fi if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat > conftest.$ac_ext < EOF @@ -1233,7 +1235,7 @@ if test "$cross_compiling" = yes; then : else cat > conftest.$ac_ext < #define ISLOWER(c) ('a' <= (c) && (c) <= 'z') @@ -1244,7 +1246,7 @@ if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2); exit (0); } EOF -if { (eval echo configure:1248: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:1250: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then : else @@ -1271,17 +1273,17 @@ for ac_hdr in fcntl.h malloc.h sys/ioctl.h unistd.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:1275: checking for $ac_hdr" >&5 +echo "configure:1277: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1285: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1287: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -1309,12 +1311,12 @@ done echo $ac_n "checking for working const""... $ac_c" 1>&6 -echo "configure:1313: checking for working const" >&5 +echo "configure:1315: checking for working const" >&5 if eval "test \"`echo '$''{'ac_cv_c_const'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1369: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_c_const=yes else @@ -1384,21 +1386,21 @@ EOF fi echo $ac_n "checking for inline""... $ac_c" 1>&6 -echo "configure:1388: checking for inline" >&5 +echo "configure:1390: checking for inline" >&5 if eval "test \"`echo '$''{'ac_cv_c_inline'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_cv_c_inline=no for ac_kw in inline __inline__ __inline; do cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1404: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_c_inline=$ac_kw; break else @@ -1424,12 +1426,12 @@ EOF esac echo $ac_n "checking for off_t""... $ac_c" 1>&6 -echo "configure:1428: checking for off_t" >&5 +echo "configure:1430: checking for off_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_off_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #if STDC_HEADERS @@ -1457,12 +1459,12 @@ EOF fi echo $ac_n "checking for pid_t""... $ac_c" 1>&6 -echo "configure:1461: checking for pid_t" >&5 +echo "configure:1463: checking for pid_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_pid_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #if STDC_HEADERS @@ -1490,12 +1492,12 @@ EOF fi echo $ac_n "checking for size_t""... $ac_c" 1>&6 -echo "configure:1494: checking for size_t" >&5 +echo "configure:1496: checking for size_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_size_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #if STDC_HEADERS @@ -1523,12 +1525,12 @@ EOF fi echo $ac_n "checking for st_rdev in struct stat""... $ac_c" 1>&6 -echo "configure:1527: checking for st_rdev in struct stat" >&5 +echo "configure:1529: checking for st_rdev in struct stat" >&5 if eval "test \"`echo '$''{'ac_cv_struct_st_rdev'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include @@ -1536,7 +1538,7 @@ int main() { struct stat s; s.st_rdev; ; return 0; } EOF -if { (eval echo configure:1540: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1542: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_struct_st_rdev=yes else @@ -1557,12 +1559,12 @@ EOF fi echo $ac_n "checking whether time.h and sys/time.h may both be included""... $ac_c" 1>&6 -echo "configure:1561: checking whether time.h and sys/time.h may both be included" >&5 +echo "configure:1563: checking whether time.h and sys/time.h may both be included" >&5 if eval "test \"`echo '$''{'ac_cv_header_time'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include @@ -1571,7 +1573,7 @@ int main() { struct tm *tp; ; return 0; } EOF -if { (eval echo configure:1575: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1577: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_header_time=yes else @@ -1665,19 +1667,29 @@ else fi +# Check whether --enable-devmapper or --disable-devmapper was given. +if test "${enable_devmapper+set}" = set; then + enableval="$enable_devmapper" + \ +DEVMAPPER=no +else + DEVMAPPER=yes +fi + + if [ "x$exec_prefix" = xNONE -a "x$prefix" = xNONE ]; then exec_prefix=""; fi; if test $ac_cv_prog_gcc = yes; then echo $ac_n "checking whether ${CC-cc} needs -traditional""... $ac_c" 1>&6 -echo "configure:1675: checking whether ${CC-cc} needs -traditional" >&5 +echo "configure:1687: checking whether ${CC-cc} needs -traditional" >&5 if eval "test \"`echo '$''{'ac_cv_prog_gcc_traditional'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_pattern="Autoconf.*'x'" cat > conftest.$ac_ext < Autoconf TIOCGETP @@ -1695,7 +1707,7 @@ rm -f conftest* if test $ac_cv_prog_gcc_traditional = no; then cat > conftest.$ac_ext < Autoconf TCGETA @@ -1717,12 +1729,12 @@ echo "$ac_t""$ac_cv_prog_gcc_traditional" 1>&6 fi echo $ac_n "checking return type of signal handlers""... $ac_c" 1>&6 -echo "configure:1721: checking return type of signal handlers" >&5 +echo "configure:1733: checking return type of signal handlers" >&5 if eval "test \"`echo '$''{'ac_cv_type_signal'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include @@ -1739,7 +1751,7 @@ int main() { int i; ; return 0; } EOF -if { (eval echo configure:1743: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1755: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_type_signal=void else @@ -1758,12 +1770,12 @@ EOF echo $ac_n "checking for vprintf""... $ac_c" 1>&6 -echo "configure:1762: checking for vprintf" >&5 +echo "configure:1774: checking for vprintf" >&5 if eval "test \"`echo '$''{'ac_cv_func_vprintf'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1802: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_vprintf=yes" else @@ -1810,12 +1822,12 @@ fi if test "$ac_cv_func_vprintf" != yes; then echo $ac_n "checking for _doprnt""... $ac_c" 1>&6 -echo "configure:1814: checking for _doprnt" >&5 +echo "configure:1826: checking for _doprnt" >&5 if eval "test \"`echo '$''{'ac_cv_func__doprnt'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1854: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func__doprnt=yes" else @@ -1865,12 +1877,12 @@ fi for ac_func in mkdir rmdir uname do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:1869: checking for $ac_func" >&5 +echo "configure:1881: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1909: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -1921,14 +1933,14 @@ done if test x$READLINE = xyes; then echo $ac_n "checking for library containing tgetent""... $ac_c" 1>&6 -echo "configure:1925: checking for library containing tgetent" >&5 +echo "configure:1937: checking for library containing tgetent" >&5 if eval "test \"`echo '$''{'ac_cv_search_tgetent'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_func_search_save_LIBS="$LIBS" ac_cv_search_tgetent="no" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1955: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ac_cv_search_tgetent="none required" else @@ -1950,7 +1962,7 @@ rm -f conftest* test "$ac_cv_search_tgetent" = "no" && for i in ncurses curses termcap termlib; do LIBS="-l$i $ac_func_search_save_LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1977: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ac_cv_search_tgetent="-l$i" break @@ -1995,7 +2007,7 @@ fi if test x$READLINE = xyes; then echo $ac_n "checking for readline in -lreadline""... $ac_c" 1>&6 -echo "configure:1999: checking for readline in -lreadline" >&5 +echo "configure:2011: checking for readline in -lreadline" >&5 ac_lib_var=`echo readline'_'readline | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -2003,7 +2015,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lreadline $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2030: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -2051,12 +2063,12 @@ package as well (which may be called readline-devel or something similar). fi echo $ac_n "checking for rl_completion_matches""... $ac_c" 1>&6 -echo "configure:2055: checking for rl_completion_matches" >&5 +echo "configure:2067: checking for rl_completion_matches" >&5 if eval "test \"`echo '$''{'ac_cv_func_rl_completion_matches'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2095: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_rl_completion_matches=yes" else @@ -2117,6 +2129,7 @@ fi + trap '' 1 2 15 cat > confcache <<\EOF # This file is a shell script that caches the results of configure @@ -2294,6 +2307,7 @@ s%@OWNER@%$OWNER%g s%@GROUP@%$GROUP%g s%@LVM_VERSION@%$LVM_VERSION%g s%@DEBUG@%$DEBUG%g +s%@DEVMAPPER@%$DEVMAPPER%g CEOF EOF diff --git a/configure.in b/configure.in index c5241c275..f570f516e 100644 --- a/configure.in +++ b/configure.in @@ -89,6 +89,10 @@ dnl Enable Debugging AC_ARG_ENABLE(debug, [ --enable-debug Enable debugging], \ DEBUG=yes, DEBUG=no) +dnl Disable devmapper +AC_ARG_ENABLE(devmapper, [ --disable-devmapper Disable device-mapper interaction], \ +DEVMAPPER=no, DEVMAPPER=yes) + dnl Mess with default exec_prefix if [[ "x$exec_prefix" = xNONE -a "x$prefix" = xNONE ]]; then exec_prefix=""; @@ -150,6 +154,7 @@ AC_SUBST(GROUP) AC_SUBST(LIBS) AC_SUBST(LVM_VERSION) AC_SUBST(DEBUG) +AC_SUBST(DEVMAPPER) dnl First and last lines should not contain files to generate in order to dnl keep utility scripts running properly AC_OUTPUT( \ diff --git a/lib/Makefile.in b/lib/Makefile.in index 2b6076d41..433dccc9c 100644 --- a/lib/Makefile.in +++ b/lib/Makefile.in @@ -14,8 +14,6 @@ endif SOURCES=\ activate/activate.c \ - activate/dev_manager.c \ - activate/fs.c \ cache/cache.c \ commands/toolcontext.c \ config/config.c \ @@ -75,6 +73,12 @@ ifeq ("@DEBUG@", "yes") mm/dbg_malloc.c endif +ifeq ("@DEVMAPPER@", "yes") + SOURCES+=\ + activate/dev_manager.c \ + activate/fs.c +endif + TARGETS=liblvm.a include ../make.tmpl diff --git a/lib/activate/activate.c b/lib/activate/activate.c index 2cfad92fa..3ac2653ec 100644 --- a/lib/activate/activate.c +++ b/lib/activate/activate.c @@ -20,6 +20,60 @@ #define _skip(fmt, args...) log_very_verbose("Skipping: " fmt , ## args) +#ifndef DEVMAPPER_SUPPORT +void set_activation(int act) +{ + if (act) + log_error("Compiled without libdevmapper support. " + "Can't enable activation."); +} +int activation(void) +{ + return 0; +} +int library_version(char *version, size_t size) +{ + return 0; +} +int driver_version(char *version, size_t size) +{ + return 0; +} +int lv_info(const struct logical_volume *lv, struct lvinfo *info) +{ + return 0; +} +int lv_snapshot_percent(struct logical_volume *lv, float *percent) +{ + return 0; +} +int lvs_in_vg_activated(struct volume_group *vg) +{ + return 0; +} +int lvs_in_vg_opened(struct volume_group *vg) +{ + return 0; +} +int lv_suspend_if_active(struct cmd_context *cmd, const char *lvid_s) +{ + return 1; +} +int lv_resume_if_active(struct cmd_context *cmd, const char *lvid_s) +{ + return 1; +} +int lv_deactivate(struct cmd_context *cmd, const char *lvid_s) +{ + return 1; +} +int lv_activate(struct cmd_context *cmd, const char *lvid_s) +{ + return 1; +} + +#else /* DEVMAPPER_SUPPORT */ + static int _activation = 1; void set_activation(int act) @@ -82,10 +136,11 @@ int driver_version(char *version, size_t size) /* * Returns 1 if info structure populated, else 0 on failure. */ -int lv_info(const struct logical_volume *lv, struct dm_info *info) +int lv_info(const struct logical_volume *lv, struct lvinfo *info) { int r; struct dev_manager *dm; + struct dm_info dminfo; if (!activation()) return 0; @@ -95,9 +150,16 @@ int lv_info(const struct logical_volume *lv, struct dm_info *info) return 0; } - if (!(r = dev_manager_info(dm, lv, info))) + if (!(r = dev_manager_info(dm, lv, &dminfo))) stack; + info->exists = dminfo.exists; + info->suspended = dminfo.suspended; + info->open_count = dminfo.open_count; + info->major = dminfo.major; + info->minor = dminfo.minor; + info->read_only = dminfo.read_only; + dev_manager_destroy(dm); return r; } @@ -128,7 +190,7 @@ int lv_snapshot_percent(struct logical_volume *lv, float *percent) static int _lv_active(struct logical_volume *lv) { - struct dm_info info; + struct lvinfo info; if (!lv_info(lv, &info)) { stack; @@ -140,7 +202,7 @@ static int _lv_active(struct logical_volume *lv) static int _lv_open_count(struct logical_volume *lv) { - struct dm_info info; + struct lvinfo info; if (!lv_info(lv, &info)) { stack; @@ -244,7 +306,7 @@ int lvs_in_vg_opened(struct volume_group *vg) int lv_suspend_if_active(struct cmd_context *cmd, const char *lvid_s) { struct logical_volume *lv; - struct dm_info info; + struct lvinfo info; if (!activation()) return 1; @@ -274,7 +336,7 @@ int lv_suspend_if_active(struct cmd_context *cmd, const char *lvid_s) int lv_resume_if_active(struct cmd_context *cmd, const char *lvid_s) { struct logical_volume *lv; - struct dm_info info; + struct lvinfo info; if (!activation()) return 1; @@ -301,7 +363,7 @@ int lv_resume_if_active(struct cmd_context *cmd, const char *lvid_s) int lv_deactivate(struct cmd_context *cmd, const char *lvid_s) { struct logical_volume *lv; - struct dm_info info; + struct lvinfo info; if (!activation()) return 1; @@ -328,7 +390,7 @@ int lv_deactivate(struct cmd_context *cmd, const char *lvid_s) int lv_activate(struct cmd_context *cmd, const char *lvid_s) { struct logical_volume *lv; - struct dm_info info; + struct lvinfo info; if (!activation()) return 1; @@ -351,3 +413,5 @@ int lv_activate(struct cmd_context *cmd, const char *lvid_s) return 1; } + +#endif diff --git a/lib/activate/activate.h b/lib/activate/activate.h index 608f8b7a8..303f4dfd1 100644 --- a/lib/activate/activate.h +++ b/lib/activate/activate.h @@ -8,7 +8,19 @@ #define LVM_ACTIVATE_H #include "metadata.h" + +#ifdef DEVMAPPER_SUPPORT #include +#endif + +struct lvinfo { + int exists; + int suspended; + unsigned int open_count; + int major; + int minor; + int read_only; +}; void set_activation(int activation); int activation(void); @@ -19,7 +31,7 @@ int library_version(char *version, size_t size); /* * Returns 1 if info structure has been populated, else 0. */ -int lv_info(const struct logical_volume *lv, struct dm_info *info); +int lv_info(const struct logical_volume *lv, struct lvinfo *info); /* * Returns 1 if percent has been set, else 0. */ diff --git a/lib/commands/toolcontext.c b/lib/commands/toolcontext.c index cf6d51f1b..3427888c3 100644 --- a/lib/commands/toolcontext.c +++ b/lib/commands/toolcontext.c @@ -113,7 +113,9 @@ static void _init_logging(struct cmd_context *cmd) log_verbose("Logging initialised at %s", ctime(&t)); /* Tell device-mapper about our logging */ +#ifdef DEVMAPPER_SUPPORT dm_log_init(print_log); +#endif } static int _process_config(struct cmd_context *cmd) @@ -137,7 +139,9 @@ static int _process_config(struct cmd_context *cmd) return 0; } +#ifdef DEVMAPPER_SUPPORT dm_set_dev_dir(cmd->dev_dir); +#endif /* proc dir */ if (lvm_snprintf(cmd->proc_dir, sizeof(cmd->proc_dir), "%s", diff --git a/lib/config/defaults.h b/lib/config/defaults.h index 3cffe134f..8369507d5 100644 --- a/lib/config/defaults.h +++ b/lib/config/defaults.h @@ -51,7 +51,11 @@ #define DEFAULT_UNITS "h" #define DEFAULT_SUFFIX 1 -#define DEFAULT_ACTIVATION 1 +#ifdef DEVMAPPER_SUPPORT + #define DEFAULT_ACTIVATION 1 +#else + #define DEFAULT_ACTIVATION 0 +#endif #ifdef READLINE_SUPPORT #define DEFAULT_MAX_HISTORY 100 diff --git a/lib/display/display.c b/lib/display/display.c index 1989e70a3..10bc66965 100644 --- a/lib/display/display.c +++ b/lib/display/display.c @@ -335,7 +335,7 @@ int pvdisplay_short(struct cmd_context *cmd, struct volume_group *vg, void lvdisplay_colons(struct logical_volume *lv) { int inkernel; - struct dm_info info; + struct lvinfo info; inkernel = lv_info(lv, &info) && info.exists; log_print("%s%s/%s:%s:%d:%d:-1:%d:%" PRIu64 ":%d:-1:%d:%d:%d:%d", @@ -355,7 +355,7 @@ void lvdisplay_colons(struct logical_volume *lv) int lvdisplay_full(struct cmd_context *cmd, struct logical_volume *lv, void *handle) { - struct dm_info info; + struct lvinfo info; int inkernel, snap_active; char uuid[64]; struct snapshot *snap = NULL; diff --git a/lib/report/report.c b/lib/report/report.c index 7293de23c..974856d36 100644 --- a/lib/report/report.c +++ b/lib/report/report.c @@ -163,7 +163,7 @@ static int _lvstatus_disp(struct report_handle *rh, struct field *field, const void *data) { const struct logical_volume *lv = (const struct logical_volume *) data; - struct dm_info info; + struct lvinfo info; char *repstr; if (!(repstr = pool_zalloc(rh->mem, 7))) { diff --git a/make.tmpl.in b/make.tmpl.in index ab1b5db90..01debe4ef 100644 --- a/make.tmpl.in +++ b/make.tmpl.in @@ -85,6 +85,10 @@ ifeq ("@READLINE@", "yes") CFLAGS += -DREADLINE_SUPPORT endif +ifeq ("@DEVMAPPER@", "yes") + CFLAGS += -DDEVMAPPER_SUPPORT +endif + ifeq ("@HAVE_RL_COMPLETION_MATCHES@", "yes") CFLAGS += -DHAVE_RL_COMPLETION_MATCHES endif diff --git a/tools/Makefile.in b/tools/Makefile.in index 604e942bb..d3df40750 100644 --- a/tools/Makefile.in +++ b/tools/Makefile.in @@ -62,11 +62,17 @@ TARGETS=\ .commands \ lvm +LVMLIBS=-llvm + +ifeq ("@DEVMAPPER@", "yes") + LVMLIBS += -ldevmapper +endif + include ../make.tmpl lvm: $(OBJECTS) $(top_srcdir)/lib/liblvm.a $(CC) -o lvm $(OBJECTS) $(LD_FLAGS) -L$(top_srcdir)/lib \ - -L$(DESTDIR)/lib -llvm -ldevmapper $(LIBS) -ldl -rdynamic + -L$(DESTDIR)/lib $(LVMLIBS) $(LIBS) -ldl -rdynamic .commands: commands.h cmdnames.h Makefile $(CC) -E -P cmdnames.h | egrep -v '(help|version)' > .commands diff --git a/tools/lvremove.c b/tools/lvremove.c index a41c1e59d..69bb019a9 100644 --- a/tools/lvremove.c +++ b/tools/lvremove.c @@ -24,7 +24,7 @@ static int lvremove_single(struct cmd_context *cmd, struct logical_volume *lv, void *handle) { struct volume_group *vg; - struct dm_info info; + struct lvinfo info; vg = lv->vg; diff --git a/tools/lvresize.c b/tools/lvresize.c index a02d638a8..b92fed39c 100644 --- a/tools/lvresize.c +++ b/tools/lvresize.c @@ -24,7 +24,7 @@ int lvresize(struct cmd_context *cmd, int argc, char **argv) { struct volume_group *vg; struct logical_volume *lv; - struct dm_info info; + struct lvinfo info; uint32_t extents = 0; uint32_t size = 0; uint32_t stripes = 0, ssize = 0, stripesize_extents = 0; diff --git a/tools/lvscan.c b/tools/lvscan.c index 27b447ae5..996f19c97 100644 --- a/tools/lvscan.c +++ b/tools/lvscan.c @@ -23,7 +23,7 @@ static int lvscan_single(struct cmd_context *cmd, struct logical_volume *lv, void *handle) { - struct dm_info info; + struct lvinfo info; int lv_total = 0; ulong lv_capacity_total = 0;