grobian/carbon-c-relay — pull request #2 by davewongillies (2014-02-06 01:07:59+00:00)
Title: Change order of gcc flags so we can build with newer versions

On newer versions of gcc, if the ordering of the gcc flags isn't correct, you get compilation errors such as:

```
cc -O2 -Wall -DGIT_VERSION=\"2014-02-06\" `pkg-config openssl --cflags` -pthread -c -o relay.o relay.c
relay.c: In function ‘main’:
relay.c:108:6: warning: variable ‘bflag’ set but not used [-Wunused-but-set-variable]
cc -O2 -Wall -DGIT_VERSION=\"2014-02-06\" `pkg-config openssl --cflags` -pthread -c -o carbon-hash.o carbon-hash.c
cc -O2 -Wall -DGIT_VERSION=\"2014-02-06\" `pkg-config openssl --cflags` -pthread -c -o receptor.o receptor.c
cc -O2 -Wall -DGIT_VERSION=\"2014-02-06\" `pkg-config openssl --cflags` -pthread -c -o dispatcher.o dispatcher.c
cc -O2 -Wall -DGIT_VERSION=\"2014-02-06\" `pkg-config openssl --cflags` -pthread -c -o router.o router.c
cc -O2 -Wall -DGIT_VERSION=\"2014-02-06\" `pkg-config openssl --cflags` -pthread -c -o queue.o queue.c
cc -O2 -Wall -DGIT_VERSION=\"2014-02-06\" `pkg-config openssl --cflags` -pthread -c -o server.o server.c
cc -O2 -Wall -DGIT_VERSION=\"2014-02-06\" `pkg-config openssl --cflags` -pthread -c -o collector.o collector.c
cc -O2 -Wall -DGIT_VERSION=\"2014-02-06\" `pkg-config openssl --cflags` -pthread -c -o aggregator.o aggregator.c
cc -o relay `pkg-config openssl --libs` -pthread -lssl -lcrypto relay.o carbon-hash.o receptor.o dispatcher.o router.o queue.o server.o collector.o aggregator.o
carbon-hash.o: In function `carbon_hashpos':
carbon-hash.c:(.text+0x37): undefined reference to `MD5'
collect2: ld returned 1 exit status
make: *** [relay] Error 1
```

Switching the parameters around results in a successful compile:
```
cc -O2 -Wall -DGIT_VERSION=\"2014-02-06\" `pkg-config openssl --cflags` -pthread -c -o relay.o relay.c
relay.c: In function ‘main’:
relay.c:108:6: warning: variable ‘bflag’ set but not used [-Wunused-but-set-variable]
cc -O2 -Wall -DGIT_VERSION=\"2014-02-06\" `pkg-config openssl --cflags` -pthread -c -o carbon-hash.o carbon-hash.c
cc -O2 -Wall -DGIT_VERSION=\"2014-02-06\" `pkg-config openssl --cflags` -pthread -c -o receptor.o receptor.c
cc -O2 -Wall -DGIT_VERSION=\"2014-02-06\" `pkg-config openssl --cflags` -pthread -c -o dispatcher.o dispatcher.c
cc -O2 -Wall -DGIT_VERSION=\"2014-02-06\" `pkg-config openssl --cflags` -pthread -c -o router.o router.c
cc -O2 -Wall -DGIT_VERSION=\"2014-02-06\" `pkg-config openssl --cflags` -pthread -c -o queue.o queue.c
cc -O2 -Wall -DGIT_VERSION=\"2014-02-06\" `pkg-config openssl --cflags` -pthread -c -o server.o server.c
cc -O2 -Wall -DGIT_VERSION=\"2014-02-06\" `pkg-config openssl --cflags` -pthread -c -o collector.o collector.c
cc -O2 -Wall -DGIT_VERSION=\"2014-02-06\" `pkg-config openssl --cflags` -pthread -c -o aggregator.o aggregator.c
cc -o carbon-relay relay.o carbon-hash.o receptor.o dispatcher.o router.o queue.o server.o collector.o aggregator.o `pkg-config openssl --libs` -pthread

```