summaryrefslogtreecommitdiff
path: root/src/template/darwin
blob: 702273356693bd9413ef6629e6b2485dc57b53c4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
# src/template/darwin

# Note: Darwin is the original code name for macOS, also known as OS X.
# We still use "darwin" as the port name, partly because config.guess does.

# Select where some include files should be sought.
# We may eventually be forced to use "-isysroot" with this value,
# but for now, it only affects Perl and Tcl include files.
if test x"$PG_SYSROOT" = x"" ; then
  PG_SYSROOT=`xcodebuild -version -sdk macosx Path 2>/dev/null`
fi
# Old xcodebuild versions may produce garbage, so validate the result.
if test x"$PG_SYSROOT" != x"" ; then
  if test \! -d "$PG_SYSROOT" ; then
    PG_SYSROOT=""
  fi
fi

# Select appropriate semaphore support.  Darwin 6.0 (macOS 10.2) and up
# support System V semaphores; before that we have to use named POSIX
# semaphores, which are less good for our purposes because they eat a
# file descriptor per backend per max_connection slot.
case $host_os in
  darwin[015].*)
    USE_NAMED_POSIX_SEMAPHORES=1
    ;;
  *)
    USE_SYSV_SEMAPHORES=1
    ;;
esac