Skip to content

Commit

Permalink
Changes to allow Nu to run with GNUstep-base on Linux.
Browse files Browse the repository at this point in the history
Tested on Debian "Etch" running under VMware.

NuFound (aka libFoundation) support is now dropped,
since GNUstep is actively-maintained and contains
important features missing in libFoundation, notably
UTF-8 support.

Because the Linux build is running on the GNU
Objective-C runtime, the "throw" operator is not
available, and because the Nu "match" operator
is currently a heavy user of "throw", use of
the "match" operator should be avoided on Linux.
  • Loading branch information
Tim Burks committed Dec 14, 2008
1 parent 47f6be6 commit 8cd9014
Show file tree
Hide file tree
Showing 32 changed files with 101 additions and 9,518 deletions.
8 changes: 4 additions & 4 deletions Makefile
Expand Up @@ -39,10 +39,10 @@ ifeq ($(SYSTEM), Darwin)
LIBDIRS += -L$(PREFIX)/lib
endif
else
INCLUDES += -I/usr/local/include
INCLUDES += -I/usr/include/GNUstep/Headers
FRAMEWORKS =
LIBS = -lm -lpcre -lreadline
LIBDIRS =
LIBS = -lm -lpcre -lreadline -lgnustep-base
LIBDIRS += -L/usr/lib/GNUstep/System/Library/Libraries
endif

C_FILES = $(wildcard objc/*.c)
Expand All @@ -67,7 +67,7 @@ LDFLAGS += $(LIBDIRS)
LDFLAGS += $(FFI_LIB)

ifeq ($(SYSTEM), Linux)
LDFLAGS += -lobjc -lNuFound
LDFLAGS += -lobjc
LDFLAGS += -Wl,--rpath -Wl,/usr/local/lib
endif

Expand Down
15 changes: 9 additions & 6 deletions Nukefile
Expand Up @@ -39,15 +39,17 @@ END)
(set @libs '("edit" "ffi" ))
(set @lib_dirs (NSMutableArray arrayWithObject:"/usr/lib")))
(else (set @frameworks nil)
(set @libs (list "readline" "ffi" "m" ))
(set @lib_dirs (NSMutableArray arrayWithList:(list "../lib")))))
(set @libs (list "readline" "ffi" "m" "gnustep-base" ))
(set @lib_dirs (NSMutableArray arrayWithList:(list "/usr/lib/GNUstep/System/Library/Libraries")))))

(if (NSFileManager directoryExistsNamed:"#{@prefix}/lib") (@lib_dirs addObject:"#{@prefix}/lib"))

;; includes
(ifDarwin
(then (set @includes " -I ./include -I ./include/Nu "))
(else (set @includes " -I ./include -I ./include/Nu -I /usr/local/include")))
(else (set @includes " -I ./include -I ./include/Nu -I /usr/local/include -I /usr/include/GNUstep/Headers")))

;; cc main.m -fobjc-exceptions -fconstant-string-class=NSConstantString -L/usr/local/lib -lobjc -Wl,--rpath -Wl,/usr/local/lib -I /usr/include/GNUstep/Headers -L/usr/lib/GNUstep/System/Library/Libraries/ -lgnustep-base

(if (NSFileManager directoryExistsNamed:"#{@prefix}/include") (@includes appendString:" -I #{@prefix}/include"))

Expand Down Expand Up @@ -106,7 +108,7 @@ END)
join)))
(else (set @ldflags
((list
"-lNuFound -L/usr/local/lib -lobjc -Wl,--rpath -Wl,/usr/local/lib"
"-lgnustep-base -L /usr/lib/GNUstep/System/Library/Libraries -L/usr/local/lib -lobjc -Wl,--rpath -Wl,/usr/lib/GNUstep/System/Library/Libraries -Wl,--rpath -Wl,/usr/local/lib"
(cond ;; statically link in pcre since most people won't have it..
((NSFileManager fileExistsNamed:"/usr/lib/libpcre.a") "/usr/lib/libpcre.a")
((NSFileManager fileExistsNamed:"#{@prefix}/lib/libpcre.a") ("#{@prefix}/lib/libpcre.a"))
Expand Down Expand Up @@ -185,8 +187,9 @@ END)
;; install the dynamic library
(SH "sudo cp #{@library_executable_name} #{@installprefix}/lib")
;; copy the headers
(SH "sudo rm -rf /usr/local/include/Nu")
(SH "sudo cp -rp include/Nu /usr/local/include"))
(SH "sudo rm -rf #{@installprefix}/include/Nu")
(SH "sudo cp -rp include/Nu #{@installprefix}/include")
(SH "sudo cp -rp nu/ #{@installprefix}/share/libNu"))
(SH "sudo mkdir -p #{@installprefix}/share")
(SH "sudo rm -rf #{@installprefix}/share/nu")
(SH "sudo cp -rp share/nu #{@installprefix}/share/nu")
Expand Down
513 changes: 0 additions & 513 deletions baked/baked_beautify.m

This file was deleted.

95 changes: 0 additions & 95 deletions baked/baked_bridgesupport.m

This file was deleted.

0 comments on commit 8cd9014

Please sign in to comment.