Skip to content

Commit 511c436

Browse files
committed
Merge pull request #102 from udp/freebsd
FreeBSD build support. This unblocks work on a FreeBSD port.
2 parents 61cc0d8 + 440a052 commit 511c436

File tree

15 files changed

+58
-16
lines changed

15 files changed

+58
-16
lines changed

test/1_stdlib/timeout.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/bin/bash
1+
#!/usr/bin/env bash
22

33
# timeout.sh <seconds> <command...>
44

utils/benchmark/build.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/bin/bash
1+
#!/usr/bin/env bash
22

33
if [[ -n "$LLVM_DIR" ]]; then
44
BUILD_DIR="$LLVM_DIR/build"

utils/build-script

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/usr/bin/python
1+
#!/usr/bin/env python
22
#===--- build-script - The ultimate tool for building Swift ----------------===#
33
#
44
## This source file is part of the Swift.org open source project

utils/build-script-impl

Lines changed: 44 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/bin/bash
1+
#!/usr/bin/env bash
22
#===--- build-script-impl - Implementation details of build-script ---------===#
33
#
44
## This source file is part of the Swift.org open source project
@@ -171,6 +171,7 @@ KNOWN_SETTINGS=(
171171
sil-verify-all "0" "If enabled, run the sil verifier be run after every SIL pass"
172172
swift-enable-ast-verifier "1" "If enabled, and the assertions are enabled, the built Swift compiler will run the AST verifier every time it is invoked"
173173
swift-enable-target-linux "1" "Enable compiler support for targeting Linux"
174+
swift-enable-target-freebsd "1" "Enable compiler support for targeting FreeBSD"
174175
swift-runtime-enable-dtrace "0" "Enable runtime dtrace support"
175176
swift-runtime-enable-leak-checker "0" "Enable leaks checking routines in the runtime"
176177
use-gold-linker "" "Enable using the gold linker"
@@ -218,6 +219,9 @@ function set_deployment_target_based_options() {
218219
linux-x86_64)
219220
SWIFT_HOST_VARIANT_ARCH="x86_64"
220221
;;
222+
freebsd-x86_64)
223+
SWIFT_HOST_VARIANT_ARCH="x86_64"
224+
;;
221225
macosx-* | iphoneos-* | iphonesimulator-* | \
222226
appletvos-* | appletvsimulator-* | \
223227
watchos-* | watchsimulator-*)
@@ -741,6 +745,12 @@ case "$(uname -s)" in
741745
)
742746
;;
743747

748+
FreeBSD)
749+
NATIVE_TOOLS_DEPLOYMENT_TARGETS=(
750+
"freebsd-x86_64"
751+
)
752+
;;
753+
744754
*)
745755
echo "Unknown operating system"
746756
exit 1
@@ -812,6 +822,12 @@ case "$(uname -s)" in
812822
)
813823
;;
814824

