From dd7848d05be8e869bf61e0a06fdf8871a9357d2c Mon Sep 17 00:00:00 2001 From: Sam Hocevar Date: Tue, 13 Jan 2004 16:45:45 +0000 Subject: [PATCH] * configure.ac: + Added --disable-doc to let the user not build documentation. * build-win32: + Do not build documentation. --- build-win32 | 7 ++----- configure.ac | 50 +++++++++++++++++++++++++++++++------------------ debian/rules | 3 ++- doc/Makefile.am | 12 ++++++------ libcaca.spec | 4 ++-- 5 files changed, 44 insertions(+), 32 deletions(-) diff --git a/build-win32 b/build-win32 index e4dfb8c..4bc550c 100755 --- a/build-win32 +++ b/build-win32 @@ -14,7 +14,7 @@ rm -f "${DIRNAME}.zip" mkdir "${DIRNAME}" # Build for win32 -./configure --host=i586-mingw32msvc --prefix=/ --bindir=/ --libdir=/ --disable-imlib2 +./configure --host=i586-mingw32msvc --prefix=/ --bindir=/ --libdir=/ --disable-imlib2 --disable-doc make pkglibdir=/lib pkgdatadir=/data # Install into our private directory @@ -24,10 +24,7 @@ rm -Rf "${DESTDIR}/man" rm -Rf "${DESTDIR}/include" rm -f "${DESTDIR}/caca-config" rm -f "${DESTDIR}/"*.a -mv "${DESTDIR}/share/doc/libcaca-dev/html" "${DESTDIR}/html" -mv "${DESTDIR}/share/doc/libcaca-dev/ps" "${DESTDIR}/doc" -mv "${DESTDIR}/share/doc/libcaca-dev/"* "${DESTDIR}/doc" -rmdir "${DESTDIR}/share/doc/libcaca-dev" +mv "${DESTDIR}/share/doc/libcaca-dev/" "${DESTDIR}/doc" rmdir "${DESTDIR}/share/doc" rmdir "${DESTDIR}/share" diff --git a/configure.ac b/configure.ac index 8daa5d9..ef17d77 100644 --- a/configure.ac +++ b/configure.ac @@ -20,6 +20,7 @@ dnl AC_PROG_EGREP only exists in autoconf 2.54+, so we use AC_EGREP_CPP right dnl now otherwise it might be set in an obscure if statement. AC_EGREP_CPP(foo, foo) +dnl output driver features AC_ARG_ENABLE(slang, [ --enable-slang slang graphics support (autodetected)]) AC_ARG_ENABLE(ncurses, @@ -31,6 +32,14 @@ AC_ARG_ENABLE(conio, AC_ARG_ENABLE(x11, [ --enable-x11 X11 support (autodetected)]) +dnl example programs features +AC_ARG_ENABLE(imlib2, + [ --enable-imlib2 Imlib2 graphics support (default enabled)]) + +dnl conditional builds +AC_ARG_ENABLE(doc, + [ --enable-doc build documentation (needs doxygen and LaTeX)]) + AC_CHECK_HEADERS(sys/time.h inttypes.h endian.h unistd.h) AC_CHECK_FUNCS(vsnprintf _vsnprintf getenv putenv strcasecmp usleep gettimeofday) AC_MSG_CHECKING(for Sleep) @@ -150,8 +159,6 @@ AM_CONDITIONAL(NEED_PIC, ${NEED_PIC}) # Use Imlib2? ac_cv_my_have_imlib2="no" -AC_ARG_ENABLE(imlib2, - [ --enable-imlib2 Imlib2 graphics support (default enabled)]) save_CPPFLAGS="${CPPFLAGS}" if test "${enable_imlib2}" != "no"; then AC_PATH_PROG(IMLIB2_CONFIG, imlib2-config, no) @@ -167,23 +174,30 @@ fi AM_CONDITIONAL(USE_IMLIB2, test "${ac_cv_my_have_imlib2}" = "yes") # Build documentation? -AC_PATH_PROG(DOXYGEN, doxygen, no) -AM_CONDITIONAL(DOXYGEN, test "${DOXYGEN}" != "no") - -# Build LaTeX documentation? -AC_PATH_PROG(LATEX, latex, no) -AC_PATH_PROG(DVIPS, dvips, no) -if test "${DVIPS}" = "no"; then - LATEX="no" -fi -AC_MSG_CHECKING(for a4wide.sty) -if test -f /usr/share/texmf/tex/latex/misc/a4wide.sty; then - AC_MSG_RESULT(yes) -else - LATEX="no" - AC_MSG_RESULT(no) +DOXYGEN="no" +LATEX="no" +if test "${enable_doc}" != "no"; then + AC_PATH_PROG(DOXYGEN, doxygen, no) + if test "${DOXYGEN}" = "no"; then + AC_MSG_ERROR([[cannot find doxygen, which is needed to build the libcaca documentation; if this is really what you want, re-run configure with '--disable-doc'.]]) + fi + + # Build LaTeX documentation? + AC_PATH_PROG(LATEX, latex, no) + AC_PATH_PROG(DVIPS, dvips, no) + if test "${DVIPS}" = "no"; then + LATEX="no" + fi + AC_MSG_CHECKING(for a4wide.sty) + if test -f /usr/share/texmf/tex/latex/misc/a4wide.sty; then + AC_MSG_RESULT(yes) + else + LATEX="no" + AC_MSG_RESULT(no) + fi fi -AM_CONDITIONAL(LATEX, test "${LATEX}" != "no") +AM_CONDITIONAL(BUILD_DOCUMENTATION, test "${DOXYGEN}" != "no") +AM_CONDITIONAL(USE_LATEX, test "${LATEX}" != "no") AC_CONFIG_FILES([ Makefile diff --git a/debian/rules b/debian/rules index 41bccf5..932573a 100755 --- a/debian/rules +++ b/debian/rules @@ -12,7 +12,8 @@ else endif confflags += --mandir=\$${prefix}/share/man --infodir=\$${prefix}/share/info -confflags += --enable-ncurses --enable-slang --enable-x11 --enable-imlib2 +confflags += --enable-ncurses --enable-slang --enable-x11 \ + --enable-imlib2 --enable-doc configure: configure-stamp configure-stamp: diff --git a/doc/Makefile.am b/doc/Makefile.am index bdf95ab..80ff8d2 100644 --- a/doc/Makefile.am +++ b/doc/Makefile.am @@ -4,10 +4,10 @@ EXTRA_DIST = doxygen.cfg.in footer.html header.html $(man_MANS) man_MANS = caca-config.1 cacademo.1 cacaview.1 -if DOXYGEN +if BUILD_DOCUMENTATION htmldoc_DATA = html/doxygen.css htmldocdir = $(datadir)/doc/libcaca-dev/html -if LATEX +if USE_LATEX psdoc_DATA = latex/libcaca.ps psdocdir = $(datadir)/doc/libcaca-dev/ps endif @@ -17,14 +17,14 @@ html/doxygen.css html/doxygen.png: stamp-doxygen latex/libcaca.ps: stamp-latex stamp-doxygen: -if DOXYGEN +if BUILD_DOCUMENTATION doxygen doxygen.cfg touch stamp-doxygen endif stamp-latex: stamp-doxygen -if DOXYGEN -if LATEX +if BUILD_DOCUMENTATION +if USE_LATEX rm -f latex/libcaca.tex latex/libcaca.ps mv latex/refman.tex latex/libcaca.tex sed 's/setlength{/renewcommand{/' latex/libcaca.tex > latex/refman.tex @@ -40,7 +40,7 @@ clean-local: -rm -f stamp-latex stamp-doxygen install-data-local: -if DOXYGEN +if BUILD_DOCUMENTATION $(mkinstalldirs) $(DESTDIR)$(datadir)/doc/libcaca-dev/html cp `find html -name '*.html' -o -name '*.gif' -o -name '*.png'` \ $(DESTDIR)$(datadir)/doc/libcaca-dev/html diff --git a/libcaca.spec b/libcaca.spec index f462612..ea1681d 100644 --- a/libcaca.spec +++ b/libcaca.spec @@ -1,4 +1,4 @@ -%define name libcaca +%define name libcaca %define version 0.7 %define release 1 @@ -69,7 +69,7 @@ all) --bindir=\${prefix}/bin \ --mandir=\${prefix}/share/man \ --infodir=\${prefix}/share/info \ - --enable-slang --enable-ncurses --enable-x11 --enable-imlib2 + --enable-slang --enable-ncurses --enable-x11 --enable-imlib2 --enable-doc ;;esac make