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

Commit

Permalink
macOS: update the macOS build guide
Browse files Browse the repository at this point in the history
Signed-off-by: László Várady <[email protected]>
  • Loading branch information
MrAnno committed Mar 23, 2018
1 parent f5444b4 commit ab8d063
Show file tree
Hide file tree
Showing 2 changed files with 52 additions and 29 deletions.
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
79 changes: 51 additions & 28 deletions chapters/chapter_0/section_3.md
Original file line number Diff line number Diff line change
@@ -1,22 +1,20 @@
# 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.
syslog-ng 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

Expand All @@ -29,73 +27,98 @@ brew install syslog-ng

## 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 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 needed.

### 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

```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

0 comments on commit ab8d063

Please sign in to comment.