aboutsummaryrefslogtreecommitdiff
path: root/contrib/bc/scripts/karatsuba.py
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/bc/scripts/karatsuba.py')
-rwxr-xr-xcontrib/bc/scripts/karatsuba.py9
1 files changed, 3 insertions, 6 deletions
diff --git a/contrib/bc/scripts/karatsuba.py b/contrib/bc/scripts/karatsuba.py
index b8505186b526..9c94ffe448f7 100755
--- a/contrib/bc/scripts/karatsuba.py
+++ b/contrib/bc/scripts/karatsuba.py
@@ -2,7 +2,7 @@
#
# SPDX-License-Identifier: BSD-2-Clause
#
-# Copyright (c) 2018-2021 Gavin D. Howard and contributors.
+# Copyright (c) 2018-2023 Gavin D. Howard and contributors.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
@@ -49,9 +49,6 @@ testdir = os.path.dirname(script)
if testdir == "":
testdir = os.getcwd()
-# We want to be in the root directory.
-os.chdir(testdir + "/..")
-
print("\nWARNING: This script is for distro and package maintainers.")
print("It is for finding the optimal Karatsuba number.")
print("Though it only needs to be run once per release/platform,")
@@ -116,7 +113,7 @@ try:
except KeyError:
flags["CFLAGS"] = "-flto"
-p = run([ "./configure.sh", "-O3" ], flags)
+p = run([ "{}/../configure.sh".format(testdir), "-O3" ], flags)
if p.returncode != 0:
print("configure.sh returned an error ({}); exiting...".format(p.returncode))
sys.exit(p.returncode)
@@ -161,7 +158,7 @@ try:
# Configure and compile.
print("\nCompiling...\n")
- p = run([ "./configure.sh", "-O3", "-k{}".format(i) ], config_env)
+ p = run([ "{}/../configure.sh".format(testdir), "-O3", "-k{}".format(i) ], config_env)
if p.returncode != 0:
print("configure.sh returned an error ({}); exiting...".format(p.returncode))