FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Integrate doxygen with autoconf infrastructure · openstack/liberasurecode@c85e1ba · GitHub

Commit c85e1ba

Browse files
committed
Integrate doxygen with autoconf infrastructure
Signed-off-by: Tushar Gohad <tushar.gohad@intel.com>
1 parent 2a10371 commit c85e1ba

6 files changed

Lines changed: 132 additions & 8 deletions

File tree

‎.gitignore‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,3 +44,8 @@ config_liberasurecode.h.in
4444
.deps
4545
config_liberasurecode.h
4646
stamp-h1
47+
48+
# doxygen documentation
49+
^doc/.*\.doxytag
50+
^doc/html
51+
^doc/doxygen.cfg

‎Makefile.am‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
# Top-level liberasurecode automake configuration
22
ACLOCAL_AMFLAGS = -I m4
33

4-
SUBDIRS = src test
4+
SUBDIRS = src test doc
5+
56
EXTRA_DIST = autogen.sh
67

78
INCLUDE = -I$(abs_top_builddir)/include \

‎aclocal.m4‎

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,46 @@ AC_PREREQ([2.50])dnl
114114
am_aux_dir=`cd $ac_aux_dir && pwd`
115115
])
116116

117+
# AM_COND_IF -*- Autoconf -*-
118+
119+
# Copyright (C) 2008, 2010 Free Software Foundation, Inc.
120+
#
121+
# This file is free software; the Free Software Foundation
122+
# gives unlimited permission to copy and/or distribute it,
123+
# with or without modifications, as long as this notice is preserved.
124+
125+
# serial 3
126+
127+
# _AM_COND_IF
128+
# _AM_COND_ELSE
129+
# _AM_COND_ENDIF
130+
# --------------
131+
# These macros are only used for tracing.
132+
m4_define([_AM_COND_IF])
133+
m4_define([_AM_COND_ELSE])
134+
m4_define([_AM_COND_ENDIF])
135+
136+
137+
# AM_COND_IF(COND, [IF-TRUE], [IF-FALSE])
138+
# ---------------------------------------
139+
# If the shell condition COND is true, execute IF-TRUE, otherwise execute
140+
# IF-FALSE. Allow automake to learn about conditional instantiating macros
141+
# (the AC_CONFIG_FOOS).
142+
AC_DEFUN([AM_COND_IF],
143+
[m4_ifndef([_AM_COND_VALUE_$1],
144+
[m4_fatal([$0: no such condition "$1"])])dnl
145+
_AM_COND_IF([$1])dnl
146+
if test -z "$$1_TRUE"; then :
147+
m4_n([$2])[]dnl
148+
m4_ifval([$3],
149+
[_AM_COND_ELSE([$1])dnl
150+
else
151+
$3
152+
])dnl
153+
_AM_COND_ENDIF([$1])dnl
154+
fi[]dnl
155+
])
156+
117157
# AM_CONDITIONAL -*- Autoconf -*-
118158

119159
# Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005, 2006, 2008

‎configure.ac‎

Lines changed: 45 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
################################################################################
2+
# Standard Stuff
3+
################################################################################
14
AC_INIT(liberasurecode,0.9.10)
25
AC_GNU_SOURCE
36

@@ -25,13 +28,20 @@ AC_PROG_MAKE_SET
2528

2629
AX_EXT()
2730

31+
################################################################################
32+
# System Headers
33+
################################################################################
2834
dnl Check for C library headers
2935
AC_HEADER_STDC
30-
AC_CHECK_HEADERS(sys/types.h stdio.h stdlib.h stddef.h stdarg.h malloc.h memory.h \
31-
string.h strings.h inttypes.h stdint.h ctype.h math.h iconv.h \
32-
signal.h dlfcn.h pthread.h unistd.h limits.h errno.h syslog.h)
36+
AC_CHECK_HEADERS(sys/types.h stdio.h stdlib.h stddef.h stdarg.h \
37+
malloc.h memory.h string.h strings.h inttypes.h \
38+
stdint.h ctype.h math.h iconv.h signal.h dlfcn.h \
39+
pthread.h unistd.h limits.h errno.h syslog.h)
3340
AC_CHECK_FUNCS(malloc calloc realloc free openlog)
3441

