Can't build GrowlTcl extension as universal binary
-
kevin_walzer
- Harmless
- Posts: 19
- Joined: Sat Nov 25, 2006 9:08 pm
Can't build GrowlTcl extension as universal binary
I'm having trouble building Growl's Tcl bindings as a universal binary.
Here are the steps I've taken:
1. Downloaded the source code for Growl 0.7.4.
2. cd to Bindings/tcl.
3. Edit the makefile to add -arch args to the CFLAGS. (CFLAGS = -Wall -DUSE_TCL_STUBS -arch ppc -arch i386)
4. Run make.
(Running Xcode 2.4.1 on OS X 10.4.8, iBook G3)
This is the output:
gcc -Wall -DUSE_TCL_STUBS -arch ppc -arch i386 -c -o GrowlApplicationBridge.o GrowlApplicationBridge.m
GrowlApplicationBridge.m:14:27: error: NSURLAdditions.h: No such file or directory
GrowlApplicationBridge.m:15:29: error: CFGrowlAdditions.h: No such file or directory
GrowlApplicationBridge.m:16:33: error: GrowlDefinesInternal.h: No such file or directory
GrowlApplicationBridge.m:17:26: error: GrowlPathUtil.h: No such file or directory
GrowlApplicationBridge.m:18:25: error: GrowlPathway.h: No such file or directory
GrowlApplicationBridge.m: In function '+[GrowlApplicationBridge notifyWithDictionary:]':
GrowlApplicationBridge.m:237: error: 'NSImage' undeclared (first use in this function)
GrowlApplicationBridge.m:237: error: (Each undeclared identifier is reported only once
GrowlApplicationBridge.m:237: error: for each function it appears in.)
GrowlApplicationBridge.m:239: error: 'icon' undeclared (first use in this function)
GrowlApplicationBridge.m:256: error: cannot find protocol declaration for 'GrowlNotificationProtocol'
GrowlApplicationBridge.m:257: error: cannot find protocol declaration for 'GrowlNotificationProtocol'
GrowlApplicationBridge.m:258: warning: no '-postNotificationWithDictionary:' method found
GrowlApplicationBridge.m:258: warning: (Messages without a matching method signature
GrowlApplicationBridge.m:258: warning: will be assumed to return 'id' and accept
GrowlApplicationBridge.m:258: warning: '...' as arguments.)
GrowlApplicationBridge.m: In function '+[GrowlApplicationBridge isGrowlInstalled]':
GrowlApplicationBridge.m:298: error: 'GrowlPathUtil' undeclared (first use in this function)
GrowlApplicationBridge.m:299: warning: control reaches end of non-void function
GrowlApplicationBridge.m: In function '+[GrowlApplicationBridge registrationDictionaryByFillingInDictionary:restrictToKeys:]':
GrowlApplicationBridge.m:405: error: 'NSImage' undeclared (first use in this function)
GrowlApplicationBridge.m:406: error: parse error before ')' token
GrowlApplicationBridge.m:416: error: 'GROWL_APP_LOCATION' undeclared (first use in this function)
GrowlApplicationBridge.m:418: warning: implicit declaration of function 'copyCurrentProcessURL'
GrowlApplicationBridge.m:418: warning: initialization makes pointer from integer without a cast
GrowlApplicationBridge.m:420: warning: 'NSURL' may not respond to '-dockDescription'
GrowlApplicationBridge.m: In function '+[GrowlApplicationBridge _applicationIconDataForGrowlSearchingRegistrationDictionary:]':
GrowlApplicationBridge.m:476: warning: initialization makes pointer from integer without a cast
GrowlApplicationBridge.m:477: warning: implicit declaration of function 'copyIconDataForURL'
GrowlApplicationBridge.m:477: warning: invalid receiver type 'int'
GrowlApplicationBridge.m:14:27: error: NSURLAdditions.h: No such file or directory
GrowlApplicationBridge.m:15:29: error: CFGrowlAdditions.h: No such file or directory
GrowlApplicationBridge.m:16:33: error: GrowlDefinesInternal.h: No such file or directory
GrowlApplicationBridge.m:17:26: error: GrowlPathUtil.h: No such file or directory
GrowlApplicationBridge.m:18:25: error: GrowlPathway.h: No such file or directory
GrowlApplicationBridge.m: In function '+[GrowlApplicationBridge _launchGrowlIfInstalledWithRegistrationDictionary:]':
GrowlApplicationBridge.m:606: error: 'GrowlPathUtil' undeclared (first use in this function)
GrowlApplicationBridge.m: In function '+[GrowlApplicationBridge notifyWithDictionary:]':
GrowlApplicationBridge.m:237: error: 'NSImage' undeclared (first use in this function)
GrowlApplicationBridge.m:237: error: (Each undeclared identifier is reported only once
GrowlApplicationBridge.m:237: error: for each function it appears in.)
GrowlApplicationBridge.m:239: error: 'icon' undeclared (first use in this function)
GrowlApplicationBridge.m:256: error: cannot find protocol declaration for 'GrowlNotificationProtocol'
GrowlApplicationBridge.m:257: error: cannot find protocol declaration for 'GrowlNotificationProtocol'
GrowlApplicationBridge.m:258: warning: no '-postNotificationWithDictionary:' method found
GrowlApplicationBridge.m:258: warning: (Messages without a matching method signature
GrowlApplicationBridge.m:258: warning: will be assumed to return 'id' and accept
GrowlApplicationBridge.m:258: warning: '...' as arguments.)
GrowlApplicationBridge.m: In function '+[GrowlApplicationBridge isGrowlInstalled]':
GrowlApplicationBridge.m:298: error: 'GrowlPathUtil' undeclared (first use in this function)
GrowlApplicationBridge.m:299: warning: control reaches end of non-void function
GrowlApplicationBridge.m: In function '+[GrowlApplicationBridge registrationDictionaryByFillingInDictionary:restrictToKeys:]':
GrowlApplicationBridge.m:405: error: 'NSImage' undeclared (first use in this function)
GrowlApplicationBridge.m:406: error: parse error before ')' token
GrowlApplicationBridge.m:416: error: 'GROWL_APP_LOCATION' undeclared (first use in this function)
GrowlApplicationBridge.m:418: warning: implicit declaration of function 'copyCurrentProcessURL'
GrowlApplicationBridge.m:418: warning: initialization makes pointer from integer without a cast
GrowlApplicationBridge.m:420: warning: 'NSURL' may not respond to '-dockDescription'
GrowlApplicationBridge.m: In function '+[GrowlApplicationBridge _applicationIconDataForGrowlSearchingRegistrationDictionary:]':
GrowlApplicationBridge.m:476: warning: initialization makes pointer from integer without a cast
GrowlApplicationBridge.m:477: warning: implicit declaration of function 'copyIconDataForURL'
GrowlApplicationBridge.m:477: warning: invalid receiver type 'int'
GrowlApplicationBridge.m: In function '+[GrowlApplicationBridge _launchGrowlIfInstalledWithRegistrationDictionary:]':
GrowlApplicationBridge.m:606: error: 'GrowlPathUtil' undeclared (first use in this function)
lipo: can't figure out the architecture type of: /var/tmp//ccmkpRnQ.out
make: *** [GrowlApplicationBridge.o] Error 1
I have no idea what's going on here. Do I need to build the Growl frameworks before I build the bindings? I didn't think that was the case, because I *did* successfully build the same extension from Growl 0.6.2, but that won't run on MacTel (even though it built as a UB and lipo says there is i386 bits there as well).
The one odd thing here is that in the source code tree, GrowlApplicationBridge.h, GrowlApplicationBridge.m, and GrowlDefines.h are symlinked--not actually present in the Bindings/tcl directory. Not sure if that makes a difference or not.
Here are the steps I've taken:
1. Downloaded the source code for Growl 0.7.4.
2. cd to Bindings/tcl.
3. Edit the makefile to add -arch args to the CFLAGS. (CFLAGS = -Wall -DUSE_TCL_STUBS -arch ppc -arch i386)
4. Run make.
(Running Xcode 2.4.1 on OS X 10.4.8, iBook G3)
This is the output:
gcc -Wall -DUSE_TCL_STUBS -arch ppc -arch i386 -c -o GrowlApplicationBridge.o GrowlApplicationBridge.m
GrowlApplicationBridge.m:14:27: error: NSURLAdditions.h: No such file or directory
GrowlApplicationBridge.m:15:29: error: CFGrowlAdditions.h: No such file or directory
GrowlApplicationBridge.m:16:33: error: GrowlDefinesInternal.h: No such file or directory
GrowlApplicationBridge.m:17:26: error: GrowlPathUtil.h: No such file or directory
GrowlApplicationBridge.m:18:25: error: GrowlPathway.h: No such file or directory
GrowlApplicationBridge.m: In function '+[GrowlApplicationBridge notifyWithDictionary:]':
GrowlApplicationBridge.m:237: error: 'NSImage' undeclared (first use in this function)
GrowlApplicationBridge.m:237: error: (Each undeclared identifier is reported only once
GrowlApplicationBridge.m:237: error: for each function it appears in.)
GrowlApplicationBridge.m:239: error: 'icon' undeclared (first use in this function)
GrowlApplicationBridge.m:256: error: cannot find protocol declaration for 'GrowlNotificationProtocol'
GrowlApplicationBridge.m:257: error: cannot find protocol declaration for 'GrowlNotificationProtocol'
GrowlApplicationBridge.m:258: warning: no '-postNotificationWithDictionary:' method found
GrowlApplicationBridge.m:258: warning: (Messages without a matching method signature
GrowlApplicationBridge.m:258: warning: will be assumed to return 'id' and accept
GrowlApplicationBridge.m:258: warning: '...' as arguments.)
GrowlApplicationBridge.m: In function '+[GrowlApplicationBridge isGrowlInstalled]':
GrowlApplicationBridge.m:298: error: 'GrowlPathUtil' undeclared (first use in this function)
GrowlApplicationBridge.m:299: warning: control reaches end of non-void function
GrowlApplicationBridge.m: In function '+[GrowlApplicationBridge registrationDictionaryByFillingInDictionary:restrictToKeys:]':
GrowlApplicationBridge.m:405: error: 'NSImage' undeclared (first use in this function)
GrowlApplicationBridge.m:406: error: parse error before ')' token
GrowlApplicationBridge.m:416: error: 'GROWL_APP_LOCATION' undeclared (first use in this function)
GrowlApplicationBridge.m:418: warning: implicit declaration of function 'copyCurrentProcessURL'
GrowlApplicationBridge.m:418: warning: initialization makes pointer from integer without a cast
GrowlApplicationBridge.m:420: warning: 'NSURL' may not respond to '-dockDescription'
GrowlApplicationBridge.m: In function '+[GrowlApplicationBridge _applicationIconDataForGrowlSearchingRegistrationDictionary:]':
GrowlApplicationBridge.m:476: warning: initialization makes pointer from integer without a cast
GrowlApplicationBridge.m:477: warning: implicit declaration of function 'copyIconDataForURL'
GrowlApplicationBridge.m:477: warning: invalid receiver type 'int'
GrowlApplicationBridge.m:14:27: error: NSURLAdditions.h: No such file or directory
GrowlApplicationBridge.m:15:29: error: CFGrowlAdditions.h: No such file or directory
GrowlApplicationBridge.m:16:33: error: GrowlDefinesInternal.h: No such file or directory
GrowlApplicationBridge.m:17:26: error: GrowlPathUtil.h: No such file or directory
GrowlApplicationBridge.m:18:25: error: GrowlPathway.h: No such file or directory
GrowlApplicationBridge.m: In function '+[GrowlApplicationBridge _launchGrowlIfInstalledWithRegistrationDictionary:]':
GrowlApplicationBridge.m:606: error: 'GrowlPathUtil' undeclared (first use in this function)
GrowlApplicationBridge.m: In function '+[GrowlApplicationBridge notifyWithDictionary:]':
GrowlApplicationBridge.m:237: error: 'NSImage' undeclared (first use in this function)
GrowlApplicationBridge.m:237: error: (Each undeclared identifier is reported only once
GrowlApplicationBridge.m:237: error: for each function it appears in.)
GrowlApplicationBridge.m:239: error: 'icon' undeclared (first use in this function)
GrowlApplicationBridge.m:256: error: cannot find protocol declaration for 'GrowlNotificationProtocol'
GrowlApplicationBridge.m:257: error: cannot find protocol declaration for 'GrowlNotificationProtocol'
GrowlApplicationBridge.m:258: warning: no '-postNotificationWithDictionary:' method found
GrowlApplicationBridge.m:258: warning: (Messages without a matching method signature
GrowlApplicationBridge.m:258: warning: will be assumed to return 'id' and accept
GrowlApplicationBridge.m:258: warning: '...' as arguments.)
GrowlApplicationBridge.m: In function '+[GrowlApplicationBridge isGrowlInstalled]':
GrowlApplicationBridge.m:298: error: 'GrowlPathUtil' undeclared (first use in this function)
GrowlApplicationBridge.m:299: warning: control reaches end of non-void function
GrowlApplicationBridge.m: In function '+[GrowlApplicationBridge registrationDictionaryByFillingInDictionary:restrictToKeys:]':
GrowlApplicationBridge.m:405: error: 'NSImage' undeclared (first use in this function)
GrowlApplicationBridge.m:406: error: parse error before ')' token
GrowlApplicationBridge.m:416: error: 'GROWL_APP_LOCATION' undeclared (first use in this function)
GrowlApplicationBridge.m:418: warning: implicit declaration of function 'copyCurrentProcessURL'
GrowlApplicationBridge.m:418: warning: initialization makes pointer from integer without a cast
GrowlApplicationBridge.m:420: warning: 'NSURL' may not respond to '-dockDescription'
GrowlApplicationBridge.m: In function '+[GrowlApplicationBridge _applicationIconDataForGrowlSearchingRegistrationDictionary:]':
GrowlApplicationBridge.m:476: warning: initialization makes pointer from integer without a cast
GrowlApplicationBridge.m:477: warning: implicit declaration of function 'copyIconDataForURL'
GrowlApplicationBridge.m:477: warning: invalid receiver type 'int'
GrowlApplicationBridge.m: In function '+[GrowlApplicationBridge _launchGrowlIfInstalledWithRegistrationDictionary:]':
GrowlApplicationBridge.m:606: error: 'GrowlPathUtil' undeclared (first use in this function)
lipo: can't figure out the architecture type of: /var/tmp//ccmkpRnQ.out
make: *** [GrowlApplicationBridge.o] Error 1
I have no idea what's going on here. Do I need to build the Growl frameworks before I build the bindings? I didn't think that was the case, because I *did* successfully build the same extension from Growl 0.6.2, but that won't run on MacTel (even though it built as a UB and lipo says there is i386 bits there as well).
The one odd thing here is that in the source code tree, GrowlApplicationBridge.h, GrowlApplicationBridge.m, and GrowlDefines.h are symlinked--not actually present in the Bindings/tcl directory. Not sure if that makes a difference or not.
Re: Can't build GrowlTcl extension as universal binary
If they are symlinked and built into the product then they need to be present (and GAB itself is a gateway to a large portion of the Growl core code.) You should generally use the entire source base, not a subset, when building to insure you have all components.kevin_walzer wrote:The one odd thing here is that in the source code tree, GrowlApplicationBridge.h, GrowlApplicationBridge.m, and GrowlDefines.h are symlinked--not actually present in the Bindings/tcl directory. Not sure if that makes a difference or not.
Also, when creating UBs, make sure all components are built for both architectures.
Try my software!
#define ADIUMX pimp //by me
#define QUESTION ((2b) || (!2b))
Have you hugged a programmer today?
#define ADIUMX pimp //by me
#define QUESTION ((2b) || (!2b))
Have you hugged a programmer today?
- tomhennigan
- aMSN Team
- Posts: 13
- Joined: Mon Oct 17, 2005 4:46 pm
- Location: London, UK
- Contact:
Here's the build script we at aMSN use. It was made by David Luyer. We don't have any problems with it or it's products on PPC or Intel.
Code: Select all
#!/bin/sh
cd ~/Tools/
# Build libgrowl.
if [ ! -f Growl/Growl-0.7.4/Bindings/tcl/libgrowl.dylib ]
then
mkdir -p Growl
cd Growl
curl --retry 5 -R -z Growl-0.7.4-src.tar.bz2 http://www.growl.info/files/source/Growl-0.7.4-src.tar.bz2 -o Growl-0.7.4-src.tar.bz2
rm -rf Growl-0.7.4
tar xjf Growl-0.7.4-src.tar.bz2
cd Growl-0.7.4/Bindings/tcl
patch Makefile <<\EOF
@@ -7,16 +7,26 @@
DESTDIR =
PREFIX = /Library/Tcl/growl1.0
-OBJS = GrowlApplicationBridge.o TclGrowler.o growl.o
+OBJS = GrowlPathUtil.o GrowlApplicationBridge.o CFGrowlAdditions.o TclGrowler.o growl.o NSURLAdditions.o
TARGET = libgrowl.dylib
-CC = gcc
-CFLAGS = -Wall -DUSE_TCL_STUBS
-FRAMEWORKS = -framework Cocoa -framework Tcl -ltclstub8.4
-LDFLAGS = -dynamiclib -install_name $(PREFIX)/$(TARGET)
+CC = gcc --std=c99 -fconstant-cfstrings
+ARCH=-arch i386 -arch ppc -isysroot /Developer/SDKs/MacOSX10.4u.sdk
+CFLAGS = -Wall -DUSE_TCL_STUBS $(ARCH) -I../../Common/Source -I../../Core/Source
+FRAMEWORKS = -framework Cocoa -framework Tcl
+LDFLAGS = -dynamiclib $(ARCH) -Wl,-single_module
all: $(TARGET)
+CFGrowlAdditions.c:
+ ln -s ../../Common/Source/CFGrowlAdditions.c
+
+GrowlPathUtil.m:
+ ln -s ../../Common/Source/GrowlPathUtil.m
+
+NSURLAdditions.m:
+ ln -s ../../Common/Source/NSURLAdditions.m
+
$(TARGET): $(OBJS)
$(CC) $(LDFLAGS) $(FRAMEWORKS) $(OBJS) -o $@
EOF
make
fi
# Done libgrowl build.[Completely snowed under with work from my real life, so replies may come slowly.]
tomhennigan[at]gmail[dot]com - http://tomhennigan.co.uk/

