Skip to content

Commit

Permalink
Improve configure.ac and Makefile.am to make autoconf-archive optional
Browse files Browse the repository at this point in the history
autoconf-archive provides macros that are used to build documentation
with doxygen. To build the jp2a program itself autoconf-archive was
previously required even if that did not involve using these macros. Now
jp2a can be built even when these macros are not present.
  • Loading branch information
Talinx committed Sep 8, 2024
1 parent 4041358 commit d8e45ef
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 6 deletions.
22 changes: 21 additions & 1 deletion Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,34 @@ EXTRA_DIST = tests/??*.txt tests/??*.html tests/??*.jpg tests/??*.png tests/run-
MOSTLYCLEANFILES = $(DX_CLEANFILES)
CLEANFILES = Doxyfile

.PHONY: doc test check

test: check

check: all
$(MAKE) -C tests check

if DOC
@DX_RULES@

editdx = sed -e 's|@PACKAGE_NAME[@]|$(PACKAGE_NAME)|g' -e 's|@PACKAGE_VERSION[@]|$(PACKAGE_VERSION)|g' -e 's|@top_srcdir[@]|$(top_srcdir)|g'
Doxyfile: Doxyfile.in
$(editdx) $(srcdir)/$@.in > $@.tmp
mv $@.tmp $@
else !DOC
Doxyfile:
@echo "Building doxygen documentation not enabled."
@echo "To build doxygen documentation:"
@echo "1. Install autoconf-archive and doxygen"
@echo "2. autoreconf -vi"
@echo "3. ./configure"
@echo "4. make Doxyfile"
@echo "5. doxygen"
@false
endif

doc: Doxyfile doc/*.md include/*.h
@echo "Running doxygen..."
doxygen
@echo "Documentation build to doxygen-doc/"
@echo "You can view the HTML documentation by opening doxygen-doc/html/index.html, e. g. with:"
@echo "xdg-open doxygen-doc/html/index.html"
7 changes: 3 additions & 4 deletions README
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ Building

`jp2a` can be compiled as usual: `./configure && make && make install`

If you want to compile after cloning the git repo (i.e. generate the `configure` script yourself), you need autotools, automake and autoconf-archive. You may need to specify the path to jpeglib. I usually just do
If you want to compile after cloning the git repo (i.e. generate the `configure` script yourself), you need autotools, automake and optionally autoconf-archive. You may need to specify the path to jpeglib. I usually just do

autoreconf -vi
./configure --with-jpeg-prefix=/usr/local \
Expand Down Expand Up @@ -133,8 +133,7 @@ jp2a is documented with [doxygen](https://www.doxygen.nl/). To build the documen

autoreconf -vi
./configure
make Doxyfile
doxygen
make doc

This will create HTML and LaTeX documentation in the doxygen-doc folder.

Expand All @@ -155,7 +154,7 @@ If you generate the `configure` script yourself (i.e. run `autoreconf`) you also
- autotools
- [automake](https://www.gnu.org/software/automake/)
- [autoconf](https://www.gnu.org/software/autoconf/autoconf.html)
- [autoconf-archive](https://www.gnu.org/software/autoconf-archive/)
- (optional, only required for building documentation) [autoconf-archive](https://www.gnu.org/software/autoconf-archive/)

Windows
-------
Expand Down
5 changes: 4 additions & 1 deletion configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,11 @@

AC_PREREQ([2.69])
AC_INIT([jp2a],[1.2.0],[[email protected]], [jp2a], [https://github.com/Talinx/jp2a])
DX_INIT_DOXYGEN([jp2a])
m4_ifdef([DX_INIT_DOXYGEN],
[doc=true
DX_INIT_DOXYGEN([jp2a])],[doc=false])
AM_INIT_AUTOMAKE(dist-bzip2 dist-zip)
AM_CONDITIONAL([DOC], [test x$doc = xtrue])
AC_CONFIG_SRCDIR(src/jp2a.c)
AC_CONFIG_HEADERS([config.h])
AC_CONFIG_FILES([Makefile src/Makefile])
Expand Down

0 comments on commit d8e45ef

Please sign in to comment.