42+
#################################################################################
43+
# Debug/coverage Options
44+
#################################################################################
3545
AC_ARG_ENABLE([debug],
3646
[ --enable-debug Turn on debugging],
3747
[case "${enableval}" in
@@ -74,15 +84,47 @@ dnl Expand the sources and objects needed to build the library
7484
AC_SUBST(ac_aux_dir)
7585
AC_SUBST(OBJECTS)
7686

87+
#################################################################################
88+
# Doxygen Documentation
89+
#################################################################################
90+
AC_CHECK_PROG(DOXYGEN, doxygen, true, false)
91+
AM_CONDITIONAL(HAVE_DOXYGEN, $DOXYGEN)
92+
AC_SUBST(HAVE_DOXYGEN)
93+
94+
dnl Let people disable the doxygen stuff.
95+
AC_ARG_ENABLE(doxygen, [ --enable-doxygen Use doxygen to build documentation (default=auto)],
96+
enable_doxygen="$enableval",
97+
enable_doxygen=auto)
98+
99+
if test x$enable_doxygen = xauto ; then
100+
if test x$DOXYGEN = xtrue ; then
101+
enable_doxygen=yes
102+
else
103+
enable_doxygen=no
104+
fi
105+
fi
106+
107+
dnl NOTE: We need to use a separate automake conditional for this
108+
dnl to make this work with the tarballs.
109+
AM_CONDITIONAL(ENABLE_DOXYGEN, test x$enable_doxygen = xyes)
110+
111+
################################################################################
112+
# Output Files
113+
################################################################################
77114
AC_CONFIG_FILES([\
78115
src/builtin/null_code/Makefile \
79116
src/builtin/xor_codes/Makefile \
80117
src/Makefile \
81118
test/Makefile \
119+
doc/Makefile \
82120
Makefile \
83121
erasurecode.pc \
84122
Xorcode.pc
85123
])
86124

125+
AM_CONDITIONAL([HAVE_DOXYGEN], [test -n "$DOXYGEN"])
126+
AM_COND_IF([HAVE_DOXYGEN],
127+
[AC_CONFIG_FILES([doc/doxygen.cfg])])
128+
87129
AC_OUTPUT
88130

‎doc/Makefile.am‎

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
DOC_MODULE="liberasurecode"
2+
HTML_DIR=$(datadir)/$(DOC_MODULE)/html
3+
TARGET_DIR=$(HTML_DIR)/$(DOC_MODULE)
4+
5+
all-local: html/index.html
6+
7+
if ENABLE_DOXYGEN
8+
html/index.html: doxygen.cfg
9+
doxygen doxygen.cfg
10+
else
11+
html/index.html:
12+
endif
13+
14+
clean-local:
15+
rm -f *~ *.bak
16+
rm -rf html
17+
18+
install-data-local: html
19+
$(mkinstalldirs) $(DESTDIR)$(TARGET_DIR)
20+
(installfiles=`echo html/*`; \
21+
if test "$$installfiles" = 'html/*'; \
22+
then echo '-- Nothing to install' ; \
23+
else \
24+
for i in $$installfiles; do \
25+
echo '-- Installing '$$i ; \
26+
$(INSTALL_DATA) $$i $(DESTDIR)$(TARGET_DIR); \
27+
done; \
28+
fi)
29+
30+
dist-hook:
31+
mkdir $(distdir)/html
32+
mkdir $(distdir)/man
33+
-cp html/* $(distdir)/html
34+
-cp man/* $(distdir)/man
35+
36+
.PHONY : html latex man

doc/Doxyfile renamed to doc/doxygen.cfg.in

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,13 +32,13 @@ DOXYFILE_ENCODING = UTF-8
3232
# title of most generated pages and in a few other places.
3333
# The default value is: My Project.
3434

35-
PROJECT_NAME = "liberasurecode"
35+
PROJECT_NAME = @PACKAGE_NAME@
3636

3737
# The PROJECT_NUMBER tag can be used to enter a project or revision number. This
3838
# could be handy for archiving the generated documentation or if some version
3939
# control system is used.
4040

41-
PROJECT_NUMBER =
41+
PROJECT_NUMBER = @PACKAGE_VERSION@
4242

4343
# Using the PROJECT_BRIEF tag one can provide an optional one line description
4444
# for a project that appears at the top of each page and should give viewer a
@@ -751,8 +751,8 @@ WARN_LOGFILE =
751751
# spaces.
752752
# Note: If this tag is empty the current directory is searched.
753753

754-
INPUT = ../include/erasurecode/erasurecode.h \
755-
../include/erasurecode/erasurecode_backend.h
754+
INPUT = @top_srcdir@/include/erasurecode/erasurecode.h \
755+
@top_srcdir@/include/erasurecode/erasurecode_backend.h
756756

757757
# This tag can be used to specify the character encoding of the source files
758758
# that doxygen parses. Internally doxygen uses the UTF-8 encoding. Doxygen uses

0 commit comments

Comments
 (0)

Back | FazBrowse Home | New Git URL