]> git.ipfire.org Git - thirdparty/dracut.git/blobdiff - configure
iscsi: always popd, even if there is no iscsi device
[thirdparty/dracut.git] / configure
index 409256bbeb2861ecdf6c39edc7863ae96833a21e..b55fb6090a90186fcd3f625cf30fd9f59b50b00a 100755 (executable)
--- a/configure
+++ b/configure
@@ -1,6 +1,4 @@
 #!/bin/bash
-# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
-# ex: ts=8 sw=4 sts=4 et filetype=sh
 
 # We don't support srcdir != builddir
 echo \#buildapi-variable-no-builddir >/dev/null
@@ -9,6 +7,8 @@ prefix=/usr
 
 enable_documentation=yes
 
+PKG_CONFIG="${PKG_CONFIG:-pkg-config}"
+
 # Little helper function for reading args from the commandline.
 # it automatically handles -a b and -a=b variants, and returns 1 if
 # we need to shift $3.
@@ -25,6 +25,7 @@ read_arg() {
         # return 1 to indicate they should do it instead.
         return 1
     fi
+    return 0
 }
 
 while (($# > 0)); do
@@ -36,18 +37,49 @@ while (($# > 0)); do
         --sbindir) read_arg sbindir "$@" || shift;;
         --mandir) read_arg mandir "$@" || shift;;
         --disable-documentation) enable_documentation=no;;
+        --program-prefix) read_arg programprefix "$@" || shift;;
+        --exec-prefix) read_arg execprefix "$@" || shift;;
+        --bindir) read_arg bindir "$@" || shift;;
+        --includedir) read_arg includedir "$@" || shift;;
+        --libexecdir) read_arg libexecdir "$@" || shift;;
+        --localstatedir) read_arg localstatedir "$@" || shift;;
+        --sharedstatedir) read_arg sharedstatedir "$@" || shift;;
+        --infodir) read_arg infodir "$@" || shift;;
+        --systemdsystemunitdir) read_arg systemdsystemunitdir "$@" || shift;;
+        --bashcompletiondir) read_arg bashcompletiondir "$@" || shift;;
         *) echo "Ignoring unknown option '$1'";;
     esac
     shift
 done
 
-cat > Makefile.inc.tmp <<EOF
+if ! ${PKG_CONFIG} --exists --print-errors " libkmod >= 23 "; then
+    echo "dracut needs pkg-config and libkmod >= 23." >&2
+    exit 1
+fi
+
+cat > Makefile.inc.$$ <<EOF
 prefix ?= ${prefix}
 libdir ?= ${libdir:-${prefix}/lib}
 datadir ?= ${datadir:-${prefix}/share}
 sysconfdir ?= ${sysconfdir:-${prefix}/etc}
 sbindir ?= ${sbindir:-${prefix}/sbin}
 mandir ?= ${mandir:-${prefix}/share/man}
-enable_documentation ?= ${enable_documentation}
+enable_documentation ?= ${enable_documentation:-yes}
+bindir ?= ${bindir:-${prefix}/bin}
+KMOD_CFLAGS ?= $(${PKG_CONFIG} --cflags " libkmod >= 23 ")
+KMOD_LIBS ?= $(${PKG_CONFIG} --libs " libkmod >= 23 ")
 EOF
-mv Makefile.inc.tmp Makefile.inc
+
+{
+    [[ $programprefix ]] && echo "programprefix ?= ${programprefix}"
+    [[ $execprefix ]] && echo "execprefix ?= ${execprefix}"
+    [[ $includedir ]] && echo "includedir ?= ${includedir}"
+    [[ $libexecdir ]] && echo "libexecdir ?= ${libexecdir}"
+    [[ $localstatedir ]] && echo "localstatedir ?= ${localstatedir}"
+    [[ $sharedstatedir ]] && echo "sharedstatedir ?= ${sharedstatedir}"
+    [[ $infodir ]] && echo "infodir ?= ${infodir}"
+    [[ $systemdsystemunitdir ]] && echo "systemdsystemunitdir ?= ${systemdsystemunitdir}"
+    [[ $bashcompletiondir ]] && echo "bashcompletiondir ?= ${bashcompletiondir}"
+} >> Makefile.inc.$$
+
+mv Makefile.inc.$$ Makefile.inc