adium 2861:60a00a4afae1: Remove the rtool symlink.
commits at adium.im
commits at adium.im
Thu Nov 5 02:20:00 UTC 2009
details: http://hg.adium.im/adium/rev/60a00a4afae1
revision: 2861:60a00a4afae1
author: Stephen Holt <sholt at adium.im>
date: Wed Nov 04 21:19:46 2009 -0500
Remove the rtool symlink.
Subject: adium 2862:4f3a56408174: Add the rtool dir, salvaged from dep-build-scripts
details: http://hg.adium.im/adium/rev/4f3a56408174
revision: 2862:4f3a56408174
author: Stephen Holt <sholt at adium.im>
date: Wed Nov 04 21:19:47 2009 -0500
Add the rtool dir, salvaged from dep-build-scripts
diffs (truncated from 1665 to 1000 lines):
diff -r 97914358ab30 -r 4f3a56408174 Dependencies/rtool
--- a/Dependencies/rtool Wed Nov 04 18:44:38 2009 -0600
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,1 +0,0 @@
-../Utilities/dep-build-scripts/rtool
\ No newline at end of file
diff -r 97914358ab30 -r 4f3a56408174 Dependencies/rtool/Makefile
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/Dependencies/rtool/Makefile Wed Nov 04 21:19:47 2009 -0500
@@ -0,0 +1,41 @@
+# $rtool: Makefile,v 1.01 2007/11/28 23:25:01 mmw Exp $
+
+PREFIX = /usr/local
+MANDIR = $(PREFIX)/share/man/man1
+
+RM = rm -f
+INSTALL_PROG = install -m 755
+INSTALL_MAN = install -m 644
+
+DISTFILES = Makefile ReadMe Resources Version.plist rtool rtool.1
+TAR = tar
+GZIP = gzip
+PACKAGE = rtool
+SRCVERSION = 1.2.5
+
+EXE = rtool
+MAN = rtool.1
+
+install : $(EXE)
+ $(INSTALL_PROG) $(EXE) $(PREFIX)/bin
+ $(INSTALL_MAN) $(MAN) $(MANDIR)
+
+uninstall :
+ $(RM) $(PREFIX)/bin/$(EXE)
+ $(RM) $(MANDIR)/$(MAN)
+
+dist: ${DISTFILES}
+ @rm -f `find . -name '.DS_Store'`
+ rm -f `find . -name '._*'`
+ @rm -f `find . -name '.gdb_history'`
+ @mkdir -p $(PACKAGE)-$(SRCVERSION)
+ @$(TAR) --exclude=.svn -cvf $(PACKAGE)-$(SRCVERSION).tar ${DISTFILES}
+ cd $(PACKAGE)-$(SRCVERSION) && $(TAR) --exclude=.svn -xf ../$(PACKAGE)-$(SRCVERSION).tar && cd ..
+ @rm $(PACKAGE)-$(SRCVERSION).tar
+ @$(TAR) --exclude=.svn -cvf $(PACKAGE)-$(SRCVERSION).tar $(PACKAGE)-$(SRCVERSION)
+ @rm -rf $(PACKAGE)-$(SRCVERSION)
+ @$(GZIP) -9 $(PACKAGE)-$(SRCVERSION).tar
+ @openssl sha1 $(PACKAGE)-$(SRCVERSION).tar.gz > $(PACKAGE)-$(SRCVERSION).sha1
+
+
+# EOF
\ No newline at end of file
diff -r 97914358ab30 -r 4f3a56408174 Dependencies/rtool/ReadMe
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/Dependencies/rtool/ReadMe Wed Nov 04 21:19:47 2009 -0500
@@ -0,0 +1,54 @@
+Copyright (c) 2007 The GNU-Darwin Team, plumber <OpenSpecies at gnu-darwin.org>
+
+Permission to use, copy, modify, and distribute this software for any
+purpose with or without fee is hereby granted, provided that the above
+copyright notice and this permission notice appear in all copies.
+
+THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+
+*About rtool script*
+
+rtool helps to relocate a library as a NeXT/ GNUStep/ Apple Mac OS X
+Framework bundle. rtool is an "Automator" to relocate a library into a
+bundle without rebuilding it (including options for other linked Libraries
+and linked Executables).
+
+*What means rtool ?* Do Not Touch your Makefile or build scripts.
+
+ * Relocate libFoo.dylib to Foo.framework ?
+ * Relocate libFoo.dylib to Foo.framework and its dependencies ?
+ * Relocate libFoo.dylib to Foo.framework with a relative path ?
+ * Building My Bundle.app with included Frameworks ?
+
+ * My libFoo.dylib uses a static sharedir ?
+ sharedir to Resources dir (relative path, identifier, CoreFoundation)
+ - Resources/Examples/share
+ - Resources/Examples/rpath
+ - Resources/DawinBox
+ Hacking quickly the libFoo source, build and relocate it after.
+
+Apple Framework Programming Guide
+<http://developer.apple.com/documentation/MacOSX/Conceptual/BPFrameworks/index.html>
+
+*Anatomy of a Modern Bundle*
+
+The basic structure of a modern bundle is very simple. At the top-level
+of the bundle there is a directory named Contents. This directory
+contains everything, including the resources, executable code, private
+frameworks, private plug-ins, and support files needed by the
+application or plug-in. While the Contents directory might seem
+superfluous, it identifies the bundle as a modern-style bundle and
+separates it from document and legacy bundle types.
+
+-Apple Computer, Inc.
+
+Apple Bundle Programming Guide
+<http://developer.apple.com/documentation/CoreFoundation/Conceptual/CFBundles/Concepts/BundleAnatomy.html>
+
+# EOF
\ No newline at end of file
diff -r 97914358ab30 -r 4f3a56408174 Dependencies/rtool/Resources/DawinBox/DX.h
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/Dependencies/rtool/Resources/DawinBox/DX.h Wed Nov 04 21:19:47 2009 -0500
@@ -0,0 +1,95 @@
+/*
+ * Copyright (c) 2007 plumber <OpenSpecies at gnu-darwin.org>
+ *
+ * Permission to use, copy, modify, and distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ */
+
+/*
+ * DX.h
+ * rtool DarwinBox
+ *
+ * Created by plumber on 07/05/26.
+ * Copyright 2007 OpenSpecies. All rights reserved.
+ *
+ */
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include <sys/param.h>
+#include <mach-o/dyld.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include <CoreFoundation/CoreFoundation.h>
+
+/* BSD types compatibility */
+#ifdef __bsdcomp
+typedef unsigned char u_char;
+typedef unsigned short u_short;
+typedef unsigned int u_int;
+typedef unsigned long u_long;
+#endif
+
+/* SYSV / SVR4 types compatibility */
+#ifdef __sysvcomp
+typedef unsigned char unchar;
+typedef unsigned short ushort;
+typedef unsigned int uint;
+typedef unsigned long ulong;
+#endif
+
+#define DXEXPORT extern
+
+#define DXALLOCATE(P,S)\
+({ \
+ P = malloc((size_t)S); \
+})
+
+#define DXRELEASE(P) \
+({ \
+ if(P && *P) { free(P); } \
+})
+
+#define DXSTREQ(s1,s2) (strcmp((s1),(s2)) == 0)
+
+#define DXSTRCOPY(P,V) \
+({ \
+ P = strdup(V); \
+})
+
+#define DXCFSTR(P,E) \
+({ \
+ CFStringRef r = NULL; \
+ r = CFStringCreateWithCStringNoCopy(NULL, P, E, NULL); \
+})
+
+#define DXTOSTRING(X) #X
+
+#define DXDUMP(X,F) \
+({ \
+ printf("-- DXDUMP { File : %s (%u) %s = " F " } \n", __FILE__, __LINE__, #X, X); \
+})
+
+DXEXPORT char *DXGetExecutablePath(void);
+DXEXPORT char *DXGetString(CFStringRef r);
+DXEXPORT char *DXGetStringWithEncoding(CFStringRef r,CFStringEncoding E);
+DXEXPORT char *DXGetMainBundlePath(void);
+DXEXPORT char *DXGetBundlePathWithIdentifier(const void *SID);
+DXEXPORT char *DXGetMainBundleResourcesPath(void);
+DXEXPORT char *DXGetBundleResourcesPathWithIdentifier(const void *SID);
+
+#ifdef __cplusplus
+}
+#endif
\ No newline at end of file
diff -r 97914358ab30 -r 4f3a56408174 Dependencies/rtool/Resources/DawinBox/DXFunction.c
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/Dependencies/rtool/Resources/DawinBox/DXFunction.c Wed Nov 04 21:19:47 2009 -0500
@@ -0,0 +1,181 @@
+/*
+ * Copyright (c) 2007 plumber <OpenSpecies at gnu-darwin.org>
+ *
+ * Permission to use, copy, modify, and distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ */
+
+/*
+ * DXFunction.c
+ * rtool DarwinBox
+ *
+ * Created by plumber on 07/05/26.
+ * Copyright 2007 OpenSpecies. All rights reserved.
+ *
+ */
+
+#include "DX.h"
+
+/*
+* DXGetExecutablePath(void)
+*/
+char *DXGetExecutablePath(void)
+{
+ char *P;
+ char *x;
+ int res;
+ uint32_t l;
+
+ l = MAXPATHLEN *2;
+ DXALLOCATE(x, l);
+ res = _NSGetExecutablePath(x, &l);
+#if 0
+ DXRELEASE(x);
+#endif
+ P = (char *)dirname((const char *)x);
+
+ return P;
+}
+
+/*
+* private __DXGetAnyString(CFStringRef r, CFStringEncoding E)
+* /System/Library/Frameworks/CoreFoundation.framework/Versions/A/Headers/CFStringEncodingExt.h
+*/
+static char *__DXGetAnyString(CFStringRef r, CFStringEncoding E)
+{
+ char *P;
+ CFIndex l = 0;
+ char *S = NULL;
+
+ if (NULL != r) {
+ l = CFStringGetMaximumSizeForEncoding(CFStringGetLength(r), E) + 1;
+ DXALLOCATE(S , l);
+ CFStringGetCString(r, S, l, E);
+#if 0
+ DXRELEASE(S);
+#endif
+ }
+ P = S;
+
+ return P;
+}
+
+/*
+* DXGetString(CFStringRef r)
+*/
+char *DXGetString(CFStringRef r)
+{
+ char *P;
+ P = __DXGetAnyString(r, kCFStringEncodingUTF8);
+
+ return P;
+}
+
+/*
+* DXGetStringWithEncoding(CFStringRef r, CFStringEncoding E)
+*/
+char *DXGetStringWithEncoding(CFStringRef r, CFStringEncoding E)
+{
+ char *P;
+ P = __DXGetAnyString(r, E);
+
+ return P;
+}
+
+/*
+* private __DXGetBundlePath(CFStringRef ID)
+*/
+static char *__DXGetBundlePath(CFStringRef ID)
+{
+ char *P;
+ CFBundleRef b;
+ CFURLRef u;
+ CFStringRef r = NULL;
+
+ if (NULL != ID)
+ b = CFBundleGetBundleWithIdentifier(ID);
+ else {
+ b = CFBundleGetMainBundle();
+ }
+ if(b) {
+ u = CFBundleCopyBundleURL(b);
+ r = CFURLCopyFileSystemPath(u, kCFURLPOSIXPathStyle);
+ if (u) { CFRelease(u); }
+ }
+ P = ( NULL != r) ? DXGetString(r) : NULL;
+
+ return P;
+}
+
+/*
+* private __DXGetAnyBundleResourcesPath(CFStringRef ID)
+*/
+static char *__DXGetAnyBundleResourcesPath(CFStringRef ID)
+{
+ char *P;
+ char *S;
+ char x[MAXPATHLEN *2];
+ if (NULL != ID) {
+ if( NULL != (S = __DXGetBundlePath(ID)) )
+ sprintf(x, "%s/%s", S, "Resources");
+ } else {
+ if( (NULL != (S = __DXGetBundlePath(NULL))) )
+ sprintf(x, "%s/%s/%s", S, "Contents", "Resources");
+ }
+ P = strlen(x) > 0 && S ? strdup(x) : NULL;
+
+ return P;
+}
+
+/*
+* DXGetMainBundlePath(void)
+*/
+char *DXGetMainBundlePath(void)
+{
+ char *P;
+ P = __DXGetBundlePath(NULL);
+
+ return P;
+}
+
+/*
+* DXGetBundlePathWithIdentifier(const void *SID)
+*/
+char *DXGetBundlePathWithIdentifier(const void *SID)
+{
+ char *P;
+ P = __DXGetBundlePath(DXCFSTR(SID, kCFStringEncodingASCII));
+
+ return P;
+}
+
+/*
+* DXGetMainBundleResourcesPath(void)
+*/
+char *DXGetMainBundleResourcesPath(void)
+{
+ char *P;
+ P = __DXGetAnyBundleResourcesPath(NULL);
+
+ return P;
+}
+
+/*
+* DXGetMainBundleResourcesPath(const void *SID)
+*/
+char *DXGetBundleResourcesPathWithIdentifier(const void *SID)
+{
+ char *P;
+ P = __DXGetAnyBundleResourcesPath(DXCFSTR(SID, kCFStringEncodingASCII));
+
+ return P;
+}
diff -r 97914358ab30 -r 4f3a56408174 Dependencies/rtool/Resources/DawinBox/DXMacros.h
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/Dependencies/rtool/Resources/DawinBox/DXMacros.h Wed Nov 04 21:19:47 2009 -0500
@@ -0,0 +1,167 @@
+/*
+ * Copyright (c) 2007 plumber <OpenSpecies at gnu-darwin.org>
+ *
+ * Permission to use, copy, modify, and distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ */
+
+/*
+ * DXMacros.h
+ * rtool DarwinBox
+ *
+ * Created by plumber on 07/05/07.
+ * Copyright 2007 OpenSpecies. All rights reserved.
+ *
+ */
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/*
+* DXGetExecutablePath(void)
+*/
+#define DXGetExecutablePath(void) \
+({ \
+ char *P; \
+ char *x; \
+ int res; \
+ uint32_t l; \
+ \
+ l = MAXPATHLEN *2; \
+ DXALLOCATE(x, l); \
+ res = _NSGetExecutablePath(x, &l); \
+#if 0
+ DXRELEASE(x); \
+#endif
+ P = (char *)dirname((const char *)x); \
+})
+
+/*
+* private __DXGetAnyString(CFStringRef r, CFStringEncoding E)
+* /System/Library/Frameworks/CoreFoundation.framework/Versions/A/Headers/CFStringEncodingExt.h
+*/
+#define __DXGetAnyString(r, E) \
+({ \
+ char *P; \
+ CFIndex l = 0; \
+ char *S = NULL; \
+ \
+ if (NULL != r) { \
+ l = CFStringGetMaximumSizeForEncoding(CFStringGetLength(r), E) + 1; \
+ DXALLOCATE(S , l); \
+ CFStringGetCString(r, S, l, E); \
+#if 0
+ DXRELEASE(S); \
+#endif
+ } \
+ P = S; \
+})
+
+/*
+* DXGetString(CFStringRef r)
+*/
+#define DXGetString(r) \
+({ \
+ char *P; \
+ P = __DXGetAnyString(r, kCFStringEncodingUTF8); \
+})
+
+/*
+* DXGetStringWithEncoding(CFStringRef r, CFStringEncoding E)
+*/
+#define DXGetStringWithEncoding(r, E) \
+({ \
+ char *P; \
+ P = __DXGetAnyString(r, E); \
+})
+
+/*
+* private __DXGetBundlePath(CFStringRef ID)
+*/
+#define __DXGetBundlePath(ID) \
+({ \
+ char *P; \
+ CFBundleRef b; \
+ CFURLRef u; \
+ CFStringRef r = NULL; \
+ \
+ if (NULL != ID) \
+ b = CFBundleGetBundleWithIdentifier(ID); \
+ else { \
+ b = CFBundleGetMainBundle(); \
+ } \
+ if(b) { \
+ u = CFBundleCopyBundleURL(b); \
+ r = CFURLCopyFileSystemPath(u, kCFURLPOSIXPathStyle); \
+ if (u) { CFRelease(u); } \
+ } \
+ P = DXGetString(r); \
+})
+
+/*
+* private __DXGetAnyBundleResourcesPath(CFStringRef ID)
+*/
+#define __DXGetAnyBundleResourcesPath(ID) \
+({ \
+ char *P; \
+ char *S; \
+ char x[MAXPATHLEN *2]; \
+ if (NULL != ID) { \
+ if( NULL != (S = __DXGetBundlePath(ID)) ) \
+ sprintf(x, "%s/%s", S, "Resources"); \
+ } else { \
+ if( (NULL != (S = __DXGetBundlePath(NULL))) ) \
+ sprintf(x, "%s/%s/%s", S, "Contents", "Resources"); \
+ } \
+ P = strlen(x) > 0 && S ? strdup(x) : NULL; \
+})
+
+/*
+* DXGetMainBundlePath(void)
+*/
+#define DXGetMainBundlePath(void) \
+({ \
+ char *P; \
+ P = __DXGetBundlePath(NULL); \
+})
+
+/*
+* DXGetBundlePathWithIdentifier(const void *SID)
+*/
+#define DXGetBundlePathWithIdentifier(SID) \
+({ \
+ char *P; \
+ P = __DXGetBundlePath((DXCFSTR(SID, kCFStringEncodingASCII)); \
+})
+
+/*
+* DXGetMainBundleResourcesPath(void)
+*/
+#define DXGetMainBundleResourcesPath(void) \
+({ \
+ char *P; \
+ P = __DXGetAnyBundleResourcesPath(NULL); \
+})
+
+/*
+* DXGetMainBundleResourcesPath(const void *SID)
+*/
+#define DXGetBundleResourcesPathWithIdentifier(SID) \
+({ \
+ char *P; \
+ P = __DXGetAnyBundleResourcesPath(DXCFSTR(SID, kCFStringEncodingASCII)); \
+})
+
+#ifdef __cplusplus
+}
+#endif
\ No newline at end of file
diff -r 97914358ab30 -r 4f3a56408174 Dependencies/rtool/Resources/DawinBox/test.c
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/Dependencies/rtool/Resources/DawinBox/test.c Wed Nov 04 21:19:47 2009 -0500
@@ -0,0 +1,61 @@
+#include <stdio.h>
+#include <strings.h>
+
+#include "DX.h"
+/* #include "DXMacros.h" */
+
+#define kCFMyIdentifier "com.apple.CoreFoundation"
+#define kAKMyIdentifier "com.apple.System"
+
+#include <sys/cdefs.h>
+
+char *__DXSTRCAT(char *__restrict x,const char * __restrict y)
+{
+ char *P = x;
+ for (; *x; ++x);
+ while ((*x++ = *y++) != 0);
+ return P;
+}
+/*
+* int main(int argc, const char * argv[])
+*/
+int main(int argc, const char * argv[])
+{
+ printf("-- DXGetBundlePathWithIdentifier: %s \n",
+ DXGetBundlePathWithIdentifier(kCFMyIdentifier));
+ printf("-- DXGetBundlePathWithIdentifier: %s \n",
+ DXGetBundlePathWithIdentifier("com.apple.AppKit"));
+ printf("-- DXGetBundleResourcesPathWithIdentifier: %s \n",
+ DXGetBundleResourcesPathWithIdentifier(kAKMyIdentifier));
+ printf("-- DXGetBundleResourcesPathWithIdentifier: %s \n",
+ DXGetBundleResourcesPathWithIdentifier("com.apple.CoreFoundation"));
+ printf("-- DXGetMainBundleResourcesPath: %s \n",
+ DXGetMainBundleResourcesPath());
+ printf("-- DXGetExecutablePath: %s \n",
+ DXGetExecutablePath());
+ printf("-- DXGetMainBundlePath: %s \n",
+ DXGetMainBundlePath());
+
+ int foo ;
+
+ DXDUMP((int)foo,"%i");
+
+ DXDUMP(DXGetBundlePathWithIdentifier(kCFMyIdentifier),"%s");
+
+ int * bar;
+
+ DXALLOCATE(bar,100);
+
+ DXDUMP((long *)bar,"%d");
+
+ DXRELEASE(bar);
+
+ char y[255];
+ char *x = "is not bad";
+ strcpy (y,"this ");
+ __DXSTRCAT(y,x);
+
+ puts(y);
+
+ return 0;
+}
\ No newline at end of file
diff -r 97914358ab30 -r 4f3a56408174 Dependencies/rtool/Resources/Examples/dyld/bar.c
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/Dependencies/rtool/Resources/Examples/dyld/bar.c Wed Nov 04 21:19:47 2009 -0500
@@ -0,0 +1,14 @@
+#include <stdio.h>
+#include <stdlib.h>
+
+static trace(const char *call)
+{
+ printf("-- %s --\n", call);
+}
+
+int bar (void) {
+
+ trace("libbar");
+
+ return 0;
+}
\ No newline at end of file
diff -r 97914358ab30 -r 4f3a56408174 Dependencies/rtool/Resources/Examples/dyld/build.sh
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/Dependencies/rtool/Resources/Examples/dyld/build.sh Wed Nov 04 21:19:47 2009 -0500
@@ -0,0 +1,29 @@
+#!/bin/sh
+
+script_path=`dirname "${0}"`
+cd "${script_path}"
+
+echo "-> building libfoo.dylib --"
+gcc -dynamiclib foo.c -install_name "libfoo.dylib" -o libfoo.dylib
+
+echo "-> building bar.dylib --"
+gcc -dynamiclib bar.c -install_name "@executable_path/libbar.dylib" -o libbar.dylib
+
+echo "-> building main --"
+gcc main.c -o main -L. -lfoo -lbar
+
+echo "-> testing binary:: Library not loaded: libfoo.dylib --"
+
+(cd .. && ./dyld/main)
+
+echo ""
+
+echo "-> exporting dyld dir in DYLD_LIBRARY_PATH"
+
+export DYLD_LIBRARY_PATH="dyld:$DYLD_LIBRARY_PATH"
+
+echo "-> testing binary:: loaded libfoo.dylib--"
+
+(cd .. && ./dyld/main)
+
+rm -f main libfoo.dylib libbar.dylib
\ No newline at end of file
diff -r 97914358ab30 -r 4f3a56408174 Dependencies/rtool/Resources/Examples/dyld/foo.c
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/Dependencies/rtool/Resources/Examples/dyld/foo.c Wed Nov 04 21:19:47 2009 -0500
@@ -0,0 +1,14 @@
+#include <stdio.h>
+#include <stdlib.h>
+
+static trace(const char *call)
+{
+ printf("-- %s --\n", call);
+}
+
+int foo (void) {
+
+ trace("libfoo");
+
+ return 0;
+}
\ No newline at end of file
diff -r 97914358ab30 -r 4f3a56408174 Dependencies/rtool/Resources/Examples/dyld/main.c
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/Dependencies/rtool/Resources/Examples/dyld/main.c Wed Nov 04 21:19:47 2009 -0500
@@ -0,0 +1,9 @@
+#include <stdio.h>
+
+int main(int argc, const char * argv[])
+{
+ foo();
+ bar();
+
+ return 0;
+}
\ No newline at end of file
diff -r 97914358ab30 -r 4f3a56408174 Dependencies/rtool/Resources/Examples/relocate/xml2-relocation-deps.sh
Binary file Dependencies/rtool/Resources/Examples/relocate/xml2-relocation-deps.sh has changed
diff -r 97914358ab30 -r 4f3a56408174 Dependencies/rtool/Resources/Examples/relocate/xml2-relocation.sh
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/Dependencies/rtool/Resources/Examples/relocate/xml2-relocation.sh Wed Nov 04 21:19:47 2009 -0500
@@ -0,0 +1,32 @@
+#!/bin/sh
+
+script_path=`dirname "${0}"`
+cd "${script_path}"
+
+mkdir -p build
+ln -sf ../../../rtool rtool_sub
+
+FRAMEWORK_ROOT=@executable_path/../Frameworks
+FRAMEWORK_NAME=xmlLib
+FRAMEWORK_VERSION=A
+
+BUILDDIR=build
+
+LIBRARY="/usr/lib/libxml2.2.dylib"
+BINARIES="/usr/bin/xmlcatalog"
+HEADERS="/usr/include/libxml2/libxml" # a directory to copy or a list of headers
+MANUALS="/usr/share/man/man1/xmlcatalog.1"
+
+sh ./rtool_sub \
+--framework_root=${FRAMEWORK_ROOT} \
+--framework_name=${FRAMEWORK_NAME} \
+--framework_version=${FRAMEWORK_VERSION} \
+--library=${LIBRARY} \
+--builddir=${BUILDDIR} \
+--binaries="${BINARIES}" \
+--headers="${HEADERS}" \
+--manuals="${MANUALS}"
+# --headers_no_root
+
+echo "-- done --"
+rm -f rtool_sub
\ No newline at end of file
diff -r 97914358ab30 -r 4f3a56408174 Dependencies/rtool/Resources/Examples/rpath/A.c
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/Dependencies/rtool/Resources/Examples/rpath/A.c Wed Nov 04 21:19:47 2009 -0500
@@ -0,0 +1,9 @@
+#include <stdio.h>
+
+extern int B(void);
+int A(void);
+
+int A() {
+ puts("-- A() return B()");
+ return B();
+}
\ No newline at end of file
diff -r 97914358ab30 -r 4f3a56408174 Dependencies/rtool/Resources/Examples/rpath/B.c
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/Dependencies/rtool/Resources/Examples/rpath/B.c Wed Nov 04 21:19:47 2009 -0500
@@ -0,0 +1,8 @@
+#include <stdio.h>
+
+int B(void);
+
+int B() {
+ puts("-- B() return 10;");
+ return 10;
+}
\ No newline at end of file
diff -r 97914358ab30 -r 4f3a56408174 Dependencies/rtool/Resources/Examples/rpath/X.c
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/Dependencies/rtool/Resources/Examples/rpath/X.c Wed Nov 04 21:19:47 2009 -0500
@@ -0,0 +1,9 @@
+#include <stdio.h>
+
+extern int A(void);
+
+int main(int argc, const char * argv[])
+{
+ puts("-- main() return A()");
+ return A();
+}
\ No newline at end of file
diff -r 97914358ab30 -r 4f3a56408174 Dependencies/rtool/Resources/Examples/rpath/bar.c
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/Dependencies/rtool/Resources/Examples/rpath/bar.c Wed Nov 04 21:19:47 2009 -0500
@@ -0,0 +1,9 @@
+#include <stdio.h>
+#include <stdlib.h>
+
+int bar (void)
+{
+ printf("-- libbar:bar() --\n");
+ getNSGetExecutablePath((char *)"barLIb");
+ return 0;
+}
\ No newline at end of file
diff -r 97914358ab30 -r 4f3a56408174 Dependencies/rtool/Resources/Examples/rpath/build-umbrella.sh
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/Dependencies/rtool/Resources/Examples/rpath/build-umbrella.sh Wed Nov 04 21:19:47 2009 -0500
@@ -0,0 +1,22 @@
+#!/bin/sh
+
+mkdir -p X.app/Contents/Frameworks
+mkdir -p X.app/Contents/MacOS
+
+echo "-> building libB.dylib --"
+gcc -dynamiclib B.c -install_name "@executable_path/../Frameworks/libB.dylib" -o libB.dylib -framework CoreFoundation
+
+echo "-> building libA.dylib --"
+gcc -dynamiclib A.c -install_name "@executable_path/../Frameworks/libA.dylib" -o libA.dylib ./libB.dylib
+
+echo "-> building X --"
+gcc X.c -o X libA.dylib libB.dylib
+
+mv *.dylib X.app/Contents/Frameworks/
+
+echo "-> executing MacOS/X --"
+mv X X.app/Contents/MacOS/X
+
+./X.app/Contents/MacOS/X
+
+rm -Rf ./X.app
\ No newline at end of file
diff -r 97914358ab30 -r 4f3a56408174 Dependencies/rtool/Resources/Examples/rpath/build.sh
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/Dependencies/rtool/Resources/Examples/rpath/build.sh Wed Nov 04 21:19:47 2009 -0500
@@ -0,0 +1,39 @@
+#!/bin/sh
+
+script_path=`dirname "${0}"`
+cd "${script_path}"
+
+echo "-> building libutil.dylib --"
+gcc -dynamiclib util.c -install_name "@executable_path/libutil.dylib" -o libutil.dylib -framework CoreFoundation
+
+echo "-> building libbar.dylib --"
+gcc -dynamiclib bar.c -install_name "@executable_path/libbar.dylib" -o libbar.dylib -L. -lutil
+
+echo "-> building libfoo.dylib --"
+gcc -dynamiclib foo.c -install_name "@executable_path/libfoo.dylib" -o libfoo.dylib -L. -lbar -lutil
+
+echo "-> building main --"
+gcc main.c -o main -L. -lfoo -lbar -lutil
+
+echo "-> testing binaries --"
+
+bins="main libfoo.dylib libbar.dylib libutil.dylib"
+
+for bin in $bins; do
+
+ echo "## from" $(dirname $bin) "--"
+ echo "###" $(basename $bin)
+ otool -LX $bin | awk '{print $1}'
+ echo ""
+
+done
+
+echo "-> executing main from . --"
+
+./main
+
+echo "-> executing main from $(pwd) --"
+
+$(pwd)/main
+
+rm -f main libfoo.dylib libbar.dylib libutil.dylib
\ No newline at end of file
diff -r 97914358ab30 -r 4f3a56408174 Dependencies/rtool/Resources/Examples/rpath/foo.c
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/Dependencies/rtool/Resources/Examples/rpath/foo.c Wed Nov 04 21:19:47 2009 -0500
@@ -0,0 +1,9 @@
+#include <stdio.h>
+#include <stdlib.h>
+
+int foo (void)
+{
+ printf("-- libfoo:foo() returns libbar:bar() --\n");
+ getNSGetExecutablePath((char *)"fooLIb");
+ return bar();
+}
\ No newline at end of file
diff -r 97914358ab30 -r 4f3a56408174 Dependencies/rtool/Resources/Examples/rpath/main.c
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/Dependencies/rtool/Resources/Examples/rpath/main.c Wed Nov 04 21:19:47 2009 -0500
@@ -0,0 +1,9 @@
+#include <stdio.h>
+
+int main(int argc, const char * argv[])
+{
+ printf("-- main() returns libfoo:foo() --\n");
+
+ getNSGetExecutablePath((char *)argv[0]);
+ return foo();
+}
\ No newline at end of file
diff -r 97914358ab30 -r 4f3a56408174 Dependencies/rtool/Resources/Examples/rpath/util.c
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/Dependencies/rtool/Resources/Examples/rpath/util.c Wed Nov 04 21:19:47 2009 -0500
@@ -0,0 +1,25 @@
+#include <stdio.h>
+#include <stdlib.h>
+#include <sys/param.h>
+#include <mach-o/dyld.h>
+#include <CoreFoundation/CoreFoundation.h>
+
+int getNSGetExecutablePath(char *pname)
+{
+ int status = -1;
+ uint32_t pathsize;
+ int result;
+ char *given_path = malloc(MAXPATHLEN * 2);
+ if (!given_path) return status;
+
+ pathsize = MAXPATHLEN * 2;
+ result = _NSGetExecutablePath(given_path, &pathsize);
+
+ if (result == 0)
+ {
+ printf("-- getNSGetExecutablePath %s : %s --\n\n",pname,given_path);
+ status = 0;
+ }
+ free (given_path);
+ return status;
+}
\ No newline at end of file
diff -r 97914358ab30 -r 4f3a56408174 Dependencies/rtool/Resources/Examples/share/ShareToResources.c
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/Dependencies/rtool/Resources/Examples/share/ShareToResources.c Wed Nov 04 21:19:47 2009 -0500
@@ -0,0 +1,96 @@
+/*
+ * Copyright (c) 2006 plumber <OpenSpecies at gnu-darwin.org>
+ *
+ * Permission to use, copy, modify, and distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ */
+
+/*
+ * ShareToResources.c
+ * CF Driver
+ *
+ * Created by plumber on 09/09/06.
+ * Copyright 2006 OpenSpecies. All rights reserved.
+ *
+ */
+
+#include <CoreFoundation/CoreFoundation.h>
+
+#define ktheStringIdentifier "com.MyCompany.MyApplication.MyLib"
+
+static char *CFStringToCString(CFStringRef TheCFStr)
+{
+ CFIndex buffSize;
+ char *buff;
+
+ if(TheCFStr != NULL)
+ {
+ buffSize = CFStringGetMaximumSizeForEncoding(
+ CFStringGetLength(TheCFStr),kCFStringEncodingUTF8
+ ) + 1;
+
+ buff = (char*) malloc(buffSize);
+
+ if (CFStringGetCString(TheCFStr,buff,buffSize,kCFStringEncodingUTF8))
+ {
+ return buff;
+ }
+
+ free(buff);
+ }
+
+ return NULL;
+}
+
More information about the commits
mailing list