X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=build-pspp;h=d6ffcceb18c8a30b943987ed99121c806e13dcef;hb=212b6e98082bce6088735cfbd6e6e30a83d79461;hp=62e8a75030545f7c348c0a528c167fc10d808392;hpb=4138eb6b6199bcb31345250dd0292f8559f14558;p=pspp diff --git a/build-pspp b/build-pspp index 62e8a75030..d6ffcceb18 100755 --- a/build-pspp +++ b/build-pspp @@ -28,7 +28,8 @@ where TARBALL is the name of a tarball produced by "make dist" Options: --help Print this usage message and exit --no-binary Build source tarballs but no binaries. - --batch Do not print progress to stdout.""" + --batch Do not print progress to stdout. + --no-perl Do not build Perl module.""" % (sys.argv[0], sys.argv[0])) sys.exit(0) @@ -168,6 +169,7 @@ try: ["help", "binary", "no-binary", "batch", "no-batch", + "no-perl", "output=", "builder=", "build-number="]) except getopt.GetoptError as err: @@ -180,6 +182,7 @@ batch = not os.isatty(1) builddir = None build_number = None builder = None +build_perl = True for o, a in opts: if o in ("-h", "--help"): print_usage() @@ -197,6 +200,8 @@ for o, a in opts: builder = a elif o == "--build-number": build_number = a + elif o == "--no-perl": + build_perl = False else: assert False, "unhandled option" if builder is None: @@ -284,10 +289,10 @@ if len(args) == 2: run("cd %s && ./configure --prefix=''" % ssw_dir) start_step("Build spread-sheet-widget") - run("cd %s && make -j10" % ssw_dir) + run("cd %s && make -j$(nproc)" % ssw_dir) start_step("Install spread-sheet-widget") - run("cd %s && make -j10 install DESTDIR=$PWD/inst" % ssw_dir) + run("cd %s && make -j$(nproc) install DESTDIR=$PWD/inst" % ssw_dir) start_step("Fetch branch from Git") set_var("git_repo", repo) @@ -410,7 +415,7 @@ Changes from %(repo_version)s to %(version)s: # Bootstrap. start_step("Bootstrap (make -f Smake)") - run("cd pspp && make -f Smake -j10", "bootstrap") + run("cd pspp && make -f Smake -j$(nproc)", "bootstrap") # Configure. start_step("Configure source") @@ -422,7 +427,7 @@ Changes from %(repo_version)s to %(version)s: # Distribute. start_step("Make source tarball") - run("cd pspp/_build && make dist", "dist") + run("cd pspp/_build && make -j128 dist", "dist") tarname = "pspp-%s.tar.gz" % version tarball = save_result("source distribution", "pspp/_build/%s" % tarname, 1) @@ -432,11 +437,15 @@ Changes from %(repo_version)s to %(version)s: potfile = "pspp/po/pspp.pot" save_result("translation templates", potfile) + # Build examples for user manual. + start_step("Build examples for user manual") + run("cd pspp/_build && make -j$(nproc) figure-spvs figure-txts figure-texis figure-htmls") + # Build user manual start_step("Build user manual") run("cd pspp && " "GENDOCS_TEMPLATE_DIR=%s %s/gendocs.sh -s doc/pspp.texi -I doc " - "-o %s/user-manual --email bug-gnu-pspp@gnu.org " + "-I _build/doc -o %s/user-manual --email bug-gnu-pspp@gnu.org " "pspp \"GNU PSPP User Manual\"" % (topdir, topdir, resultsdir), "user-manual") saved_result("User Manual", "user-manual") @@ -478,18 +487,20 @@ if build_binary: start_step("Configuring") run("chmod -R a-w %s/%s" % (builddir, tarball_dir)) run("chmod u+w %s/%s" % (builddir, tarball_dir)) - run("chmod -R u+w %s/%s/perl-module" % (builddir, tarball_dir)) + if build_perl: + run("chmod -R u+w %s/%s/perl-module" % (builddir, tarball_dir)) run("mkdir %s/%s/_build" % (builddir, tarball_dir)) run("chmod a-w %s/%s" % (builddir, tarball_dir)) ok = try_run( "cd %(builddir)s/%(tarball_dir)s/_build && ../configure " - "--with-perl-module --enable-relocatable --prefix='' " + "--%(perl)s-perl-module --enable-relocatable --prefix='' " "PKG_CONFIG_PATH=$PWD/../../../source/%(ssw_dir)s/inst/lib/pkgconfig " "CPPFLAGS=\"-I$PWD/../../../source/%(ssw_dir)s/inst/include\" " - "LDFLAGS=\"-L$PWD/../../../source/%(ssw_dir)s/inst/lib\"" + "LDFLAGS=\"-L$PWD/../../../source/%(ssw_dir)s/inst/lib\" " % {"builddir": builddir, "tarball_dir": tarball_dir, - "ssw_dir": ssw_dir}, + "ssw_dir": ssw_dir, + "perl": "with" if build_perl else "without"}, "bin-configure") for basename in ("config.h", "config.log"): save_result_if_exists("build configuration", @@ -499,21 +510,24 @@ if build_binary: fail() start_step("Build") - run("cd %s/%s/_build && make -j10" % (builddir, tarball_dir), "build") - run("cd %s/%s/_build/perl-module && perl Makefile.PL && make -j10" - % (builddir, tarball_dir), "build Perl module") + run("cd %s/%s/_build && make -j$(nproc)" % (builddir, tarball_dir), "build") + if build_perl: + run("cd %s/%s/_build/perl-module && perl Makefile.PL && make -j$(nproc)" + % (builddir, tarball_dir), "build Perl module") start_step("Install") - run("cd %s/%s/_build && make install DESTDIR=$PWD/pspp-%s" + run("cd %s/%s/_build && make -j$(nproc) install DESTDIR=$PWD/pspp-%s" % (builddir, tarball_dir, binary_version), "install") - run("cd ../source/%s && make -j10 install DESTDIR=%s/%s/_build/pspp-%s" + run("cd ../source/%s && make -j$(nproc) install DESTDIR=%s/%s/_build/pspp-%s" % (ssw_dir, builddir, tarball_dir, binary_version)) - run("cd %s/%s/_build/perl-module && " - "make install DESTDIR=%s/%s/_build/pspp-%s" - % (builddir, tarball_dir, builddir, tarball_dir, binary_version), - "install Perl module") - run("cd %s/%s/_build/perl-module && make install DESTDIR=$PWD/inst" - % (builddir, tarball_dir)) + if build_perl: + run("cd %s/%s/_build/perl-module && " + "make -j$(nproc) install DESTDIR=%s/%s/_build/pspp-%s" + % (builddir, tarball_dir, builddir, tarball_dir, binary_version), + "install Perl module") + run("cd %s/%s/_build/perl-module && " + "make -j$(nproc) install DESTDIR=$PWD/inst" + % (builddir, tarball_dir)) start_step("Make binary distribution") run("cd %s/%s/_build && tar cfz pspp-%s.tar.gz pspp-%s" @@ -522,8 +536,8 @@ if build_binary: % (builddir, tarball_dir, binary_version), 1) start_step("Check") - ok = try_run("cd %s/%s/_build && make check" % (builddir, tarball_dir), - "check") + ok = try_run("cd %s/%s/_build && make check TESTSUITEFLAGS=-j$(nproc)" + % (builddir, tarball_dir), "check") for basename in ("tests/testsuite.log", "tests/testsuite.dir"): save_result_if_exists("test logs", "%s/%s/_build/%s" % (builddir, tarball_dir, basename)) @@ -531,18 +545,19 @@ if build_binary: fail() start_step("Uninstall") - run("cd ../source/%s && make -j10 uninstall DESTDIR=%s/%s/_build/pspp-%s" + run("cd ../source/%s && make -j$(nproc) uninstall DESTDIR=%s/%s/_build/pspp-%s" % (ssw_dir, builddir, tarball_dir, binary_version)) - run("cd %s/%s/_build && make uninstall DESTDIR=$PWD/pspp-%s" + run("cd %s/%s/_build && make -j$(nproc) uninstall DESTDIR=$PWD/pspp-%s" % (builddir, tarball_dir, binary_version), "uninstall") start_step("Check uninstall") - run("(cd %s/%s/_build/perl-module/inst && find -type f -print) | " - "(cd %s/%s/_build/pspp-%s && xargs rm)" - % (builddir, tarball_dir, - builddir, tarball_dir, binary_version), "uninstall Perl module") + if build_perl: + run("(cd %s/%s/_build/perl-module/inst && find -type f -print) | " + "(cd %s/%s/_build/pspp-%s && xargs rm)" + % (builddir, tarball_dir, + builddir, tarball_dir, binary_version), "uninstall Perl module") run("cd %s/%s/_build && " - "make distuninstallcheck distuninstallcheck_dir=$PWD/pspp-%s" + "make -j$(nproc) distuninstallcheck distuninstallcheck_dir=$PWD/pspp-%s" % (builddir, tarball_dir, binary_version), "distuninstallcheck")