Browse code

doc: make doxygen program configurable

Signed-off-by: Timothy Gu <timothygu99@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>

Timothy Gu authored on 2014/07/08 07:24:48
Showing 3 changed files
... ...
@@ -286,6 +286,7 @@ Toolchain options:
286 286
   --pkg-config=PKGCONFIG   use pkg-config tool PKGCONFIG [$pkg_config_default]
287 287
   --pkg-config-flags=FLAGS pass additional flags to pkgconf []
288 288
   --ranlib=RANLIB          use ranlib RANLIB [$ranlib_default]
289
+  --doxygen=DOXYGEN        use DOXYGEN to generate API doc [$doxygen_default]
289 290
   --host-cc=HOSTCC         use host C compiler HOSTCC
290 291
   --host-cflags=HCFLAGS    use HCFLAGS when compiling for host
291 292
   --host-cppflags=HCPPFLAGS use HCPPFLAGS when compiling for host
... ...
@@ -1877,6 +1878,7 @@ CMDLINE_SET="
1877 1877
     cross_prefix
1878 1878
     cxx
1879 1879
     dep_cc
1880
+    doxygen
1880 1881
     extra_version
1881 1882
     gas
1882 1883
     host_cc
... ...
@@ -2618,6 +2620,7 @@ cc_default="gcc"
2618 2618
 cxx_default="g++"
2619 2619
 host_cc_default="gcc"
2620 2620
 cp_f="cp -f"
2621
+doxygen_default="doxygen"
2621 2622
 install="install"
2622 2623
 ln_s="ln -s -f"
2623 2624
 nm_default="nm -g"
... ...
@@ -2994,7 +2997,8 @@ case "$toolchain" in
2994 2994
     ;;
2995 2995
 esac
2996 2996
 
2997
-set_default arch cc cxx pkg_config ranlib strip sysinclude target_exec target_os yasmexe
2997
+set_default arch cc cxx doxygen pkg_config ranlib strip sysinclude \
2998
+    target_exec target_os yasmexe
2998 2999
 enabled cross_compile || host_cc_default=$cc
2999 3000
 set_default host_cc
3000 3001
 
... ...
@@ -3003,6 +3007,11 @@ if ! $pkg_config --version >/dev/null 2>&1; then
3003 3003
     pkg_config=false
3004 3004
 fi
3005 3005
 
3006
+if test $doxygen != $doxygen_default && \
3007
+  ! $doxygen --version >/dev/null 2>&1; then
3008
+    warn "Specified doxygen \"$doxygen\" not found, API documentation will fail to build."
3009
+fi
3010
+
3006 3011
 exesuf() {
3007 3012
     case $1 in
3008 3013
         mingw32*|win32|win64|cygwin*|*-dos|freedos|opendos|os/2*|symbian) echo .exe ;;
... ...
@@ -5388,6 +5397,7 @@ LD_PATH=$LD_PATH
5388 5388
 DLLTOOL=$dlltool
5389 5389
 WINDRES=$windres
5390 5390
 DEPWINDRES=$dep_cc
5391
+DOXYGEN=$doxygen
5391 5392
 LDFLAGS=$LDFLAGS
5392 5393
 SHFLAGS=$(echo $($ldflags_filter $SHFLAGS))
5393 5394
 ASMSTRIPFLAGS=$ASMSTRIPFLAGS
... ...
@@ -112,7 +112,7 @@ OBJDIRS += doc/examples
112 112
 DOXY_INPUT      = $(addprefix $(SRC_PATH)/, $(INSTHEADERS) $(DOC_EXAMPLES:%$(EXESUF)=%.c) $(LIB_EXAMPLES:%$(EXESUF)=%.c))
113 113
 
114 114
 doc/doxy/html: $(SRC_PATH)/doc/Doxyfile $(SRC_PATH)/doc/doxy-wrapper.sh $(DOXY_INPUT)
115
-	$(M)$(SRC_PATH)/doc/doxy-wrapper.sh $(SRC_PATH) $< $(DOXY_INPUT)
115
+	$(M)$(SRC_PATH)/doc/doxy-wrapper.sh $(SRC_PATH) $< $(DOXYGEN) $(DOXY_INPUT)
116 116
 
117 117
 install-doc: install-html install-man
118 118
 
... ...
@@ -2,10 +2,11 @@
2 2
 
3 3
 SRC_PATH="${1}"
4 4
 DOXYFILE="${2}"
5
+DOXYGEN="${3}"
5 6
 
6
-shift 2
7
+shift 3
7 8
 
8
-doxygen - <<EOF
9
+$DOXYGEN - <<EOF
9 10
 @INCLUDE        = ${DOXYFILE}
10 11
 INPUT           = $@
11 12
 EXAMPLE_PATH    = ${SRC_PATH}/doc/examples