Skip to content
Snippets Groups Projects
Commit 50d23df8 authored by Marek Vavrusa's avatar Marek Vavrusa
Browse files

Added manpages rules to autoconf.

parent f2f79722
No related branches found
No related tags found
No related merge requests found
......@@ -81,6 +81,8 @@ AC_ARG_ENABLE([debug],
xbrief)
AC_DEFINE([DEBUG_ENABLE_BRIEF], [1], [Enable brief debugging messages.])
;;
*)
AC_MSG_ERROR([bad value ${enableval} for --enable-debug. Expected: {brief,verbose,details}.])
esac], [])
# recvmmsg() (valgrind doesn't support it, so disable for debugging)
......@@ -116,7 +118,7 @@ AC_SEARCH_LIBS([OpenSSL_add_all_digests], [crypto],[], [AC_MSG_ERROR([libcrypto
# Checks for header files.
AC_HEADER_RESOLV
AC_CHECK_HEADERS([arpa/inet.h fcntl.h inttypes.h limits.h malloc.h netdb.h netinet/in.h stdint.h stdlib.h string.h strings.h sys/socket.h sys/time.h syslog.h unistd.h urcu.h ev.h])
AC_CHECK_HEADERS([arpa/inet.h fcntl.h inttypes.h limits.h malloc.h netdb.h netinet/in.h stdint.h stdlib.h string.h strings.h sys/socket.h sys/time.h syslog.h unistd.h urcu.h])
# Checks for typedefs, structures, and compiler characteristics.
AC_HEADER_STDBOOL
......@@ -139,4 +141,7 @@ AC_CONFIG_FILES([Makefile
libknot/Makefile
samples/Makefile
src/Makefile])
# Manual pages
AC_PROG_HELP2MAN(["knotd.8 knotc.8"])
AC_OUTPUT
# check for the presence of help2man
# if it is available then set MANPAGES to
# the list of man page files to create
#
# AC_PROG_HELP2MAN(list-of-man-pages)
AC_DEFUN([AC_PROG_HELP2MAN],
[{
AC_CHECK_PROGS([HELP2MAN], [help2man])
if ! test -z "$HELP2MAN"
then
AC_SUBST(MANPAGES, $1)
fi
}])
......@@ -2,6 +2,8 @@ ACLOCAL_AMFLAGS = -I ../m4
bin_PROGRAMS = knotc
libexec_PROGRAMS = knot-zcompile unittests unittests-zcompile unittests-libknot-realdata unittests-libknot
sbin_PROGRAMS = knotd
dist_man_MANS=$(MANPAGES)
EXTRA_DIST=$(MANPAGES)
# $(YACC) will generate header file
AM_CFLAGS = -Wall -I../ -I../libknot -DLIBEXECDIR='"$(libexecdir)"' -DSYSCONFDIR='"$(sysconfdir)"' -DSBINDIR='"$(sbindir)"'
......@@ -37,7 +39,8 @@ CLEANFILES = \
zlexer.c \
libknotd_la-cf-lex.c \
libknotd_la-cf-parse.c \
libknotd_la-cf-parse.h
libknotd_la-cf-parse.h \
$(MANPAGES)
knotc_SOURCES = \
knot/ctl/knotc_main.c
......@@ -252,6 +255,13 @@ unittests_libknot_realdata_LDADD = ../libknot/libknot.la libknots.la @LIBOBJS@
# automake complains on % rules:
# `%'-style pattern rules are a GNU make extension
knotd.8: knotd$(EXEEXT)
$(HELP2MAN) -o $@ $<
knotc.8: knotc$(EXEEXT)
$(HELP2MAN) -o $@ $<
tests/libknot/parsed_data.rc: tests/libknot/files/parsed_data
../resource.sh tests/libknot/files/parsed_data >$@
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment