From 07d7a1626e707a500bcf15c4892f8ec3608a9f8c Mon Sep 17 00:00:00 2001 From: "tg(x)" <*@tg-x.net> Date: Sun, 8 May 2011 04:11:36 +0200 Subject: [PATCH] makefile fixes for solaris --- Makefile | 4 ++-- include/psyc/lib.h | 5 ++--- test/Makefile | 15 +++++++++++---- 3 files changed, 15 insertions(+), 9 deletions(-) diff --git a/Makefile b/Makefile index 4144243..5cb0938 100644 --- a/Makefile +++ b/Makefile @@ -25,8 +25,8 @@ doc: doxygen clean: - make -C src clean - make -C test clean + ${MAKE} -C src clean + ${MAKE} -C test clean rm -rf doc/html doc/latex doc/man help: diff --git a/include/psyc/lib.h b/include/psyc/lib.h index d04aae2..dfa017b 100644 --- a/include/psyc/lib.h +++ b/include/psyc/lib.h @@ -5,7 +5,6 @@ #include "../psyc.h" #include "./debug.h" -#include #include /* perlisms for readability */ @@ -14,11 +13,11 @@ #define PSYC_NUM_ELEM(a) (sizeof(a) / sizeof(*(a))) -#if !defined(_GNU_SOURCE) && !defined(__FBSDID) +#if !defined(__USE_GNU) && !(defined(__FBSDID) && defined(__BSD_VISIBLE)) void * memmem(const void *l, size_t l_len, const void *s, size_t s_len); #endif -#if !defined(_GNU_SOURCE) && !defined(__FBSDID) +#if !defined(__USE_GNU) && !(defined(__FBSDID) && defined(__BSD_VISIBLE)) int itoa(int number, char* out, int base); #endif diff --git a/test/Makefile b/test/Makefile index f36fb7d..0ead41e 100644 --- a/test/Makefile +++ b/test/Makefile @@ -2,13 +2,22 @@ OPT = -O2 DEBUG = 2 CFLAGS = -I../include -Wall -std=c99 ${OPT} LDFLAGS = -L../lib -LOADLIBES = -lpsyc -lm TARGETS = testServer testParser testMatch testRender testText isRoutingVar getVarType WRAPPER = DIET = diet PORT = 4440 +LOADLIBES = -lpsyc -lm +ifeq ($(shell uname),SunOS) + LOADLIBES_NET = ${LOADLIBES} -lsocket -lnsl +else + LOADLIBES_NET = ${LOADLIBES} +endif + all: ${TARGETS} +it: all + +testServer: LOADLIBES := ${LOADLIBES_NET} diet: WRAPPER = ${DIET} diet: all @@ -20,8 +29,6 @@ debug: all clean: rm -f ${TARGETS} -it: all - test: ${TARGETS} ./testRender ./testMatch @@ -53,4 +60,4 @@ srvstartr: ./testServer ${PORT} -r & srvkill: - killall testServer + pkill -x testServer