From 8fda5a74f1f8273c1db1b60bcd7250cb9e313a60 Mon Sep 17 00:00:00 2001 From: Xorg Date: Sun, 5 Jun 2016 12:09:59 +0200 Subject: [PATCH] Generate and install man-pages if Doxygen is installed --- configure.ac | 2 ++ libcpuid/Makefile.am | 26 ++++++++++++++++++++++++++ 2 files changed, 28 insertions(+) diff --git a/configure.ac b/configure.ac index c8a3066..55f88fb 100644 --- a/configure.ac +++ b/configure.ac @@ -39,6 +39,8 @@ AM_PROG_LIBTOOL AM_CPPFLAGS="$CPPFLAGS" AC_CHECK_HEADERS([stdint.h]) +AC_CHECK_PROGS([DOXYGEN], [doxygen]) +AM_CONDITIONAL([HAVE_DOXYGEN], [test -n "$DOXYGEN"]) AM_LDFLAGS="$LDFLAGS" if test "x$GCC" = "xyes"; then diff --git a/libcpuid/Makefile.am b/libcpuid/Makefile.am index 2710898..e53b7bc 100644 --- a/libcpuid/Makefile.am +++ b/libcpuid/Makefile.am @@ -33,3 +33,29 @@ noinst_HEADERS = \ rdtsc.h EXTRA_DIST += libcpuid.sym libcpuid_vc71.vcproj libcpuid_vc9.vcproj + +if HAVE_DOXYGEN +directory = $(top_srcdir)/libcpuid/docs/man/man3 + +dist_man_MANS = $(directory)/cpu_id_t.3 \ + $(directory)/cpu_list_t.3 \ + $(directory)/cpu_mark_t.3 \ + $(directory)/cpu_raw_data_t.3 \ + $(directory)/libcpuid.3 +$(directory)/cpu_id_t.3: doxyfile.stamp +$(directory)/cpu_list_t.3: doxyfile.stamp +$(directory)/cpu_mark_t.3: doxyfile.stamp +$(directory)/cpu_raw_data_t.3: doxyfile.stamp +$(directory)/libcpuid.3: doxyfile.stamp + +doxyfile.stamp: + $(DOXYGEN) Doxyfile + echo Timestamp > doxyfile.stamp + +CLEANFILES = doxyfile.stamp + +all-local: doxyfile.stamp + +clean-local: + rm -rf $(top_srcdir)/libcpuid/docs +endif