Skip to content

Commit

Permalink
autotools: attach doxygen target into all target
Browse files Browse the repository at this point in the history
v2: disable man pages by default
  • Loading branch information
yuangongji authored and azat committed Aug 27, 2019
1 parent 1d1c190 commit f9c6a14
Show file tree
Hide file tree
Showing 6 changed files with 694 additions and 27 deletions.
1 change: 1 addition & 0 deletions Documentation/Building.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ The configure script also supports the following flags:
management functions.
--disable-openssl Disable support for OpenSSL encryption.
--disable-thread-support Don't support multithreaded environments.
--enable-doxygen-doc Build doxygen documentation
```

## Building on Windows
Expand Down
46 changes: 23 additions & 23 deletions Doxyfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@
# The PROJECT_NAME tag is a single word (or a sequence of words surrounded
# by quotes) that should identify the project.

PROJECT_NAME = libevent
PROJECT_NAME = $(PROJECT)-$(VERSION)

# Place all output under 'doxygen/'

OUTPUT_DIRECTORY = doxygen/
OUTPUT_DIRECTORY = $(DOCDIR)

# If the JAVADOC_AUTOBRIEF tag is set to YES then Doxygen
# will interpret the first line (until the first dot) of a JavaDoc-style
Expand Down Expand Up @@ -64,24 +64,24 @@ STRIP_FROM_PATH = include/
# with spaces.

INPUT = \
include/event2/buffer.h \
include/event2/buffer_compat.h \
include/event2/bufferevent.h \
include/event2/bufferevent_compat.h \
include/event2/bufferevent_ssl.h \
include/event2/dns.h \
include/event2/dns_compat.h \
include/event2/event.h \
include/event2/event_compat.h \
include/event2/http.h \
include/event2/http_compat.h \
include/event2/listener.h \
include/event2/rpc.h \
include/event2/rpc_compat.h \
include/event2/tag.h \
include/event2/tag_compat.h \
include/event2/thread.h \
include/event2/util.h
$(SRCDIR)/include/event2/buffer.h \
$(SRCDIR)/include/event2/buffer_compat.h \
$(SRCDIR)/include/event2/bufferevent.h \
$(SRCDIR)/include/event2/bufferevent_compat.h \
$(SRCDIR)/include/event2/bufferevent_ssl.h \
$(SRCDIR)/include/event2/dns.h \
$(SRCDIR)/include/event2/dns_compat.h \
$(SRCDIR)/include/event2/event.h \
$(SRCDIR)/include/event2/event_compat.h \
$(SRCDIR)/include/event2/http.h \
$(SRCDIR)/include/event2/http_compat.h \
$(SRCDIR)/include/event2/listener.h \
$(SRCDIR)/include/event2/rpc.h \
$(SRCDIR)/include/event2/rpc_compat.h \
$(SRCDIR)/include/event2/tag.h \
$(SRCDIR)/include/event2/tag_compat.h \
$(SRCDIR)/include/event2/thread.h \
$(SRCDIR)/include/event2/util.h

#---------------------------------------------------------------------------
# configuration options related to the HTML output
Expand All @@ -90,7 +90,7 @@ INPUT = \
# If the GENERATE_HTML tag is set to YES (the default) Doxygen will
# generate HTML output.

GENERATE_HTML = YES
GENERATE_HTML = $(GENERATE_HTML)

#---------------------------------------------------------------------------
# configuration options related to the LaTeX output
Expand All @@ -99,7 +99,7 @@ GENERATE_HTML = YES
# If the GENERATE_LATEX tag is set to YES (the default) Doxygen will
# generate Latex output.

GENERATE_LATEX = YES
GENERATE_LATEX = $(GENERATE_LATEX)

# The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put.
# If a relative path is entered the value of OUTPUT_DIRECTORY will be
Expand Down Expand Up @@ -175,7 +175,7 @@ LATEX_HIDE_INDICES = NO
# If the GENERATE_MAN tag is set to YES (the default) Doxygen will
# generate man pages

GENERATE_MAN = NO
GENERATE_MAN = $(GENERATE_MAN)

# The MAN_EXTENSION tag determines the extension that is added to
# the generated man pages (default is the subroutine's section .3)
Expand Down
4 changes: 1 addition & 3 deletions Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -340,9 +340,7 @@ endif

verify: check

doxygen: FORCE
doxygen $(srcdir)/Doxyfile
FORCE:
include doxygen.am

DISTCLEANFILES += *~ libevent.pc libevent_core.pc libevent_extra.pc ./include/event2/event-config.h

15 changes: 14 additions & 1 deletion configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -796,7 +796,6 @@ if test x$enable_debug_mode = xno; then
AC_DEFINE(DISABLE_DEBUG_MODE, 1,
[Define if libevent should build without support for a debug mode])
fi

# check if we should enable verbose debugging
if test x$enable_verbose_debug = xyes; then
CFLAGS="$CFLAGS -DUSE_DEBUG"
Expand Down Expand Up @@ -953,5 +952,19 @@ AC_SUBST([LIBEVENT_GC_SECTIONS])

AM_CONDITIONAL([INSTALL_LIBEVENT], [test "$enable_libevent_install" = "yes"])

# Doxygen support
DX_HTML_FEATURE(ON)
DX_MAN_FEATURE(OFF)
DX_RTF_FEATURE(OFF)
DX_XML_FEATURE(OFF)
DX_PDF_FEATURE(OFF)
DX_PS_FEATURE(OFF)
DX_CHM_FEATURE(OFF)
DX_CHI_FEATURE(OFF)
DX_INIT_DOXYGEN([libevent], [${top_srcdir}/Doxyfile], [doxygen])

AM_CONDITIONAL([ENABLE_DOXYGEN], [test "$DX_FLAG_doc" = "1"])
AM_CONDITIONAL([ENABLE_DOXYGEN_MAN], [test "$DX_FLAG_man" = "1"])

AC_CONFIG_FILES( [libevent.pc libevent_openssl.pc libevent_pthreads.pc libevent_core.pc libevent_extra.pc] )
AC_OUTPUT(Makefile)
55 changes: 55 additions & 0 deletions doxygen.am
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
# Doxygen documentation will not be generated with default configuration,
# unless '--enable-doxygen-doc' is configured.
# The following targets are all about doxygen:
# make # 'make doxygen' would be auto executed
# make doxygen # generating doxygen documentation
# make doxygen-doc # same as 'make doxygen'
# make clean # clean docs generated by doxygen
# make install # install doxygen documentation
# make uninstall # uninstall doxygen documentation

if ENABLE_DOXYGEN

# Add all needed rules defined in ax_prog_doxygen.m4
@DX_RULES@

# Use 'make clean' to clean docs generated by doxygen.
clean-local:
-rm -rf $(DX_CLEANFILES)

# integrate doxygen with automake targets
man3_MANS = @DX_DOCDIR@/man/man3/*
$(man3_MANS): doxygen-doc

# Docs will be installed. It may be one or more docs supported
# by doxygen, but does not include 'man'.
docdirs = $(DX_INSTALL_DOCS)

# Rules for installing docs generated by doxygen into $(htmldir),
# The typical value of $(htmldir) is '/usr/local/share/doc/$(PACKAGE)'
install-data-local:
@if ! test -d "$(DESTDIR)$(htmldir)"; then \
echo "$(mkinstalldirs) '$(DESTDIR)$(htmldir)'"; \
$(mkinstalldirs) '$(DESTDIR)$(htmldir)'; \
fi
@for d in $(docdirs); do \
echo "cp -pR $$d '$(DESTDIR)$(htmldir)/'"; \
cp -pR $$d '$(DESTDIR)$(htmldir)/'; \
done

# Rules for uninstalling docs generated by doxygen from $(htmldir)
uninstall-local:
@for d in $(docdirs); do \
d=`basename $$d`; \
echo "test ! -d '$(DESTDIR)$(htmldir)/'$$d || \
{ find '$(DESTDIR)$(htmldir)/'$$d -type d ! -perm -200 -exec chmod u+w '{}' ';' && \
rm -rf '$(DESTDIR)$(htmldir)/'$$d; }"; \
test ! -d '$(DESTDIR)$(htmldir)/'$$d || \
{ find '$(DESTDIR)$(htmldir)/'$$d -type d ! -perm -200 -exec chmod u+w '{}' ';' && \
rm -rf '$(DESTDIR)$(htmldir)/'$$d; }; \
done
rmdir "$(DESTDIR)$(htmldir)/" || true

doxygen: doxygen-doc

endif ENABLE_DOXYGEN
Loading

0 comments on commit f9c6a14

Please sign in to comment.