Enabling 64-bit is not sufficient, as far as I remember, it has to be
the ONLY architecture for MacRuby in the moment! But it should be no
problem to set the debug build to 64-bit only. Hey, that's the
future! ;-)

I believe (that's the status of 2 weeks ago, when I switched to SL),
that Macruby 0.5 is running on 10.5, the only restriction is, that you
must have a Core Duo processor.

Anyway, after setting the GitXTexting.framework to 64-bit, compiling
it and running the test with "macruby index.rb", I am getting a
"...framework cannot be loaded: Error Domain=NSCocoaErrorDomain
Code=3588..." error.

First I didn't understand, but then I tried to remove the "-undefined
dynamic_lookup" from the linker settings and voila:

PBGitCommit and PBGitGrapher are unresolved! I put them in the "-DCLI
mode" and now the framework is loading. The 64-bit dynamic code loader
seems to be more restrictive.

Please put the tmp dir in test to .gitignore!

########

Here are my patches:

>From b155b732bfb97e0a7a684d240387e1dee7d17bc2 Mon Sep 17 00:00:00 2001
From: Bernd Ohr <[email protected]>
Date: Fri, 2 Oct 2009 10:56:29 +0200
Subject: [PATCH 1/3] archs in libgit2

---
 GitX.xcodeproj/project.pbxproj |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/GitX.xcodeproj/project.pbxproj b/GitX.xcodeproj/
project.pbxproj
index 8f8f62c..240389d 100644
--- a/GitX.xcodeproj/project.pbxproj
+++ b/GitX.xcodeproj/project.pbxproj
@@ -864,7 +864,7 @@
                        );
                        runOnlyForDeploymentPostprocessing = 0;
                        shellPath = /bin/sh;
-                       shellScript = "export 
PATH=$PATH:$HOME/bin:$HOME/local/bin:/sw/
bin:/opt/local/bin:`\"$TARGET_BUILD_DIR\"/gitx --git-path`\ngit
submodule init\ngit submodule update\ncd libgit2\nrm -f libgit2.a
\nmake CFLAGS=\"-arch i386 -arch ppc\"\nranlib libgit2.a";
+                       shellScript = "export 
PATH=$PATH:$HOME/bin:$HOME/local/bin:/sw/
bin:/opt/local/bin:`\"$TARGET_BUILD_DIR\"/gitx --git-path`\ngit
submodule init\ngit submodule update\ncd libgit2\nARCHS=\"\"\nfor a in
`echo $VALID_ARCHS`; do ARCHS=\"$ARCHS -arch $a\"; done\nARCHSFILE=
\"archs\"\ntouch $ARCHSFILE\nOLDARCHS=`cat $ARCHSFILE`\nif
[ \"$OLDARCHS\" != \"$ARCHS\" ]; then\n make clean\nfi\necho \"$ARCHS
\" > $ARCHSFILE\n\nrm -f libgit2.a\nmake CFLAGS=\"$ARCHS\"\nranlib
libgit2.a";
                };
                F5CF04A20EAE696C00D75C81 /* Copy HTML files */ = {
                        isa = PBXShellScriptBuildPhase;
--
1.6.4.3



>From ccf77225f483c55aa6db7e9d3339da04d5bfe280 Mon Sep 17 00:00:00 2001
From: Bernd Ohr <[email protected]>
Date: Fri, 2 Oct 2009 11:02:14 +0200
Subject: [PATCH 2/3] set to 64bit only

---
 GitX.xcodeproj/project.pbxproj |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/GitX.xcodeproj/project.pbxproj b/GitX.xcodeproj/
project.pbxproj
index 240389d..3a4d374 100644
--- a/GitX.xcodeproj/project.pbxproj
+++ b/GitX.xcodeproj/project.pbxproj
@@ -1064,6 +1064,7 @@
                                INSTALL_PATH = "$(HOME)/Applications";
                                LIBRARY_SEARCH_PATHS = libgit2;
                                PRODUCT_NAME = GitX;
+                               VALID_ARCHS = x86_64;
                                WRAPPER_EXTENSION = app;
                                ZERO_LINK = YES;
                        };
