Fixes to compile on FreeBSD.

This commit is contained in:
leo 2013-07-12 21:29:57 +00:00
parent 1a29356179
commit 5bfa04ddf1
2 changed files with 12 additions and 5 deletions

View file

@ -16,5 +16,5 @@ ifeq ($(HAVE_PNGLIB), yes)
SRC += common/im_png.cpp
endif
LIBS += -lm -lz -lX11 -ldl
LIBS += -lm -lz -lX11 $(EXTRALIBS)

View file

@ -12,15 +12,22 @@ OSDIR := linux
# (Add a -g for debugging)
CPPFLAGS += -O2 -Wall
UNAME_S := $(shell uname -s)
### FreeBSD configuration
ifeq ($(shell uname), FreeBSD)
CPPFLAGS += -L/usr/local/lib
ifeq ($(UNAME_S), FreeBSD)
CPPFLAGS += -L /usr/local/lib
LDFLAGS += -I /usr/local/include
endif
ifeq ($(UNAME_S),Linux)
EXTRALIBS += -ldl
endif
### Default directory
ifeq ($(PREFIX), )
ifeq ($(PREFIX),)
PREFIX := /usr/local
endif
@ -39,7 +46,7 @@ CONFTEST="\#include <stdio.h>\nint main() { FILE *f=fopen(\"conftestval\", \"w\"
if (!f) return 1; fprintf(f, \"%%d\\\n\", (int)sizeof(%s)); return 0; }\n"
$(OSDIR)/config.mk: config.mk
make config
$(MAKE) config
config:
@echo "Automatic configuration"