Permalink
Browse files

Changes to allow Nu to run with GNUstep-base on Linux.

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...
1 parent 47f6be6 commit 8cd90142144996fcbdabf691bde25cdb2a9b715b Tim Burks committed Dec 14, 2008
View
@@ -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)
@@ -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
View
@@ -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"))
@@ -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"))
@@ -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")
View
Oops, something went wrong.
@@ -1,95 +0,0 @@
-#import <Foundation/Foundation.h>
-#import <Nu/Nu.h>
-
-id baked_bridgesupport() {
- return _nucell(_nusymbol((const char[]){112,114,111,103,110,0}),
-_nucell(_nucell(_nusymbol((const char[]){103,108,111,98,97,108,0}),
-_nucell(_nusymbol((const char[]){66,114,105,100,103,101,83,117,112,112,111,114,116,0}),
-_nucell(_nucell(_nusymbol((const char[]){100,105,99,116,0}),
-_nucell(_nusymbol((const char[]){102,114,97,109,101,119,111,114,107,115,58,0}),
-_nucell(_nucell(_nusymbol((const char[]){100,105,99,116,0}),
-_nunull()),
-_nucell(_nusymbol((const char[]){99,111,110,115,116,97,110,116,115,58,0}),
-_nucell(_nucell(_nusymbol((const char[]){100,105,99,116,0}),
-_nunull()),
-_nucell(_nusymbol((const char[]){101,110,117,109,115,58,0}),
-_nucell(_nucell(_nusymbol((const char[]){100,105,99,116,0}),
-_nunull()),
-_nucell(_nusymbol((const char[]){102,117,110,99,116,105,111,110,115,58,0}),
-_nucell(_nucell(_nusymbol((const char[]){100,105,99,116,0}),
-_nunull()),
-_nunull()))))))))),
-_nunull()))),
-_nucell(_nucell(_nusymbol((const char[]){103,108,111,98,97,108,0}),
-_nucell(_nusymbol((const char[]){105,109,112,111,114,116,0}),
-_nucell(_nucell(_nusymbol((const char[]){109,97,99,114,111,0}),
-_nucell(_nusymbol((const char[]){95,0}),
-_nucell(_nucell(_nusymbol((const char[]){78,117,66,114,105,100,103,101,83,117,112,112,111,114,116,0}),
-_nucell(_nusymbol((const char[]){105,109,112,111,114,116,70,114,97,109,101,119,111,114,107,58,0}),
-_nucell(_nucell(_nucell(_nusymbol((const char[]){109,97,114,103,115,0}),
-_nucell(_nusymbol((const char[]){99,97,114,0}),
-_nunull())),
-_nucell(_nusymbol((const char[]){115,116,114,105,110,103,86,97,108,117,101,0}),
-_nunull())),
-_nucell(_nusymbol((const char[]){102,114,111,109,80,97,116,104,58,0}),
-_nucell(_nucell(_nusymbol((const char[]){105,102,0}),
-_nucell(_nucell(_nusymbol((const char[]){109,97,114,103,115,0}),
-_nucell(_nusymbol((const char[]){99,100,114,0}),
-_nunull())),
-_nucell(_nucell(_nusymbol((const char[]){116,104,101,110,0}),
-_nucell(_nucell(_nusymbol((const char[]){101,118,97,108,0}),
-_nucell(_nucell(_nucell(_nusymbol((const char[]){109,97,114,103,115,0}),
-_nucell(_nusymbol((const char[]){99,100,114,0}),
-_nunull())),
-_nucell(_nusymbol((const char[]){99,97,114,0}),
-_nunull())),
-_nunull())),
-_nunull())),
-_nucell(_nucell(_nusymbol((const char[]){101,108,115,101,0}),
-_nucell(_nusymbol((const char[]){110,105,108,0}),
-_nunull())),
-_nunull())))),
-_nucell(_nusymbol((const char[]){105,110,116,111,68,105,99,116,105,111,110,97,114,121,58,0}),
-_nucell(_nusymbol((const char[]){66,114,105,100,103,101,83,117,112,112,111,114,116,0}),
-_nunull()))))))),
-_nunull()))),
-_nunull()))),
-_nucell(_nucell(_nusymbol((const char[]){103,108,111,98,97,108,0}),
-_nucell(_nusymbol((const char[]){105,109,112,111,114,116,45,115,121,115,116,101,109,0}),
-_nucell(_nucell(_nusymbol((const char[]){109,97,99,114,111,0}),
-_nucell(_nusymbol((const char[]){95,0}),
-_nucell(_nucell(_nucell(_nucell(_nusymbol((const char[]){78,83,83,116,114,105,110,103,0}),
-_nucell(_nusymbol((const char[]){115,116,114,105,110,103,87,105,116,104,83,104,101,108,108,67,111,109,109,97,110,100,58,0}),
-_nucell(_nustring((const char[]){108,115,32,47,83,121,115,116,101,109,47,76,105,98,114,97,114,121,47,70,114,97,109,101,119,111,114,107,115,0}),
-_nunull()))),
-_nucell(_nusymbol((const char[]){108,105,110,101,115,0}),
-_nunull())),
-_nucell(_nusymbol((const char[]){101,97,99,104,58,0}),
-_nucell(_nucell(_nusymbol((const char[]){100,111,0}),
-_nucell(_nucell(_nusymbol((const char[]){108,105,110,101,0}),
-_nunull()),
-_nucell(_nucell(_nusymbol((const char[]){115,101,116,0}),
-_nucell(_nusymbol((const char[]){110,97,109,101,0}),
-_nucell(_nucell(_nucell(_nusymbol((const char[]){108,105,110,101,0}),
-_nucell(_nusymbol((const char[]){99,111,109,112,111,110,101,110,116,115,83,101,112,97,114,97,116,101,100,66,121,83,116,114,105,110,103,58,0}),
-_nucell(_nustring((const char[]){46,0}),
-_nunull()))),
-_nucell(_nunumberd(0),
-_nunull())),
-_nunull()))),
-_nucell(_nucell(_nusymbol((const char[]){101,118,97,108,0}),
-_nucell(_nucell(_nusymbol((const char[]){99,111,110,115,0}),
-_nucell(_nucell(_nusymbol((const char[]){113,117,111,116,101,0}),
-_nucell(_nusymbol((const char[]){105,109,112,111,114,116,0}),
-_nunull())),
-_nucell(_nucell(_nusymbol((const char[]){108,105,115,116,0}),
-_nucell(_nusymbol((const char[]){110,97,109,101,0}),
-_nunull())),
-_nunull()))),
-_nunull())),
-_nunull())))),
-_nunull()))),
-_nunull()))),
-_nunull()))),
-_nunull()))));
-}
Oops, something went wrong.

0 comments on commit 8cd9014

Please sign in to comment.