Skip to content
This repository was archived by the owner on May 6, 2024. It is now read-only.

macOS: update the macOS build guide #59

Merged
merged 1 commit into from
Apr 13, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion SUMMARY.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* [install syslog-ng on different platforms](chapters/chapter_0/README.md)
* [Ubuntu](chapters/chapter_0/section_1.md)
* [openSUSE](chapters/chapter_0/section_2.md)
* [MacOS X](chapters/chapter_0/section_3.md)
* [macOS](chapters/chapter_0/section_3.md)
* [FreeBSD](chapters/chapter_0/section_4.md)
* [get familiar with the structure](chapters/chapter_1/README.md)
* [project structure](chapters/chapter_1/section_1.md)
Expand Down
90 changes: 51 additions & 39 deletions chapters/chapter_0/section_3.md
Original file line number Diff line number Diff line change
@@ -1,101 +1,113 @@
# MacOS X
# macOS

[ref:compile]: ../../chapters/chapter_2/README.md
[ref:run]: ../../chapters/chapter_2/README.md
[ref:docs]: http://www.balabit.com/sites/default/files/documents/syslog-ng-ose-latest-guides/en/syslog-ng-ose-guide-admin/html-single/index.html
[ref:homebrew]: http://brew.sh
[ref:criterion]: https://github.com/Snaipe/Criterion
[gh:ose-official]: http://www.github.com/balabit/syslog-ng
[gh:ose-gregory094]: http://www.github.com/gregory094/syslog-ng
[gh:ose-gregory094-osx]: https://github.com/gregory094/syslog-ng/tree/3.6/f/macosx

## Introduction

The syslog-ng application has been resurrected on the OSX platform by our developer team.
The syslog-ng application has been resurrected on macOS by our developer team.
We hope our product can be useful for Mac users who want to increase the security of their
system through reliable logging.
system through reliable logging.

At present we are not supporting OSX syslog-ng on our [official repository][gh:ose-official] on GitHub.
A “non-official” support is available for [3.6][gh:ose-gregory094-osx] at [gregory094/syslog-ng][gh:ose-gregory094]
on GitHub but we do not plan to backport the support officially.
At present we are not supporting macOS syslog-ng on our [official repository][gh:ose-official] on GitHub.
However, you can compile syslog-ng yourself following this guide.

## Using homebrew

Now syslog-ng is provided by [Homebrew][ref:homebrew] and gives you a stable syslog-ng install with the modules that
is tested to function well.

```
brew install syslog-ng
```

## From source
## Compiling from source
Like every project syslog-ng also uses different libraries and build-systems that must be installed
for compiling and running properly. These dependencies can be satisfied by compiling every-each libs and tools manually, but I would prefer to do it the easy way. [Homebrew][ref:homebrew] is a package manager for OSX that has great community and support. You can also use it to install the dependencies you need.
for compiling and running properly. These dependencies can be satisfied by compiling every-each libs and tools manually, but it might be preferred to do it the easy way. [Homebrew][ref:homebrew] is a package manager for macOS that has great community and support. You can also use it to install the dependencies you need.

### Dependencies
1. Install Homebrew on your system.
2. Perform `brew update` if you have not done it yet.
3. The following packages should be installed for syslog-ng:
* glib
* openssl
* libtool
* automake
* pkgconfig
* autoconf
* binutils
* glib
* autoconf-archive
* flex
* eventlog
* pcre
* bison
* libtool
* pkg-config
* ivykis
* openssl
* pcre

```shell
ruby -e “$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)”
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

brew update
brew install glib openssl libtool automake pkgconfig eventlog pcre bison flex
brew install \
automake \
autoconf \
binutils \
glib \
autoconf-archive \
flex \
bison \
libtool \
pkg-config \
ivykis \
openssl \
pcre
```

*Note:* bison is required to be installed when using homebrew, because the options provided by Apple Developer Tools are incomplete. (for example: missing -W option) The reason is why bison is required to be installed from homebrew is that the -W option is supported only after 2.3.

### Preparations

1. Disable syslogd, the official logging service of Apple. It is not a necessary step but using two logger services does not make sense.
2. Force the building process to use bison installed through homebrew instead of provided by Apple Developer Tools.
1. Force the building process to use bison installed through homebrew instead of provided by Apple Developer Tools.
* *Option 1:* add bison to `$PATH`
* *Option 2:* when configuring set the environmental variable `$YACC` to bison
2. Extend the search path of pkg-config.

```shell
export PATH=/usr/local/opt/bison/bin:$PATH
export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig:/usr/local/opt/openssl/lib/pkgconfig
```

###Configuration
### Configuration

```shell
./configure --with-ivykis=internal --prefix=<INSTALL PATH>
./autogen.sh
./configure --with-ivykis=system
```

For a minimal featureset:

```shell
./configure --with-ivykis=internal --prefix=<INSTALL PATH> --disable-amqp --disable-mongodb --disable-riemann --disable-java --disable-python
./autogen.sh
./configure --with-ivykis=system --disable-amqp --disable-mongodb --disable-riemann --disable-java --disable-python
```

###Compile and install
### Compile and install

```shell
make && make install
make -j4
make install
```

Optionally, you can specify the install prefix passing `--prefix /example/installdir/` to the configure script.

*Note:* for options and more information, read the [compile first][ref:compile] guide.

### Testing

In order to run the tests use the command below:
In order to run the tests, you have to install the [Criterion][ref:criterion] testing framework (for example: `brew install snaipe/soft/criterion`). Then use the command below:

```shell
make dist-check VERBOSE=1
make func-test VERBOSE=1
make check -j4
```

*Note:* for more read [compile first][ref:compile] guide.

### Run

```shell
./syslog-ng
./syslog-ng -F
```

*Note:* for more information read the [run first][ref:run] guide.
Expand Down