Commits

braindamaged  committed 7e83412

gtk-doc made optional

  • Participants
  • Parent commits c2b52e5

Comments (0)

Files changed (3)

 SUBDIRS = .
 
 ACLOCAL_AMFLAGS = -I m4 ${ACLOCAL_FLAGS}
-
 AM_MAKEFLAGS = --no-print-directory
 
 LIBUDEV_CURRENT=13
 	--enable-debug \
 	--enable-rule_generator \
 	--enable-floppy \
-	--with-selinux \
-	--enable-gtk-doc
+	--with-selinux
+
+if ENABLE_GTK_DOC
+DISTCHECK_CONFIGURE_FLAGS += --enable-gtk-doc
+endif
 
 BUILT_SOURCES =
 EXTRA_DIST =
 	$(AM_V_GEN)chmod +x $@
 
 # ------------------------------------------------------------------------------
+if ENABLE_GTK_DOC
 SUBDIRS += src/docs
+endif
 
 include_HEADERS = src/libudev.h
 lib_LTLIBRARIES = libudev.la
 
 # ------------------------------------------------------------------------------
 if ENABLE_GUDEV
+
+if ENABLE_GTK_DOC
 SUBDIRS += src/gudev/docs
+endif
 
 libgudev_includedir=$(includedir)/gudev-1.0/gudev
 libgudev_include_HEADERS = \
         echo "Activated pre-commit hook."
 fi
 
-gtkdocize --copy
+if which gtkdocize >/dev/null 2>/dev/null; then
+    gtkdocize --copy
+else
+    echo "You don't have gtk-doc installed, documentation generation disabled."
+    # THE FOLLOWING IS UGLY
+    rm gtk-doc.make
+    echo 'EXTRA_DIST =' > gtk-doc.make
+fi
+
 autoreconf --install --symlink
 
 libdir() {

File configure.ac

        [https://bitbucket.org/braindamaged/udev])
 AC_CONFIG_SRCDIR([src/udevd.c])
 AC_CONFIG_AUX_DIR([build-aux])
-AM_INIT_AUTOMAKE([check-news foreign 1.11 -Wall -Wno-portability silent-rules tar-pax no-dist-gzip dist-xz subdir-objects])
+AC_CONFIG_MACRO_DIR([m4])
+AM_INIT_AUTOMAKE([foreign 1.10 -Wall -Wno-portability silent-rules tar-pax no-dist-gzip dist-xz subdir-objects])
 AC_USE_SYSTEM_EXTENSIONS
 AC_SYS_LARGEFILE
-AC_CONFIG_MACRO_DIR([m4])
 AM_SILENT_RULES([yes])
 LT_INIT([disable-static])
 AC_PROG_AWK
 AC_PROG_SED
 AC_PROG_MKDIR_P
-GTK_DOC_CHECK(1.10)
+
+m4_ifdef([GTK_DOC_CHECK], [
+GTK_DOC_CHECK([1.10])
+], [AM_CONDITIONAL(ENABLE_GTK_DOC, false)])
+
+$(echo $ENABLE_GTK_DOC)
+
 AC_PREFIX_DEFAULT([/usr])
 
 AC_PATH_PROG([XSLTPROC], [xsltproc])
         debug:                   ${enable_debug}
         selinux:                 ${with_selinux}
 
-        man pages                ${enable_manpages}
+        man pages:               ${enable_manpages}
+        gtk-doc:                 ${enable_gtk_doc}
         gudev:                   ${enable_gudev}
         gintrospection:          ${enable_introspection}
         keymap:                  ${enable_keymap}