* configure.in (MANTYPE): Detect if the system's nroff(1) groks
mdoc. Provide a new option --with-mantype={doc|man} in case the check does not work as expected. * Makefile.in (MANTYPE): Define MANTYPE and pass it to instruby.rb. * instruby.rb: Convert mdoc manpages to man for systems which nroff(1) does not grok mdoc. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3377 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
244bb8db51
commit
7828a12f19
12
ChangeLog
12
ChangeLog
@ -1,3 +1,15 @@
|
|||||||
|
Mon Jan 20 21:48:43 2003 Akinori MUSHA <knu@iDaemons.org>
|
||||||
|
|
||||||
|
* configure.in (MANTYPE): Detect if the system's nroff(1) groks
|
||||||
|
mdoc. Provide a new option --with-mantype={doc|man} in case the
|
||||||
|
check does not work as expected.
|
||||||
|
|
||||||
|
* Makefile.in (MANTYPE): Define MANTYPE and pass it to
|
||||||
|
instruby.rb.
|
||||||
|
|
||||||
|
* instruby.rb: Convert mdoc manpages to man for systems which
|
||||||
|
nroff(1) does not grok mdoc.
|
||||||
|
|
||||||
Mon Jan 20 21:25:18 2003 Akinori MUSHA <knu@iDaemons.org>
|
Mon Jan 20 21:25:18 2003 Akinori MUSHA <knu@iDaemons.org>
|
||||||
|
|
||||||
* lib/tempfile.rb (self.open): If a block is given, call it with
|
* lib/tempfile.rb (self.open): If a block is given, call it with
|
||||||
|
@ -100,6 +100,8 @@ OBJS = array.@OBJEXT@ \
|
|||||||
version.@OBJEXT@ \
|
version.@OBJEXT@ \
|
||||||
$(MISSING)
|
$(MISSING)
|
||||||
|
|
||||||
|
MANTYPE = @MANTYPE@
|
||||||
|
|
||||||
all: @MAKEFILES@ miniruby$(EXEEXT) rbconfig.rb $(LIBRUBY)
|
all: @MAKEFILES@ miniruby$(EXEEXT) rbconfig.rb $(LIBRUBY)
|
||||||
@$(MINIRUBY) $(srcdir)/ext/extmk.rb --extstatic="@EXTSTATIC@" --make="$(MAKE)" --make-flags="$(MFLAGS)$(MAKEFLAGS)"
|
@$(MINIRUBY) $(srcdir)/ext/extmk.rb --extstatic="@EXTSTATIC@" --make="$(MAKE)" --make-flags="$(MFLAGS)$(MAKEFLAGS)"
|
||||||
|
|
||||||
@ -126,11 +128,11 @@ ruby.imp: $(LIBRUBY_A)
|
|||||||
# $(MINIRUBY) $< $@
|
# $(MINIRUBY) $< $@
|
||||||
|
|
||||||
install: rbconfig.rb
|
install: rbconfig.rb
|
||||||
$(MINIRUBY) $(srcdir)/instruby.rb --make="$(MAKE)" --make-flags="$(MFLAGS)$(MAKEFLAGS)" $(DESTDIR)
|
$(MINIRUBY) $(srcdir)/instruby.rb --make="$(MAKE)" --make-flags="$(MFLAGS)$(MAKEFLAGS)" --mantype=$(MANTYPE) $(DESTDIR)
|
||||||
$(MINIRUBY) $(srcdir)/ext/extmk.rb --make="$(MAKE)" --make-flags="$(MFLAGS)$(MAKEFLAGS) DESTDIR=$(DESTDIR)" install
|
$(MINIRUBY) $(srcdir)/ext/extmk.rb --make="$(MAKE)" --make-flags="$(MFLAGS)$(MAKEFLAGS) DESTDIR=$(DESTDIR)" install
|
||||||
|
|
||||||
what-where no-install: rbconfig.rb
|
what-where no-install: rbconfig.rb
|
||||||
$(MINIRUBY) $(srcdir)/instruby.rb --make="$(MAKE)" --make-flags="$(MFLAGS)$(MAKEFLAGS) -n" $(DESTDIR)
|
$(MINIRUBY) $(srcdir)/instruby.rb --make="$(MAKE)" --make-flags="$(MFLAGS)$(MAKEFLAGS) -n" --mantype=$(MANTYPE) $(DESTDIR)
|
||||||
$(MINIRUBY) $(srcdir)/ext/extmk.rb --make="$(MAKE)" --make-flags="$(MFLAGS)$(MAKEFLAGS) -n DESTDIR=$(DESTDIR)" install
|
$(MINIRUBY) $(srcdir)/ext/extmk.rb --make="$(MAKE)" --make-flags="$(MFLAGS)$(MAKEFLAGS) -n DESTDIR=$(DESTDIR)" install
|
||||||
|
|
||||||
clean-ext:
|
clean-ext:
|
||||||
|
22
configure.in
22
configure.in
@ -1304,6 +1304,28 @@ if test "$search_path" != ""; then
|
|||||||
AC_DEFINE_UNQUOTED(RUBY_SEARCH_PATH,"$search_path")
|
AC_DEFINE_UNQUOTED(RUBY_SEARCH_PATH,"$search_path")
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
AC_ARG_WITH(mantype,
|
||||||
|
[ --with-mantype=TYPE specify man page type; TYPE is one of man and doc],
|
||||||
|
[
|
||||||
|
case "$withval" in
|
||||||
|
man|doc)
|
||||||
|
MANTYPE=$withval
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
AC_MSG_ERROR(invalid man type: $withval)
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
])
|
||||||
|
if test -z "$MANTYPE"; then
|
||||||
|
AC_PATH_PROGS(NROFF, nroff awf, /bin/false, "/usr/bin:/usr/ucb")
|
||||||
|
if ${NROFF} -mdoc ${srcdir}/ruby.1 >/dev/null 2>&1; then
|
||||||
|
MANTYPE=doc
|
||||||
|
else
|
||||||
|
MANTYPE=man
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
AC_SUBST(MANTYPE)
|
||||||
|
|
||||||
if test -f config.h && tr -d '\015' < confdefs.h | cmp -s config.h -; then
|
if test -f config.h && tr -d '\015' < confdefs.h | cmp -s config.h -; then
|
||||||
echo "config.h unchanged"
|
echo "config.h unchanged"
|
||||||
else
|
else
|
||||||
|
36
instruby.rb
36
instruby.rb
@ -7,10 +7,11 @@ $:.unshift File.join(CONFIG["srcdir"], "lib")
|
|||||||
require 'fileutils'
|
require 'fileutils'
|
||||||
require 'shellwords'
|
require 'shellwords'
|
||||||
require 'getopts'
|
require 'getopts'
|
||||||
|
require 'tempfile'
|
||||||
|
|
||||||
File.umask(0)
|
File.umask(0)
|
||||||
|
|
||||||
getopts("n", "make:", "make-flags:")
|
getopts("n", "make:", "make-flags:", "mantype:doc")
|
||||||
$dryrun = $OPT["n"]
|
$dryrun = $OPT["n"]
|
||||||
mflags = Shellwords.shellwords($OPT["make-flags"] || "").uniq
|
mflags = Shellwords.shellwords($OPT["make-flags"] || "").uniq
|
||||||
mflags[0].sub!(/^\w+$/, '-\&') unless mflags.empty?
|
mflags[0].sub!(/^\w+$/, '-\&') unless mflags.empty?
|
||||||
@ -18,6 +19,7 @@ make, *mflags[0, 0] = Shellwords.shellwords($OPT['make'] || ENV["MAKE"] || "")
|
|||||||
mflags = mflags.grep(/^-([^-])/){$1}.join
|
mflags = mflags.grep(/^-([^-])/){$1}.join
|
||||||
mflags.downcase! if /nmake/i == make
|
mflags.downcase! if /nmake/i == make
|
||||||
$dryrun = true if mflags.include?(?n)
|
$dryrun = true if mflags.include?(?n)
|
||||||
|
mantype = $OPT["mantype"]
|
||||||
|
|
||||||
ARGV.delete_if{|x|x[0] == ?-}
|
ARGV.delete_if{|x|x[0] == ?-}
|
||||||
destdir = ARGV[0] || ''
|
destdir = ARGV[0] || ''
|
||||||
@ -40,14 +42,14 @@ rubylibdir = destdir+CONFIG["rubylibdir"]
|
|||||||
archlibdir = destdir+CONFIG["archdir"]
|
archlibdir = destdir+CONFIG["archdir"]
|
||||||
sitelibdir = destdir+CONFIG["sitelibdir"]
|
sitelibdir = destdir+CONFIG["sitelibdir"]
|
||||||
sitearchlibdir = destdir+CONFIG["sitearchdir"]
|
sitearchlibdir = destdir+CONFIG["sitearchdir"]
|
||||||
mandir = File.join(destdir+CONFIG["mandir"], "man1")
|
mandir = File.join(destdir+CONFIG["mandir"], "man")
|
||||||
configure_args = Shellwords.shellwords(CONFIG["configure_args"])
|
configure_args = Shellwords.shellwords(CONFIG["configure_args"])
|
||||||
enable_shared = CONFIG["ENABLE_SHARED"] == 'yes'
|
enable_shared = CONFIG["ENABLE_SHARED"] == 'yes'
|
||||||
dll = CONFIG["LIBRUBY_SO"]
|
dll = CONFIG["LIBRUBY_SO"]
|
||||||
lib = CONFIG["LIBRUBY"]
|
lib = CONFIG["LIBRUBY"]
|
||||||
arc = CONFIG["LIBRUBY_A"]
|
arc = CONFIG["LIBRUBY_A"]
|
||||||
|
|
||||||
makedirs [bindir, libdir, rubylibdir, archlibdir, sitelibdir, sitearchlibdir, mandir]
|
makedirs [bindir, libdir, rubylibdir, archlibdir, sitelibdir, sitearchlibdir]
|
||||||
|
|
||||||
install ruby_install_name+exeext, File.join(bindir, ruby_install_name+exeext), 0755
|
install ruby_install_name+exeext, File.join(bindir, ruby_install_name+exeext), 0755
|
||||||
if rubyw_install_name and !rubyw_install_name.empty?
|
if rubyw_install_name and !rubyw_install_name.empty?
|
||||||
@ -115,14 +117,38 @@ Dir.glob("lib/**/*{.rb,help-message}") do |f|
|
|||||||
install f, dir, 0644
|
install f, dir, 0644
|
||||||
end
|
end
|
||||||
|
|
||||||
for f in Dir["*.h"]
|
Dir.glob("*.h") do |f|
|
||||||
install f, archlibdir, 0644
|
install f, archlibdir, 0644
|
||||||
end
|
end
|
||||||
|
|
||||||
if RUBY_PLATFORM =~ /mswin32|mingw|bccwin32/
|
if RUBY_PLATFORM =~ /mswin32|mingw|bccwin32/
|
||||||
makedirs File.join(archlibdir, "win32")
|
makedirs File.join(archlibdir, "win32")
|
||||||
install "win32/win32.h", File.join(archlibdir, "win32"), 0644
|
install "win32/win32.h", File.join(archlibdir, "win32"), 0644
|
||||||
end
|
end
|
||||||
|
|
||||||
install "ruby.1", File.join(mandir, ruby_install_name+".1"), 0644
|
Dir.glob("*.[1-9]") do |mdoc|
|
||||||
|
section = mdoc[-1,1]
|
||||||
|
|
||||||
|
destdir = mandir + section
|
||||||
|
destfile = File.join(destdir, mdoc.sub(/ruby/, ruby_install_name))
|
||||||
|
|
||||||
|
makedirs destdir
|
||||||
|
|
||||||
|
if mantype == "doc"
|
||||||
|
install mdoc, destfile, 0644
|
||||||
|
else
|
||||||
|
require 'mdoc2man.rb'
|
||||||
|
|
||||||
|
w = Tempfile.open(mdoc)
|
||||||
|
|
||||||
|
open(mdoc) { |r|
|
||||||
|
Mdoc2Man.mdoc2man(r, w)
|
||||||
|
}
|
||||||
|
|
||||||
|
w.close
|
||||||
|
|
||||||
|
install w.path, destfile, 0644
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
# vi:set sw=2:
|
# vi:set sw=2:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user