Skip to content

Commit b1a41f5

Browse files
author
Vladimir Mezentsev
committed
gprofng: PR29521 [docs] man pages are not in the release tarball
gprofng/ChangeLog 2023-01-20 Vladimir Mezentsev <[email protected]> PR gprofng/29521 * configure.ac: Check if $MAKEINFO and $HELP2MAN are missing. * Makefile.am: Build doc if $MAKEINFO exists. * doc/gprofng.texi: Update documentation for gprofng. * doc/Makefile.am: Build gprofng.1. * src/Makefile.am: Move the build of gprofng.1 to doc/Makefile.am. * configure: Rebuild. * Makefile.in: Rebuild. * doc/Makefile.in: Rebuild. * src/Makefile.in: Rebuild.
1 parent 436bcab commit b1a41f5

File tree

9 files changed

+364
-42
lines changed

9 files changed

+364
-42
lines changed

gprofng/Makefile.am

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ AUTOMAKE_OPTIONS = dejagnu foreign
2323
if BUILD_COLLECTOR
2424
COLLECTOR_SUBDIRS = libcollector
2525
endif
26-
if BUILD_MAN
26+
if BUILD_DOC
2727
DOC_SUBDIR = doc
2828
endif
2929
if BUILD_SRC

gprofng/Makefile.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -381,7 +381,7 @@ zlibinc = @zlibinc@
381381
ACLOCAL_AMFLAGS = -I . -I ..
382382
AUTOMAKE_OPTIONS = dejagnu foreign
383383
@BUILD_COLLECTOR_TRUE@COLLECTOR_SUBDIRS = libcollector
384-
@BUILD_MAN_TRUE@DOC_SUBDIR = doc
384+
@BUILD_DOC_TRUE@DOC_SUBDIR = doc
385385
@BUILD_SRC_TRUE@SRC_SUBDIRS = src gp-display-html $(DOC_SUBDIR)
386386
SUBDIRS = $(COLLECTOR_SUBDIRS) $(SRC_SUBDIRS)
387387
DIST_SUBDIRS = libcollector src gp-display-html $(DOC_SUBDIR)

gprofng/configure

Lines changed: 70 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -639,6 +639,8 @@ GPROFNG_CPPFLAGS
639639
GPROFNG_NO_FORMAT_TRUNCATION_CFLAGS
640640
GPROFNG_CFLAGS
641641
LD_NO_AS_NEEDED
642+
BUILD_DOC_FALSE
643+
BUILD_DOC_TRUE
642644
BUILD_MAN_FALSE
643645
BUILD_MAN_TRUE
644646
HELP2MAN
@@ -12221,7 +12223,7 @@ else
1222112223
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
1222212224
lt_status=$lt_dlunknown
1222312225
cat > conftest.$ac_ext <<_LT_EOF
12224-
#line 12224 "configure"
12226+
#line 12226 "configure"
1222512227
#include "confdefs.h"
1222612228

1222712229
#if HAVE_DLFCN_H
@@ -12327,7 +12329,7 @@ else
1232712329
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
1232812330
lt_status=$lt_dlunknown
1232912331
cat > conftest.$ac_ext <<_LT_EOF
12330-
#line 12330 "configure"
12332+
#line 12332 "configure"
1233112333
#include "confdefs.h"
1233212334

1233312335
#if HAVE_DLFCN_H
@@ -16737,9 +16739,58 @@ fi
1673716739

