diff --git a/Lib/distutils/unixccompiler.py b/Lib/distutils/unixccompiler.py index 92d14dfee72..3f321c28dc3 100644 --- a/Lib/distutils/unixccompiler.py +++ b/Lib/distutils/unixccompiler.py @@ -227,6 +227,8 @@ def runtime_library_dir_option(self, dir): if sys.platform[:6] == "darwin": # MacOSX's linker doesn't understand the -R flag at all return "-L" + dir + elif sys.platform[:7] == "freebsd": + return "-Wl,-rpath=" + dir elif sys.platform[:5] == "hp-ux": if self._is_gcc(compiler): return ["-Wl,+s", "-L" + dir]