Skip to content

Commit

Permalink
upgrade gtkdoc to latest version (remove templates); add xmlsec-mscng (
Browse files Browse the repository at this point in the history
  • Loading branch information
lsh123 authored May 26, 2018
1 parent 336f7e3 commit 30391bb
Show file tree
Hide file tree
Showing 307 changed files with 10,170 additions and 17,272 deletions.
5 changes: 0 additions & 5 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -64,12 +64,7 @@ docs/api/code
docs/api/sgml.tmp
docs/api/xmlsec-*.txt
docs/api/*.bak
docs/api/tmpl/base/*.bak
docs/api/tmpl/openssl/*.bak
docs/api/tmpl/nss/*.bak
docs/api/*.types
docs/api/sgml.stamp
docs/api/tmpl.stamp
docs/api/tmpl/.sentinel
docs/html.stamp

3 changes: 1 addition & 2 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,6 @@ if test "z$enable_docs_build" = "zyes" ; then
AC_PATH_PROG(XSLTPROC, xsltproc)
AC_PATH_PROG(MAN2HTML, man2html)
AC_PATH_PROG(GTKDOC_MKHTML, gtkdoc-mkhtml)
AC_PATH_PROG(GTKDOC_MKTMPL, gtkdoc-mktmpl)
AC_PATH_PROG(GTKDOC_MKDB, gtkdoc-mkdb)
AC_PATH_PROG(GTKDOC_SCAN, gtkdoc-scan)

Expand All @@ -127,7 +126,7 @@ AM_CONDITIONAL(HAS_MAN2HTML, [test x"$MAN2HTML" != x])
AM_CONDITIONAL(HAS_XSLTPROC, [test x"$XSLTPROC" != x])

AM_CONDITIONAL(BUILD_MAN_DOCS, [test x"$PERL" != x && test x"$XSLTPROC" != x && test x"$MAN2HTML" != x])
AM_CONDITIONAL(BUILD_API_DOCS, [test x"$PERL" != x && test x"$XSLTPROC" != x && test x"$GTKDOC_MKHTML" != x && test x"$GTKDOC_MKTMPL" != x && test x"$GTKDOC_MKDB" != x && test x"$GTKDOC_SCAN" != x])
AM_CONDITIONAL(BUILD_API_DOCS, [test x"$PERL" != x && test x"$XSLTPROC" != x && test x"$GTKDOC_MKHTML" != x && test x"$GTKDOC_MKDB" != x && test x"$GTKDOC_SCAN" != x])

dnl ==========================================================================
dnl Perform host specific configuration
Expand Down
136 changes: 44 additions & 92 deletions docs/api/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,17 @@ INCLUDE_DIR2=$(top_builddir)/include

SCAN_DIR=$(builddir)
SGML_DIR=$(builddir)/sgml.tmp
XML_DIR=$(builddir)/xml.tmp
EXAMPLES_DIR=$(SGML_DIR)/examples
SOURCE_CODE_DIR=$(builddir)/code

GTKDOC_MKDB_OUTPUT_DIR=$(builddir)/xml

# We need to copy some files to make gkdoc happy that
# everything is in one folder
TMPL_DIR=$(builddir)/tmpl
TMPL_SRC_DIR=$(srcdir)/tmpl

MAIN_SGML_FILE=$(SGML_DIR)/xmlsec-main.sgml
MAIN_SGML_FILE=$(SGML_DIR)/xmlsec.sgml
MAIN_SGML_SRC_FILE=$(srcdir)/src/xmlsec.sgml

SGML_CHAPTERS_DIR=$(SGML_DIR)/chapters
Expand All @@ -43,6 +43,15 @@ SOURCE_FILES_TO_COPY = \
$(srcdir)/*.png \
$(NULL)

CRYPTO_LIBS_LIST = \
openssl \
nss \
gnutls \
gcrypt \
mscrypto \
mscng \
$(NULL)

#
# We need to pre-process original source files
# because gtkdoc does not understand some C features
Expand Down Expand Up @@ -83,7 +92,7 @@ docs:
endif

html-cleanup: html
( echo "Cleaning up result files"; \
@( echo "Cleaning up result files"; \
$(PERL) $(REMOVE_GTKDOCLINK) `find . -name "*.html" -print` \
)

Expand Down Expand Up @@ -127,103 +136,46 @@ sgml: sgml-base
mv -f $$i.tmp $$i; \
done);

sgml-base: templates $(SGML_DIR)/.sentinel
$(GTKDOC_MKDB) --module=xmlsec \
# gtkdoc-mkdb doesn't support --output-dir thus we have to "hack" it a litle bit
sgml-base: scan $(SGML_DIR)/.sentinel
@( \
echo "Create DocBook files for xmlsec-core" ; \
rm -rf $(GTKDOC_MKDB_OUTPUT_DIR) $(SGML_DIR)/base ; \
$(GTKDOC_MKDB) --module=xmlsec \
--xml-mode \
--main-sgml-file=$(SGML_DIR)/xmlsec-base.sgml \
--output-dir=$(SGML_DIR)/ \
--tmpl-dir=$(TMPL_DIR)/base \
--source-dir=$(SOURCE_CODE_DIR)/src/base \
--source-dir=$(SOURCE_CODE_DIR)/include/xmlsec/base
$(GTKDOC_MKDB) --module=xmlsec-openssl \
--xml-mode \
--main-sgml-file=$(SGML_DIR)/xmlsec-openssl.sgml \
--tmpl-dir=$(TMPL_DIR)/openssl \
--output-dir=$(SGML_DIR)/openssl \
--source-dir=$(SOURCE_CODE_DIR)/src/openssl \
--source-dir=$(SOURCE_CODE_DIR)/include/xmlsec/openssl
$(GTKDOC_MKDB) --module=xmlsec-gnutls \
--xml-mode \
--main-sgml-file=$(SGML_DIR)/xmlsec-gnutls.sgml \
--tmpl-dir=$(TMPL_DIR)/gnutls \
--output-dir=$(SGML_DIR)/gnutls \
--source-dir=$(SOURCE_CODE_DIR)/src/gnutls \
--source-dir=$(SOURCE_CODE_DIR)/include/xmlsec/gnutls
$(GTKDOC_MKDB) --module=xmlsec-gcrypt \
--source-dir=$(SOURCE_CODE_DIR)/include/xmlsec/base ; \
mv $(GTKDOC_MKDB_OUTPUT_DIR) $(SGML_DIR)/base ; \
);
@(for i in $(CRYPTO_LIBS_LIST) ; do \
echo "Create DocBook files for xmlsec-$$i" ; \
rm -rf $(GTKDOC_MKDB_OUTPUT_DIR) $(SGML_DIR)/$$i ; \
$(GTKDOC_MKDB) --module=xmlsec-$$i \
--xml-mode \
--main-sgml-file=$(SGML_DIR)/xmlsec-gcrypt.sgml \
--tmpl-dir=$(TMPL_DIR)/gcrypt \
--output-dir=$(SGML_DIR)/gcrypt \
--source-dir=$(SOURCE_CODE_DIR)/src/gcrypt \
--source-dir=$(SOURCE_CODE_DIR)/include/xmlsec/gcrypt
$(GTKDOC_MKDB) --module=xmlsec-nss \
--xml-mode \
--main-sgml-file=$(SGML_DIR)/xmlsec-nss.sgml \
--tmpl-dir=$(TMPL_DIR)/nss \
--output-dir=$(SGML_DIR)/nss \
--source-dir=$(SOURCE_CODE_DIR)/src/nss \
--source-dir=$(SOURCE_CODE_DIR)/include/xmlsec/nss
$(GTKDOC_MKDB) --module=xmlsec-mscrypto \
--xml-mode \
--main-sgml-file=$(SGML_DIR)/xmlsec-mscrypto.sgml \
--tmpl-dir=$(TMPL_DIR)/mscrypto \
--output-dir=$(SGML_DIR)/mscrypto \
--source-dir=$(SOURCE_CODE_DIR)/src/mscrypto \
--source-dir=$(SOURCE_CODE_DIR)/include/xmlsec/mscrypto

templates: scan templates-copy
$(GTKDOC_MKTMPL) --module=xmlsec \
--output-dir=$(TMPL_DIR)/base
$(GTKDOC_MKTMPL) --module=xmlsec-openssl \
--output-dir=$(TMPL_DIR)/openssl
$(GTKDOC_MKTMPL) --module=xmlsec-gnutls \
--output-dir=$(TMPL_DIR)/gnutls
$(GTKDOC_MKTMPL) --module=xmlsec-gcrypt \
--output-dir=$(TMPL_DIR)/gcrypt
$(GTKDOC_MKTMPL) --module=xmlsec-nss \
--output-dir=$(TMPL_DIR)/nss
$(GTKDOC_MKTMPL) --module=xmlsec-mscrypto \
--output-dir=$(TMPL_DIR)/mscrypto

# make sure to run chmod since we will update templates
templates-copy: $(TMPL_SRC_DIR) $(TMPL_DIR)/.sentinel
@echo "Copying original template files into '$(TMPL_DIR)' ..."
( if [ z"$(TMPL_DIR)" != z"$(TMPL_SRC_DIR)" ] ; then \
$(CP) -ru $(TMPL_SRC_DIR)/* $(TMPL_DIR)/ ; \
fi ; )
chmod -R u+w $(TMPL_DIR)
--main-sgml-file=$(SGML_DIR)/xmlsec-$$i.sgml \
--source-dir=$(SOURCE_CODE_DIR)/src/$$i \
--source-dir=$(SOURCE_CODE_DIR)/include/xmlsec/$$i ; \
mv $(GTKDOC_MKDB_OUTPUT_DIR) $(SGML_DIR)/$$i ; \
done);

scan: SOURCE_CODEs example_sources
$(GTKDOC_SCAN) --module=xmlsec \
--rebuild-sections \
@( \
echo "Scanning source code for xmlsec-core" ; \
$(GTKDOC_SCAN) --module=xmlsec \
--rebuild-sections \
--output-dir=$(SCAN_DIR) \
--source-dir=$(SOURCE_CODE_DIR)/src/base \
--source-dir=$(SOURCE_CODE_DIR)/include/xmlsec/base
$(GTKDOC_SCAN) --module=xmlsec-openssl \
--rebuild-sections \
--output-dir=$(SCAN_DIR) \
--source-dir=$(SOURCE_CODE_DIR)/src/openssl \
--source-dir=$(SOURCE_CODE_DIR)/include/xmlsec/openssl
$(GTKDOC_SCAN) --module=xmlsec-gnutls \
--rebuild-sections \
--output-dir=$(SCAN_DIR) \
--source-dir=$(SOURCE_CODE_DIR)/src/gnutls \
--source-dir=$(SOURCE_CODE_DIR)/include/xmlsec/gnutls
$(GTKDOC_SCAN) --module=xmlsec-gcrypt \
--rebuild-sections \
--source-dir=$(SOURCE_CODE_DIR)/include/xmlsec/base ; \
);
@(for i in $(CRYPTO_LIBS_LIST) ; do \
echo "Scanning source code for xmlsec-$$i" ; \
$(GTKDOC_SCAN) --module=xmlsec-$$i \
--rebuild-sections \
--output-dir=$(SCAN_DIR) \
--source-dir=$(SOURCE_CODE_DIR)/src/gcrypt \
--source-dir=$(SOURCE_CODE_DIR)/include/xmlsec/gcrypt
$(GTKDOC_SCAN) --module=xmlsec-nss \
--rebuild-sections \
--output-dir=$(SCAN_DIR) \
--source-dir=$(SOURCE_CODE_DIR)/src/nss \
--source-dir=$(SOURCE_CODE_DIR)/include/xmlsec/nss
$(GTKDOC_SCAN) --module=xmlsec-mscrypto \
--rebuild-sections \
--output-dir=$(SCAN_DIR) \
--source-dir=$(SOURCE_CODE_DIR)/src/mscrypto \
--source-dir=$(SOURCE_CODE_DIR)/include/xmlsec/mscrypto
--source-dir=$(SOURCE_CODE_DIR)/src/$$i \
--source-dir=$(SOURCE_CODE_DIR)/include/xmlsec/$$i ; \
done);

#
# Prepare source files by coping them to "code" folder and
Expand Down Expand Up @@ -317,7 +269,7 @@ dist-hook:
done ; )

clean-local:
-rm -rf $(SOURCE_CODE_DIR) $(EXAMPLES_DIR) $(SCAN_DIR)/*.txt $(SGML_DIR) $(XML_DIR)
-rm -rf $(SOURCE_CODE_DIR) $(EXAMPLES_DIR) $(SCAN_DIR)/*.txt $(SGML_DIR) $(GTKDOC_MKDB_OUTPUT_DIR)
-rm -f *.stamp *.types index.sgml
( if [ z"$(TMPL_SRC_DIR)" != z"$(TMPL_DIR)" ] && [ -d "$(TMPL_DIR)" ] ; then \
chmod -R u+w $(TMPL_DIR) && rm -rf $(TMPL_DIR) ; \
Expand Down
Binary file modified docs/api/home.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 30391bb

Please sign in to comment.