Skip to content

Commit

Permalink
Fixed Darwin build.
Browse files Browse the repository at this point in the history
  • Loading branch information
timburks committed May 16, 2013
1 parent 41b6573 commit 4b67651
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 9 deletions.
11 changes: 8 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,13 @@ INCLUDES = $(FFI_INCLUDE) -I./include
ifeq ($(shell test -d $(PREFIX)/include && echo yes), yes)
INCLUDES += -I$(PREFIX)/include
endif
# FRAMEWORKS = -framework Cocoa

ifeq ($(SYSTEM), Darwin)
FRAMEWORKS = -framework Cocoa
endif

LIBS = -lobjc -lreadline

ifeq ($(shell test -d $(PREFIX)/lib && echo yes), yes)
LIBDIRS += -L$(PREFIX)/lib
endif
Expand Down Expand Up @@ -78,9 +83,9 @@ ifeq ($(SYSTEM), SunOS)
endif

LDFLAGS =
#LDFLAGS += $(FRAMEWORKS)
LDFLAGS += $(FRAMEWORKS)
LDFLAGS += $(LIBS)
#LDFLAGS += $(LIBDIRS)
LDFLAGS += $(LIBDIRS)
LDFLAGS += $(FFI_LIB)
ifeq ($(SYSTEM), Darwin)
else
Expand Down
1 change: 1 addition & 0 deletions Nukefile
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,7 @@ END)
(set @public_headers (filelist "^objc/.*\.h$")))

;; REVIEW
(ifDarwin (then (set @cflags (+ @cflags " -DDARWIN"))))
(ifLinux (then (set @cflags (+ @cflags
" -DDEBUG"
" -DGNU_GUI_LIBRARY=1"
Expand Down
14 changes: 11 additions & 3 deletions objc/Nu.m
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,12 @@
#if TARGET_OS_IPHONE
#import "ffi.h"
#else
#ifdef DARWIN
#import <ffi/ffi.h>
#else
#import <x86_64-linux-gnu/ffi.h>
#endif
#endif

#import <dlfcn.h>

Expand Down Expand Up @@ -420,7 +424,9 @@ void NuInit()
[Nu loadNuFile:@"bridgesupport" fromBundleWithIdentifier:@"nu.programming.framework" withContext:nil];
[Nu loadNuFile:@"cocoa" fromBundleWithIdentifier:@"nu.programming.framework" withContext:nil];
[Nu loadNuFile:@"help" fromBundleWithIdentifier:@"nu.programming.framework" withContext:nil];
#ifdef LINUX
loadNuLibraryFile(@"nu", parser, [parser context], [parser symbolTable]);
#endif
#endif
}
}
Expand Down Expand Up @@ -5228,9 +5234,11 @@ static IMP handler_returning_void(void *userdata) {
MAKE_HANDLER_WITH_TYPE(bool)
MAKE_HANDLER_WITH_TYPE(float)
MAKE_HANDLER_WITH_TYPE(double)
// MAKE_HANDLER_WITH_TYPE(CGRect)
// MAKE_HANDLER_WITH_TYPE(CGPoint)
// MAKE_HANDLER_WITH_TYPE(CGSize)
#ifndef LINUX
MAKE_HANDLER_WITH_TYPE(CGRect)
MAKE_HANDLER_WITH_TYPE(CGPoint)
MAKE_HANDLER_WITH_TYPE(CGSize)
#endif
#if !TARGET_OS_IPHONE
MAKE_HANDLER_WITH_TYPE(NSRect)
MAKE_HANDLER_WITH_TYPE(NSPoint)
Expand Down
2 changes: 1 addition & 1 deletion test/test_array.nu
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@
(set sorted (array sortedArrayUsingBlock:(do (a b) ((a length) compare:(b length)))))
(assert_equal '("ed" "tim" "mary" "brian" "jennifer" "christopher") (sorted list)))

(- xtestSortedArrayUsingSelector is
(- testSortedArrayUsingSelector is
;; I don't like this, but want to be sure we bridge the right
;; return type for the comparison method. On Snow Leopard (at
;; least), NSInteger is either int or long depending on the
Expand Down
2 changes: 0 additions & 2 deletions test/test_bridge.nu
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
;; tests for the Nu bridge to Objective-C.
;;
;; Copyright (c) 2007 Tim Burks, Radtastical Inc.
(if NO
(class TestBridge is NuTestCase
(- (id) testConstants is
(if (eq (uname) "Darwin")
Expand Down Expand Up @@ -43,4 +42,3 @@
(assert_equal 0 (num-array indexOfObjectPassingTest:equals-num?))
(set num 2)
(assert_equal 1 (num-array indexOfObjectPassingTest:equals-num?)))))
)

0 comments on commit 4b67651

Please sign in to comment.