add libudev-only build
authorSylvain BERTRAND <[email protected]>
Thu, 11 Jun 2015 14:12:21 +0000 (11 14:12 +0000)
committerSylvain BERTRAND <[email protected]>
Thu, 11 Jun 2015 14:12:21 +0000 (11 14:12 +0000)
make

diff --git a/make b/make
index ca5c929..d5cbf04 100755 (executable)
--- a/make
+++ b/make
@@ -177,6 +177,8 @@ pci_database_default='$prefix/share/hwdata/pci.ids'
 version_default=189
 set_default $CMDLINE_SET
 
+libudev_only=no
+
 ################################################################################
 
 show_help(){
@@ -192,6 +194,7 @@ Help options:
   --help                               print this message
 
 Standard options:
+  --libudev-only                       build only libudev
   --enable-logging                     enable logging code paths
   --enable-debug                       enable debug code paths
 
@@ -237,6 +240,9 @@ for opt do
         --enable-debug)
             CPPFLAGS="$CPPFLAGS -DENABLE_DEBUG"
         ;;
+        --libudev-only)
+            libudev_only=yes
+        ;;
         --man)
             MAN=yes
         ;;
@@ -321,17 +327,23 @@ CPPFLAGS="$CPPFLAGS -DVERSION=\"$e_version\""
 ################################################################################
 
 . $src_path/make.libudev.sh
-. $src_path/make.udevd_all.sh
+if test x$libudev_only != xyes; then
+    . $src_path/make.udevd_all.sh
+fi
 
 ################################################################################
 
-sep_start;echo 'generating pkg-config files for libudev and udev'
 mkdir -p -- "$fake_root/$e_libdir/pkgconfig"
 
-cp -f $src_path/src/udev.pc.in "$fake_root/$e_libdir/pkgconfig/udev.pc"
-sed -i "s%@VERSION@%$version%" "$fake_root/$e_libdir/pkgconfig/udev.pc"
-sed -i "s%@pkglibexecdir@%$e_pkglibexecdir%" "$fake_root/$e_libdir/pkgconfig/udev.pc"
+if test x$libudev_only != xyes; then
+    sep_start;echo 'generating pkg-config file for udev'
+    cp -f $src_path/src/udev.pc.in "$fake_root/$e_libdir/pkgconfig/udev.pc"
+    sed -i "s%@VERSION@%$version%" "$fake_root/$e_libdir/pkgconfig/udev.pc"
+    sed -i "s%@pkglibexecdir@%$e_pkglibexecdir%" "$fake_root/$e_libdir/pkgconfig/udev.pc"
+    sep_end
+fi
 
+sep_start;echo 'generating pkg-config file for libudev'
 cp -f $src_path/src/libudev.pc.in "$fake_root/$e_libdir/pkgconfig/libudev.pc"
 sed -i "s%@VERSION@%$version%" "$fake_root/$e_libdir/pkgconfig/libudev.pc"
 sed -i "s%@prefix@%$e_prefix%" "$fake_root/$e_libdir/pkgconfig/libudev.pc"
@@ -342,17 +354,20 @@ sep_end
 
 ################################################################################
 
-sep_start;echo 'fake installing the system udev rules'
-mkdir -p -- "$fake_root/$e_pkglibexecdir"
-rm -Rf -- "$fake_root/$e_pkglibexecdir/rules.d"
-cp -rf -- "$src_path/rules" "$fake_root/$e_pkglibexecdir/rules.d"
-sep_end
+if test x$libudev_only != xyes; then
+    sep_start;echo 'fake installing the system udev rules'
+    mkdir -p -- "$fake_root/$e_pkglibexecdir"
+    rm -Rf -- "$fake_root/$e_pkglibexecdir/rules.d"
+    cp -rf -- "$src_path/rules" "$fake_root/$e_pkglibexecdir/rules.d"
+    sep_end
+fi
 
 ################################################################################
 
 if [ -z "$MAN" ]; then
     exit 0
 fi
+#hardly tested...
 sep_start;echo 'generating man pages'
 mkdir -p -- "$fake_root/$e_prefix/share/man8" "$fake_root/$e_prefix/share/man7"
 xsltproc -o "$fake_root/$e_prefix/share/man7/udev.7" -nonet http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl "$src_path/src/udev.xml"