Commit e839091b by Alan Mishchenko

Suggested fix to compile on FreeBSD.

parent f8d9fc3a
...@@ -11,6 +11,7 @@ $(info $(MSG_PREFIX)Using CXX=$(CXX)) ...@@ -11,6 +11,7 @@ $(info $(MSG_PREFIX)Using CXX=$(CXX))
$(info $(MSG_PREFIX)Using LD=$(LD)) $(info $(MSG_PREFIX)Using LD=$(LD))
PROG := abc PROG := abc
OS := $(shell uname -s)
MODULES := \ MODULES := \
$(wildcard src/ext*) \ $(wildcard src/ext*) \
...@@ -73,6 +74,10 @@ ABC_READLINE_LIBRARIES ?= -lreadline ...@@ -73,6 +74,10 @@ ABC_READLINE_LIBRARIES ?= -lreadline
ifndef ABC_USE_NO_READLINE ifndef ABC_USE_NO_READLINE
CFLAGS += -DABC_USE_READLINE $(ABC_READLINE_INCLUDES) CFLAGS += -DABC_USE_READLINE $(ABC_READLINE_INCLUDES)
LIBS += $(ABC_READLINE_LIBRARIES) LIBS += $(ABC_READLINE_LIBRARIES)
ifeq ($(OS), FreeBSD)
CFLAGS += -I/usr/local/include
LDFLAGS += -L/usr/local/lib
endif
$(info $(MSG_PREFIX)Using libreadline) $(info $(MSG_PREFIX)Using libreadline)
endif endif
...@@ -118,7 +123,11 @@ endif ...@@ -118,7 +123,11 @@ endif
endif endif
# LIBS := -ldl -lrt # LIBS := -ldl -lrt
LIBS += -ldl -lm LIBS += -lm
ifneq ($(OS), FreeBSD)
LIBS += -ldl
endif
ifneq ($(findstring Darwin, $(shell uname)), Darwin) ifneq ($(findstring Darwin, $(shell uname)), Darwin)
LIBS += -lrt LIBS += -lrt
endif endif
...@@ -191,7 +200,7 @@ tags: ...@@ -191,7 +200,7 @@ tags:
$(PROG): $(OBJ) $(PROG): $(OBJ)
@echo "$(MSG_PREFIX)\`\` Building binary:" $(notdir $@) @echo "$(MSG_PREFIX)\`\` Building binary:" $(notdir $@)
$(VERBOSE)$(LD) -o $@ $^ $(LIBS) $(VERBOSE)$(LD) -o $@ $^ $(LDFLAGS) $(LIBS)
lib$(PROG).a: $(LIBOBJ) lib$(PROG).a: $(LIBOBJ)
@echo "$(MSG_PREFIX)\`\` Linking:" $(notdir $@) @echo "$(MSG_PREFIX)\`\` Linking:" $(notdir $@)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment