fix Build Failure on osx

This commit is contained in:
Justin Hammond 2015-06-25 11:18:41 +08:00
parent 814bbc1fb3
commit 5431b30378
3 changed files with 9 additions and 8 deletions

View file

@ -34,8 +34,9 @@ endif
#if we are on a Mac, add these flags and libs to the compile and link phases
ifeq ($(UNAME),Darwin)
CFLAGS += -c -DDARWIN -arch i386 -arch x86_64
LDFLAGS += -arch i386 -arch x86_64 -dynamiclib
CFLAGS += -c -DDARWIN
ARCH += -arch i386 -arch x86_64
LDFLAGS += -dynamiclib
LIBS += -framework IOKit -framework CoreFoundation -arch i386 -arch x86_64
else ifeq ($(UNAME),FreeBSD)
@ -138,7 +139,7 @@ $(LIBDIR)/$(SHARED_LIB_NAME): $(patsubst %.cpp,$(OBJDIR)/%.o,$(tinyxml)) \
$(patsubst %.cpp,$(OBJDIR)/%.o,$(indep)) \
$(OBJDIR)/vers.o
@echo "Linking Shared Library"
@$(LD) $(LDFLAGS) -o $@ $+ $(LIBS)
@$(LD) $(LDFLAGS) $(ARCH) -o $@ $+ $(LIBS)
@ln -sf $(SHARED_LIB_NAME) $(LIBDIR)/$(SHARED_LIB_UNVERSIONED)
ifeq ($(PKGCONFIG),)

View file

@ -110,7 +110,7 @@ $(OBJDIR)/%.o : %.cpp
@$(SED) -e 's/.*://' -e 's/\\$$//' < $(DEPDIR)/$*.d.tmp | fmt -1 | \
$(SED) -e 's/^ *//' -e 's/$$/:/' >> $(DEPDIR)/.$*.d;
@rm -f $(DEPDIR)/$*.d.tmp
@$(CXX) $(CFLAGS) $(INCLUDES) -o $@ $<
@$(CXX) $(CFLAGS) $(ARCH) $(INCLUDES) -o $@ $<
$(OBJDIR)/%.o : %.c
@ -121,7 +121,7 @@ $(OBJDIR)/%.o : %.c
@$(SED) -e 's/.*://' -e 's/\\$$//' < $(DEPDIR)/$*.d.tmp | fmt -1 | \
$(SED) -e 's/^ *//' -e 's/$$/:/' >> $(DEPDIR)/.$*.d;
@rm -f $(DEPDIR)/$*.d.tmp
@$(CC) $(CFLAGS) $(INCLUDES) -o $@ $<
@$(CC) $(CFLAGS) $(ARCH) $(INCLUDES) -o $@ $<
dummy := $(shell test -d $(OBJDIR) || mkdir -p $(OBJDIR))

View file

@ -34,8 +34,8 @@ include $(top_srcdir)/cpp/build/support.mk
#if we are on a Mac, add these flags and libs to the compile and link phases
ifeq ($(UNAME),Darwin)
CFLAGS += -DDARWIN -arch i386 -arch x86_64
LDFLAGS += -arch i386 -arch x86_64
CFLAGS += -DDARWIN
ARCH += -arch i386 -arch x86_64
endif
# Dup from main makefile, but that is not included when building here..
@ -49,7 +49,7 @@ endif
$(OBJDIR)/MinOZW: $(patsubst %.cpp,$(OBJDIR)/%.o,$(minozwsrc))
@echo "Linking $(OBJDIR)/MinOZW"
$(LD) $(LDFLAGS) -o $@ $< $(LIBS) -pthread
$(LD) $(LDFLAGS) $(ARCH) -o $@ $< $(LIBS) -pthread
$(top_builddir)/MinOZW: $(top_srcdir)/cpp/examples/MinOZW/MinOZW.in $(OBJDIR)/MinOZW
@echo "Creating Temporary Shell Launch Script"