Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Simplify the installation of man pages #10717

Merged
merged 1 commit into from
Oct 22, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 3 additions & 0 deletions Changes
Expand Up @@ -257,6 +257,9 @@ Working version

### Build system:

- #10717 Simplify the installation of man mages
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nits only: needs a colon after #10717 and pages rather than mages

(Sébastien Hinderer, review by ???)

### Bug fixes:

- #9214, #10709: Wrong unmarshaling of function pointers in debugger mode.
Expand Down
3 changes: 1 addition & 2 deletions Makefile
Expand Up @@ -439,8 +439,7 @@ ifeq "$(INSTALL_SOURCE_ARTIFACTS)" "true"
endif
$(MAKE) -C tools install
ifeq "$(UNIX_OR_WIN32)" "unix" # Install manual pages only on Unix
$(MKDIR) "$(INSTALL_MANDIR)/man$(PROGRAMS_MAN_SECTION)"
-$(MAKE) -C man install
$(MAKE) -C man install
endif
for i in $(OTHERLIBRARIES); do \
$(MAKE) -C otherlibs/$$i install || exit $$?; \
Expand Down
2 changes: 2 additions & 0 deletions Makefile.common
Expand Up @@ -33,6 +33,8 @@ INSTALL_BINDIR := $(DESTDIR)$(BINDIR)
INSTALL_LIBDIR := $(DESTDIR)$(LIBDIR)
INSTALL_STUBLIBDIR := $(DESTDIR)$(STUBLIBDIR)
INSTALL_MANDIR := $(DESTDIR)$(MANDIR)
INSTALL_PROGRAMS_MAN_DIR := $(DESTDIR)$(PROGRAMS_MAN_DIR)
INSTALL_LIBRARIES_MAN_DIR := $(DESTDIR)$(LIBRARIES_MAN_DIR)
INSTALL_DOCDIR := $(DESTDIR)$(DOCDIR)

FLEXDLL_SUBMODULE_PRESENT := $(wildcard $(ROOTDIR)/flexdll/Makefile)
Expand Down
8 changes: 4 additions & 4 deletions Makefile.config.in
Expand Up @@ -53,11 +53,11 @@ LIBDIR=@libdir@
STUBLIBDIR=@libdir@/stublibs

### Where to install the man pages
# Man pages for commands go in $(MANDIR)/man$(PROGRAMS_MAN_SECTION)
# Man pages for the library go in $(MANDIR)/man/man$(LIBRARIES_MAN_SECTION)
# Man pages for commands go in $(MANDIR)/man1
# Man pages for the library go in $(MANDIR)/man3
MANDIR=@mandir@
PROGRAMS_MAN_SECTION=@programs_man_section@
LIBRARIES_MAN_SECTION=@libraries_man_section@
PROGRAMS_MAN_DIR=$(MANDIR)/man1
LIBRARIES_MAN_DIR=$(MANDIR)/man3

### Do #! scripts work on your system?
### Beware: on some systems (e.g. SunOS 4), this will work only if
Expand Down
9 changes: 4 additions & 5 deletions api_docgen/ocamldoc/Makefile
Expand Up @@ -117,10 +117,9 @@ $(filter-out camlinternal%,$(compilerlibref)),\
build/latex/compilerlibs_input.tex: | build/latex
echo $(compilerlibs_INPUT) > $@

INSTALL_MANODIR=$(INSTALL_MANDIR)/man3
.PHONY:install
.PHONY: install
install:
$(MKDIR) "$(INSTALL_MANODIR)"
$(MKDIR) "$(INSTALL_LIBRARIES_MAN_DIR)"
if test -d build/man; then \
$(INSTALL_DATA) build/man/*.3o "$(INSTALL_MANODIR)"; \
else : ; fi
$(INSTALL_DATA) build/man/*.3o "$(INSTALL_LIBRARIES_MAN_DIR)"; \
fi
13 changes: 6 additions & 7 deletions api_docgen/odoc/Makefile
Expand Up @@ -181,13 +181,12 @@ $(ALL_PAGED_DOC:%=build/%.3o.stamp):build/%.3o.stamp:build/%.odocl | build/
touch $@

# Man pages are the only installed documentation
INSTALL_MANODIR=$(INSTALL_MANDIR)/man3
.PHONY:install
.PHONY: install
install:
$(MKDIR) "$(INSTALL_MANODIR)"
$(MKDIR) "$(INSTALL_LIBRARIES_MAN_DIR)"
if test -d build/man/libref ; then \
$(INSTALL_DATA) build/man/libref/* "$(INSTALL_MANODIR)"; \
else : ; fi
$(INSTALL_DATA) build/man/libref/* "$(INSTALL_LIBRARIES_MAN_DIR)"; \
fi
if test -d build/man/compilerlibref ; then \
$(INSTALL_DATA) build/man/libref/* "$(INSTALL_MANODIR)"; \
else : ; fi
$(INSTALL_DATA) build/man/libref/* "$(INSTALL_LIBRARIES_MAN_DIR)"; \
fi
10 changes: 0 additions & 10 deletions configure

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 0 additions & 8 deletions configure.ac
Expand Up @@ -30,12 +30,6 @@ AC_MSG_NOTICE([Configuring OCaml version AC_PACKAGE_VERSION])
## Command-line arguments passed to configure
CONFIGURE_ARGS="$*"

# Command-line tools section of the Unix manual
programs_man_section=1

# Library section of the Unix manual
libraries_man_section=3

# Command to build executalbes
# In general this command is supposed to use the CFLAGs- and LDFLAGS-
# related variables (OC_CFLAGS and OC_LDFLAGS for ocaml-specific
Expand Down Expand Up @@ -107,8 +101,6 @@ AC_SUBST([outputexe])
AC_SUBST([outputobj])
AC_SUBST([syslib])
AC_SUBST([extralibs])
AC_SUBST([programs_man_section])
AC_SUBST([libraries_man_section])
AC_SUBST([fpic])
AC_SUBST([mkexe])
AC_SUBST([mkexedebugflag])
Expand Down
18 changes: 7 additions & 11 deletions man/Makefile
Expand Up @@ -14,17 +14,13 @@
#**************************************************************************

ROOTDIR = ..
include $(ROOTDIR)/Makefile.config
include $(ROOTDIR)/Makefile.common

DESTDIR ?=
INSTALL_DIR=$(DESTDIR)$(MANDIR)/man$(PROGRAMS_MAN_SECTION)
MANPAGES = $(addsuffix .1,\
ocaml ocamlc ocamlc.opt ocamlcp ocamldebug ocamldep ocamldoc ocamllex \
ocamlmktop ocamlopt ocamlopt.opt ocamloptp ocamlprof ocamlrun ocamlyacc)

.PHONY: install
install:
for i in *.m; do cp \
$$i $(INSTALL_DIR)/`basename $$i .m`.$(PROGRAMS_MAN_SECTION); done
echo '.so man$(PROGRAMS_MAN_SECTION)/ocamlc.$(PROGRAMS_MAN_SECTION)' \
> $(INSTALL_DIR)/ocamlc.opt.$(PROGRAMS_MAN_SECTION)
echo '.so man$(PROGRAMS_MAN_SECTION)/ocamlopt.$(PROGRAMS_MAN_SECTION)' \
> $(INSTALL_DIR)/ocamlopt.opt.$(PROGRAMS_MAN_SECTION)
echo '.so man$(PROGRAMS_MAN_SECTION)/ocamlcp.$(PROGRAMS_MAN_SECTION)' \
> $(INSTALL_DIR)/ocamloptp.$(PROGRAMS_MAN_SECTION)
$(MKDIR) $(INSTALL_PROGRAMS_MAN_DIR)
$(INSTALL_DATA) $(MANPAGES) $(INSTALL_PROGRAMS_MAN_DIR)
File renamed without changes.
File renamed without changes.
1 change: 1 addition & 0 deletions man/ocamlc.opt.1
@@ -0,0 +1 @@
.so man1/ocamlc.1
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
1 change: 1 addition & 0 deletions man/ocamlopt.opt.1
@@ -0,0 +1 @@
.so man1/ocamlopt.1
1 change: 1 addition & 0 deletions man/ocamloptp.1
@@ -0,0 +1 @@
.so man1/ocamlcp.1
File renamed without changes.
File renamed without changes.
File renamed without changes.