This Confluence has been LDAP enabled, if you are an ASF Committer, please use your LDAP Credentials to login. Any problems file an INFRA jira ticket please.

Page tree
Skip to end of metadata
Go to start of metadata

This page documents the requirements and special instructions for building Traffic Server on macOS.

To build Traffic Server, you will need to retrieve yourself a copy of PCRE, libtool, and automake. You can get it yourself from the source or elsewhere like macports or Homebrew.

Traffic Server only builds with clang on macOS We do not support building with gcc on this platform. You will need to install the latest version of Xcode.

Building Traffic Server with Homebrew

First, visit to install the Homebrew package manager.

Next, install the build dependencies:

$ brew install automake autoconf libtool pcre openssl

On certain versions of macOS / OS X and Xcode, you will also have to install libxml2:

$ brew install libxml2
$ brew link --force libxml2

After you have PCRE development libraries installed on your system, you should get the Traffic Server code with git.

$ git clone

Run autoreconf to generate the configure script:

$ cd trafficserver   # enter the new checkout directory
$ autoreconf -i      # generate the configure script

From the checkout directory, run `configure` to generate the Makefile files. You may need to specify the base path where the development files (headers and libraries) for PCRE are installed, e.g. if you installed pcre with MacPorts, you will need to specify the directory '/opt/local'. When building against Homebrew, specify the openssl library with --with-openssl=/usr/local/opt/openssl

$ ./configure --with-openssl=/usr/local/opt/openssl

Now you can make and install:

$ make
$ sudo make install

Generates a compilation database for clang tooling with Bear

JSON Compilation Database ( compile_commands.json ) is used by clang based tools.   For autotools based project (like Traffic Server), Bear is a tool that generates a compilation database.

On macOS or Fedora there is a know issue that bear generates empty compilation database because of SIP. Below is instruction to avoid the issue. Assuming above instruction is done. (automake autoconf libtool are already installed).

In short, all building tool chain should not be under certain directories which is protected by SIP. 

$ cp /bin/sh /usr/loca/bin/
$ brew install bear llvm make
$ which clang clang++ gmake
$ CONFIG_SHELL=/usr/local/bin/sh CC=clang CXX=clang++ ./configure --ADD-OPTIONS-YOU-WANT
$ bear gmake 
  • Mac Ports - package retrieval and installation system.
  • Homebrew - package retrieval and installation system.
  • Xcode - if you want to use the latest version of GCC from Apple. Requires free registration to get to the download page.
  • PCRE - required software for building Traffic Server from the source.


  1. Anonymous

    The compilation fails on Snow Leopard, with a segmentation fault during "make"

    /bin/sh ../../libtool --tag=CXX --mode=compile g++ -DHAVE_CONFIG_H -I. -I../../lib -I/opt/local/include -D_LARGEFILE64_SOURCE=1 -D_COMPILE64BIT_SOURCE=1 -D_GNU_SOURCE -D_REENTRANT -Ddarwin -I/System/Library/Frameworks/Tcl.framework/Versions/8.5/Headers -I/usr/local/Cellar/include -g -pipe -Wall -Werror -Wno-deprecated-declarations -O3 -feliminate-unused-debug-symbols -fno-strict-aliasing -Wno-invalid-offsetof -MT Diags.lo -MD -MP -MF .deps/Diags.Tpo -c -o Diags.lo
    libtool: compile: g++ -DHAVE_CONFIG_H -I. -I../../lib -I/opt/local/include -D_LARGEFILE64_SOURCE=1 -D_COMPILE64BIT_SOURCE=1 -D_GNU_SOURCE -D_REENTRANT -Ddarwin -I/System/Library/Frameworks/Tcl.framework/Versions/8.5/Headers -I/usr/local/Cellar/include -g -pipe -Wall -Werror -Wno-deprecated-declarations -O3 -feliminate-unused-debug-symbols -fno-strict-aliasing -Wno-invalid-offsetof -MT Diags.lo -MD -MP -MF .deps/Diags.Tpo -c -fno-common -DPIC -o .libs/Diags.o internal compiler error: Segmentation fault: 11
    Please submit a full bug report,
    with preprocessed source if appropriate.
    See <URL:> for instructions.

    Unknown macro: {standard input}

    :1240:End-of-File not at end of a line

    :unknown:Partial line at end of file ignored

    Unknown macro: {standard input}

    :unknown:Undefined local symbol L_.str1

    :unknown:Undefined local symbol L_.str2

    Unknown macro: {standard input}

    :unknown:Undefined local symbol L_.str3

    :unknown:Undefined local symbol L_.str4

    Unknown macro: {standard input}

    :unknown:Undefined local symbol L_.str5

    :unknown:Undefined local symbol L_.str6

    Unknown macro: {standard input}

    :unknown:Undefined local symbol L_.str7

    :unknown:Undefined local symbol L_.str8

    Unknown macro: {standard input}

    :unknown:Undefined local symbol L_.str

    :unknown:Undefined local symbol L_.str9

    Unknown macro: {standard input}

    :unknown:Undefined local symbol L_.str10

    :unknown:Undefined local symbol L_.str11

    Unknown macro: {standard input}

    :unknown:Undefined local symbol L_.str12

    :unknown:Undefined local symbol L_.str13

    Unknown macro: {standard input}

    :unknown:Undefined local symbol L_.str14

    :unknown:Undefined local symbol L_.str15

    Unknown macro: {standard input}

    :unknown:Undefined local symbol L_.str16

    :unknown:Undefined local symbol L_.str17

    Unknown macro: {standard input}

    :unknown:Undefined local symbol L_.str18

    :unknown:Undefined local symbol L_.str19

    Unknown macro: {standard input}

    :unknown:Undefined local symbol L_.str20

    :unknown:Undefined local symbol L_.str21

    Unknown macro: {standard input}

    :unknown:Undefined local symbol LBB8_5
    make[3]: *** [Diags.lo] Error 1
    make[2]: *** [all] Error 2
    make[1]: *** [all-recursive] Error 1
    make: *** [all-recursive] Error 1

    1. Anonymous

      I am also getting a segmentation fault when compiling on snow leopard. Is there a fix for this? Based on internet search, I replaced CC with clang and clang++ and it almost solved teh problem. I had to add a copy constructor for MultiCacheHeader and it all compiled.

      1. Yes, you have to build with clang. Apple's version of GCC is not supported.

        Typically, we support the latest version of Mac OS X, but would be happy to accept patches to build on older versions.