Commits

braindamaged committed 7e83412

gtk-doc made optional

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() {
        [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}
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.