@@ -1097,6 +1098,7 @@
                26FC0A890875C7B200E6366F /* Debug */ = {
                        isa = XCBuildConfiguration;
                        buildSettings = {
+                               ARCHS = "$(ARCHS_STANDARD_64_BIT)";
                                GCC_ENABLE_OBJC_GC = required;
                                
GCC_PREPROCESSOR_DEFINITIONS_NOT_USED_IN_PRECOMPS = DEBUG_BUILD;
                                GCC_WARN_ABOUT_RETURN_TYPE = YES;
@@ -1225,6 +1227,7 @@
                                );
                                PREBINDING = NO;
                                PRODUCT_NAME = GitXTesting;
+                               VALID_ARCHS = x86_64;
                        };
                        name = Debug;
                };
--
1.6.4.3



>From ae36f5de6e8e4821c3a3476059088d0d0579ea60 Mon Sep 17 00:00:00 2001
From: Bernd Ohr <[email protected]>
Date: Fri, 2 Oct 2009 14:02:36 +0200
Subject: [PATCH 3/3] linker: no undefined symbols

---
 GitX.xcodeproj/project.pbxproj |    2 --
 PBGitRevList.mm                |   13 ++++++++++++-
 2 files changed, 12 insertions(+), 3 deletions(-)

diff --git a/GitX.xcodeproj/project.pbxproj b/GitX.xcodeproj/
project.pbxproj
index 3a4d374..275ed3e 100644
--- a/GitX.xcodeproj/project.pbxproj
+++ b/GitX.xcodeproj/project.pbxproj
@@ -1218,8 +1218,6 @@
                                );
                                OTHER_CFLAGS = "-DCLI";
                                OTHER_LDFLAGS = (
-                                       "-undefined",
-                                       dynamic_lookup,
                                        "-framework",
                                        Foundation,
                                        "-framework",
diff --git a/PBGitRevList.mm b/PBGitRevList.mm
index ca3704f..20575d5 100644
--- a/PBGitRevList.mm
+++ b/PBGitRevList.mm
@@ -71,7 +71,11 @@ - (void) walkRevisionListWithSpecifier:
(PBGitRevSpecifier*) rev
 {
        NSDate *start = [NSDate date];
        NSMutableArray* revisions = [NSMutableArray array];
+#ifndef CLI
        PBGitGrapher* g = [[PBGitGrapher alloc] initWithRepository:
repository];
+#else
+       PBGitGrapher* g = NULL;
+#endif
        std::map<string, NSStringEncoding> encodingMap;

        NSString *formatString = @"--pretty=format:%H\01%e\01%an\01%s\01%P
\01%at";
@@ -109,7 +113,11 @@ - (void) walkRevisionListWithSpecifier:
(PBGitRevSpecifier*) rev
                {
                        num = 0;
                        [self performSelectorOnMainThread:@selector(setCommits:)
withObject:revisions waitUntilDone:NO];
+#ifndef CLI
                        g = [[PBGitGrapher alloc] initWithRepository: 
repository];
+#else
+                       g = NULL;
+#endif
                        revisions = [NSMutableArray array];

                        // If the length is < 40, then there are no commits.. 
quit now
@@ -135,8 +143,11 @@ - (void) walkRevisionListWithSpecifier:
(PBGitRevSpecifier*) rev

                git_oid oid;
                git_oid_mkstr(&oid, sha.c_str());
+#ifndef CLI
                PBGitCommit* newCommit = [[PBGitCommit alloc]
initWithRepository:repository andSha:oid];
-
+#else
+               PBGitCommit* newCommit = NULL;
+#endif
                string author;
                getline(stream, author, '\1');

--
1.6.4.3



Reply via email to