tomhennigan[at]gmail[dot]com - http://tomhennigan.co.uk/

-
kevin_walzer
- Harmless
- Posts: 19
- Joined: Sat Nov 25, 2006 9:08 pm
- tomhennigan
- aMSN Team
- Posts: 13
- Joined: Mon Oct 17, 2005 4:46 pm
- Location: London, UK
- Contact:
Coolkevin_walzer wrote:Tom,
This script did the trick! Thank you so much. It was exactly what I needed--my app no longer crashes on Mactel. Please thank the script author for his great work.
Best,
Kevin
[Completely snowed under with work from my real life, so replies may come slowly.]
tomhennigan[at]gmail[dot]com - http://tomhennigan.co.uk/

tomhennigan[at]gmail[dot]com - http://tomhennigan.co.uk/

-
kevin_walzer
- Harmless
- Posts: 19
- Joined: Sat Nov 25, 2006 9:08 pm
Thus a firm knowledge of tcl and a solid understanding of Growl.
Try my software!
#define ADIUMX pimp //by me
#define QUESTION ((2b) || (!2b))
Have you hugged a programmer today?
#define ADIUMX pimp //by me
#define QUESTION ((2b) || (!2b))
Have you hugged a programmer today?
-
kevin_walzer
- Harmless
- Posts: 19
- Joined: Sat Nov 25, 2006 9:08 pm
I have a pretty good knowledge of Tcl (it's my main programming language), rudimentary experience with its C API (and C itself--I've coded a very simple Tcl extension in C), and almost no knowledge of Objective C/Cocoa or Growl's internals.
Does this make me sound at least minimally qualified to maintain the Growl Tcl bindings?
I'm willing to invest a little time to improve my knowledge of C, and also to learn Objective C, at least at a basic level. This would help my other projects, as well as my skills in general.
If someone from Amsn steps up, I'll defer to them--but I'm willing if no one else is. I don't want the Tcl-Growl bindings to disappear.
Does this make me sound at least minimally qualified to maintain the Growl Tcl bindings?
I'm willing to invest a little time to improve my knowledge of C, and also to learn Objective C, at least at a basic level. This would help my other projects, as well as my skills in general.
If someone from Amsn steps up, I'll defer to them--but I'm willing if no one else is. I don't want the Tcl-Growl bindings to disappear.
You don't need to learn Objective C (though it is fun and helpful), just gaining a grasp on how Growl functions [i.e., bindings send message through bridge, bridge posts notification to growl helper app, gha displays message] at a macro level and a firm knowledge of how the tcl bindings is built and work. (for this I'd pull the source code and study it, asking for clarifications as needed)
I plan on making sure the wiki is fully update to date in the future, but it's got some great gems there already so I'd check that out as well.
I plan on making sure the wiki is fully update to date in the future, but it's got some great gems there already so I'd check that out as well.
Try my software!
#define ADIUMX pimp //by me
#define QUESTION ((2b) || (!2b))
Have you hugged a programmer today?
#define ADIUMX pimp //by me
#define QUESTION ((2b) || (!2b))
Have you hugged a programmer today?
-
kevin_walzer
- Harmless
- Posts: 19
- Joined: Sat Nov 25, 2006 9:08 pm
Start studyingkevin_walzer wrote:OK, count me in then. I'll be the Tcl-Growl maintainer.
Also, you'll want to get in the habit of periodically building and using the trunk, not just a tagged release, to verify the functionality of the bindings in the pending release.
Try my software!
#define ADIUMX pimp //by me
#define QUESTION ((2b) || (!2b))
Have you hugged a programmer today?
#define ADIUMX pimp //by me
#define QUESTION ((2b) || (!2b))
Have you hugged a programmer today?