1673816740
# Generate manpages, if possible.
1673916741
build_man=false
16742+
build_doc=false
1674016743
if test $cross_compiling = no; then
16744+
for ac_prog in help2man
16745+
do
16746+
# Extract the first word of "$ac_prog", so it can be a program name with args.
16747+
set dummy $ac_prog; ac_word=$2
16748+
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
16749+
$as_echo_n "checking for $ac_word... " >&6; }
16750+
if ${ac_cv_prog_HELP2MAN+:} false; then :
16751+
$as_echo_n "(cached) " >&6
16752+
else
16753+
if test -n "$HELP2MAN"; then
16754+
ac_cv_prog_HELP2MAN="$HELP2MAN" # Let the user override the test.
16755+
else
16756+
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
16757+
for as_dir in $PATH
16758+
do
16759+
IFS=$as_save_IFS
16760+
test -z "$as_dir" && as_dir=.
16761+
for ac_exec_ext in '' $ac_executable_extensions; do
16762+
if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
16763+
ac_cv_prog_HELP2MAN="$ac_prog"
16764+
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
16765+
break 2
16766+
fi
16767+
done
16768+
done
16769+
IFS=$as_save_IFS
16770+
16771+
fi
16772+
fi
16773+
HELP2MAN=$ac_cv_prog_HELP2MAN
16774+
if test -n "$HELP2MAN"; then
16775+
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $HELP2MAN" >&5
16776+
$as_echo "$HELP2MAN" >&6; }
16777+
else
16778+
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
16779+
$as_echo "no" >&6; }
16780+
fi
1674116781

16742-
HELP2MAN=${HELP2MAN-"${am_missing_run}help2man"}
16782+
16783+
test -n "$HELP2MAN" && break
16784+
done
16785+
test -n "$HELP2MAN" || HELP2MAN="$MISSING help2man"
16786+
16787+
case "x$HELP2MAN" in
16788+
x | */missing\ help2man* )
16789+
{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: gprofng: help2man is missing. Man pages will not be built." >&5
16790+
$as_echo "$as_me: WARNING: gprofng: help2man is missing. Man pages will not be built." >&2;}
16791+
;;
16792+
* ) build_man=true ;;
16793+
esac
1674316794

1674416795
for ac_prog in makeinfo
1674516796
do
@@ -16782,10 +16833,10 @@ fi
1678216833

1678316834
test -n "$MAKEINFO" && break
1678416835
done
16785-
test -n "$MAKEINFO" || MAKEINFO=""@echo makeinfo missing; true""
16836+
test -n "$MAKEINFO" || MAKEINFO="$MISSING makeinfo"
1678616837

16787-
case "$MAKEINFO" in
16788-
*true)
16838+
case "x$MAKEINFO" in
16839+
x | */missing\ makeinfo*)
1678916840
{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: gprofng: makeinfo is missing. Info documentation will not be built." >&5
1679016841
$as_echo "$as_me: WARNING: gprofng: makeinfo is missing. Info documentation will not be built." >&2;}
1679116842
;;
@@ -16796,9 +16847,7 @@ $as_echo "$as_me: WARNING: gprofng: makeinfo is missing. Info documentation will
1679616847
$as_echo "$as_me: WARNING: gprofng: $MAKEINFO is too old. Info documentation will not be built." >&2;}
1679716848
MAKEINFO="@echo $MAKEINFO is too old, 6.5 or newer required; true"
1679816849
;;
16799-
x* )
16800-
build_man=true
16801-
;;
16850+
x* ) build_doc=true ;;
1680216851
esac
1680316852
;;
1680416853
esac
@@ -16812,6 +16861,14 @@ else
1681216861
BUILD_MAN_FALSE=
1681316862
fi
1681416863

16864+
if test x$build_doc = xtrue; then
16865+
BUILD_DOC_TRUE=
16866+
BUILD_DOC_FALSE='#'
16867+
else
16868+
BUILD_DOC_TRUE='#'
16869+
BUILD_DOC_FALSE=
16870+
fi
16871+
1681516872

1681616873
LD_NO_AS_NEEDED=${no_as_needed}
1681716874

@@ -17070,6 +17127,10 @@ if test -z "${BUILD_MAN_TRUE}" && test -z "${BUILD_MAN_FALSE}"; then
1707017127
as_fn_error $? "conditional \"BUILD_MAN\" was never defined.
1707117128
Usually this means the macro was only invoked conditionally." "$LINENO" 5
1707217129
fi
17130+
if test -z "${BUILD_DOC_TRUE}" && test -z "${BUILD_DOC_FALSE}"; then
17131+
as_fn_error $? "conditional \"BUILD_DOC\" was never defined.
17132+
Usually this means the macro was only invoked conditionally." "$LINENO" 5
17133+
fi
1707317134