825+
FreeBSD)
826+
STDLIB_DEPLOYMENT_TARGETS=(
827+
"freebsd-x86_64"
828+
)
829+
;;
830+
815831
*)
816832
echo "Unknown operating system"
817833
exit 1
@@ -898,6 +914,10 @@ for deployment_target in "${STDLIB_DEPLOYMENT_TARGETS[@]}"; do
898914
build_for_this_target=1
899915
test_this_target=1
900916
;;
917+
freebsd-*)
918+
build_for_this_target=1
919+
test_this_target=1
920+
;;
901921
macosx-*)
902922
build_for_this_target=$(not $SKIP_BUILD_OSX)
903923
test_this_target=$(not $SKIP_TEST_OSX)
@@ -1644,6 +1664,23 @@ for deployment_target in "${NATIVE_TOOLS_DEPLOYMENT_TARGETS[@]}" "${CROSS_TOOLS_
16441664
"${LLDB_SOURCE_DIR}"
16451665
)
16461666
;;
1667+
FreeBSD)
1668+
cmake_options=(
1669+
"${cmake_options[@]}"
1670+
-DCMAKE_BUILD_TYPE:STRING="${LLDB_BUILD_TYPE}"
1671+
-DCMAKE_INSTALL_PREFIX:PATH="${INSTALL_PREFIX}"
1672+
-DLLDB_PATH_TO_LLVM_SOURCE:PATH="${LLVM_SOURCE_DIR}"
1673+
-DLLDB_PATH_TO_CLANG_SOURCE:PATH="${CLANG_SOURCE_DIR}"
1674+
-DLLDB_PATH_TO_SWIFT_SOURCE:PATH="${SWIFT_SOURCE_DIR}"
1675+
-DLLDB_PATH_TO_LLVM_BUILD:PATH="${llvm_build_dir}"
1676+
-DLLDB_PATH_TO_CLANG_BUILD:PATH="${llvm_build_dir}"
1677+
-DLLDB_PATH_TO_SWIFT_BUILD:PATH="${swift_build_dir}"
1678+
-DLLDB_PATH_TO_CMARK_BUILD:PATH="${cmark_build_dir}"
1679+
-DLLDB_IS_BUILDBOT_BUILD="${LLDB_IS_BUILDBOT_BUILD}"
1680+
-DLLDB_BUILD_DATE:STRING="\"${LLDB_BUILD_DATE}\""
1681+
"${LLDB_SOURCE_DIR}"
1682+
)
1683+
;;
16471684
Darwin)
16481685
# Set up flags to pass to xcodebuild
16491686
lldb_xcodebuild_options=(
@@ -1796,7 +1833,7 @@ tests_busted ()
17961833

17971834
for deployment_target in "${STDLIB_DEPLOYMENT_TARGETS[@]}"; do
17981835
case $deployment_target in
1799-
linux-* | macosx-*)
1836+
linux-* | freebsd-* | macosx-*)
18001837
# OK, we can run tests directly.
18011838
;;
18021839
iphoneos-* | iphonesimulator-* | appletvos-* | appletvsimulator-* | watchos-* | watchsimulator-*)
@@ -1990,6 +2027,8 @@ for deployment_target in "${NATIVE_TOOLS_DEPLOYMENT_TARGETS[@]}" "${CROSS_TOOLS_
19902027
case "$(uname -s)" in
19912028
Linux)
19922029
;;
2030+
FreeBSD)
2031+
;;
19932032
Darwin)
19942033
set_lldb_build_mode
19952034
pushd ${LLDB_SOURCE_DIR}
@@ -2026,6 +2065,9 @@ for deployment_target in "${NATIVE_TOOLS_DEPLOYMENT_TARGETS[@]}" "${CROSS_TOOLS_
20262065
continue
20272066
fi
20282067
LIB_TARGET="linux"
2068+
if [[ `uname -s` == "FreeBSD" ]]; then
2069+
LIB_TARGET="freebsd"
2070+
fi
20292071
if [[ `uname -s` == "Darwin" ]]; then
20302072
LIB_TARGET="macosx"
20312073
fi

utils/darwin-installer-scripts/postinstall

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/bin/bash
1+
#!/usr/bin/env bash
22
#===--- postinstall - Creates symlink after installing xctoolchain ----------===#
33
#
44
## This source file is part of the Swift.org open source project

utils/omit-needless-words.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/usr/bin/python
1+
#!/usr/bin/env python
22

33
# This tool helps assess the impact of automatically applying
44
# heuristics that omit 'needless' words from APIs imported from Clang

utils/pygments/swift.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/usr/bin/python
1+
#!/usr/bin/env python
22

33
import re
44

utils/recursive-lipo

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/usr/bin/python
1+
#!/usr/bin/env python
22

33
import argparse
44
import os.path

utils/resolve-crashes.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/usr/bin/python
1+
#!/usr/bin/env python
22

33
# A small utility to take the output of a Swift validation test run
44
# where some compiler crashers have been fixed, and move them into the

utils/sil-opt-verify-all-modules.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/usr/bin/python
1+
#!/usr/bin/env python
22
#===------------------------------------------------------------------------===#
33
#
44
# This source file is part of the Swift.org open source project

utils/swift-stdlib-tool-substitute

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/bin/bash
1+
#!/usr/bin/env bash
22

33
#===--- swift-stdlib-tool - stand-in for the real swift-stdlib-tool --------===#
44
#

utils/toolchain-codesign

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/bin/bash
1+
#!/usr/bin/env bash
22
#===--- toolchain-codesign - Creates code signed xctoolchain ---------------===#
33
#
44
## This source file is part of the Swift.org open source project

utils/toolchain-installer

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/bin/bash
1+
#!/usr/bin/env bash
22
#===--- toolchain-installer - Creates installer pkg for OS X ---------------===#
33
#
44
## This source file is part of the Swift.org open source project

utils/update-checkout

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/usr/bin/python
1+
#!/usr/bin/env python
22
#===--- update-checkout - Utility to update your local checkouts -----------===#
33
#
44
# This source file is part of the Swift.org open source project

validation-test/SIL/Inputs/gen_parse_stdlib_tests.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/bin/bash
1+
#!/usr/bin/env bash
22

33
process_count=17
44
process_id_max=$(($process_count - 1))

0 commit comments

Comments
 (0)