1707417135
: "${CONFIG_STATUS=./config.status}"
1707517136
ac_write_fail=0

gprofng/configure.ac

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -210,11 +210,19 @@ AM_ZLIB
210210

211211
# Generate manpages, if possible.
212212
build_man=false
213+
build_doc=false
213214
if test $cross_compiling = no; then
214-
AM_MISSING_PROG(HELP2MAN, help2man)
215-
AC_CHECK_PROGS([MAKEINFO], makeinfo, ["@echo makeinfo missing; true"])
216-
case "$MAKEINFO" in
217-
*true)
215+
AC_CHECK_PROGS([HELP2MAN], help2man, [$MISSING help2man])
216+
case "x$HELP2MAN" in
217+
x | */missing\ help2man* )
218+
AC_MSG_WARN([gprofng: help2man is missing. Man pages will not be built.])
219+
;;
220+
* ) build_man=true ;;
221+
esac
222+
223+
AC_CHECK_PROGS([MAKEINFO], makeinfo, [$MISSING makeinfo])
224+
case "x$MAKEINFO" in
225+
x | */missing\ makeinfo*)
218226
AC_MSG_WARN([gprofng: makeinfo is missing. Info documentation will not be built.])
219227
;;
220228
*)
@@ -223,15 +231,14 @@ if test $cross_compiling = no; then
223231
AC_MSG_WARN([gprofng: $MAKEINFO is too old. Info documentation will not be built.])
224232
MAKEINFO="@echo $MAKEINFO is too old, 6.5 or newer required; true"
225233
;;
226-
x* )
227-
build_man=true
228-
;;
234+
x* ) build_doc=true ;;
229235
esac
230236
;;
231237
esac
232238
AC_SUBST(MAKEINFO)
233239
fi
234240
AM_CONDITIONAL([BUILD_MAN], [test x$build_man = xtrue])
241+
AM_CONDITIONAL([BUILD_DOC], [test x$build_doc = xtrue])
235242

236243
AC_SUBST(LD_NO_AS_NEEDED, [${no_as_needed}])
237244
AC_SUBST(GPROFNG_CFLAGS, [${gprofng_cflags}])

gprofng/doc/Makefile.am

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,31 @@
1919

2020
AUTOMAKE_OPTIONS = info-in-builddir foreign no-texinfo.tex
2121

22+
# Options to extract the man page
23+
MANCONF = -Dman
24+
25+
TEXI2POD = perl $(srcdir)/../../etc/texi2pod.pl $(AM_MAKEINFOFLAGS)
26+
POD2MAN = pod2man --center="User Commands" \
27+
--release="binutils-$(VERSION)" --section=1
28+
2229
info_TEXINFOS = gprofng.texi
2330
gprofng_TEXINFOS = fdl.texi
2431
TEXINFO_TEX = .
2532
MAKEINFOHTML = $(MAKEINFO) --html --no-split
2633

27-
MAINTAINERCLEANFILES = gprofng.info
34+
man_MANS = gprofng.1
35+
36+
# Build the man page from the texinfo file
37+
# The sed command removes the no-adjust Nroff command so that
38+
# the man output looks standard.
39+
gprofng.1: $(srcdir)/gprofng.texi
40+
$(AM_V_GEN)touch $@
41+
$(AM_V_at)-$(TEXI2POD) $(MANCONF) < $(srcdir)/gprofng.texi > gprofng.pod
42+
$(AM_V_at)-($(POD2MAN) gprofng.pod | \
43+
sed -e '/^.if n .na/d' > $@.tmp && \
44+
mv -f $@.tmp $@) || (rm -f $@.tmp && exit 1)
45+
$(AM_V_at)rm -f gprofng.pod
46+
47+
MAINTAINERCLEANFILES = gprofng.info $(man_MANS)
48+
49+
info: $(man_MANS)

0 commit comments

Comments
 (0)