Saturday, 11 October 2008

Finding Shared libraries

Have you ever wished you could work out what program uses which libraries. On os x the tool is otool.



I found the information here and its been a great help Al Hoangs blog

Friday, 10 October 2008

Compiling lighttpd for iphone

After writing my own ftp server for my app, I decided that webdav was a way better solution as so many have found out.  Using the instructions at http://latenitesoft.blogspot.com/2008/10/iphone-programming-tips-building-unix.html
and with the help of Alice at http://gothcandy.com/alice/2007/09/05/81/porting-lighttpd-to-the-iphone/   I think I have it compiling, but after all that, I wonder if its actually useful to me....
doh!
anyway here's the shell script to compile..
you also need to copy in 2 header files from the simulator to let it compile..
these are 

/bzlib.h and crt_externs.h

If anyone has some advice how I could incorporate this into an app, do let me know.
cheers


#/bin/bash

export DEVROOT=/Developer/Platforms/iPhoneOS.platform/Developer
export SDKROOT=$DEVROOT/SDKs/iPhoneOS2.1.sdk
export SIMROOT=/Developer/Platforms/iPhoneSimulator.platform

# Save relevant environment
U_CC=$CC
U_CFLAGS=$CFLAGS
U_LD=$LD
U_LDFLAGS=$LDFLAGS
U_CPP=$CPP
U_CPPFLAGS=$CPPFLAGS

export CPPFLAGS="-I$SDKROOT/usr/lib/gcc/arm-apple-darwin9/4.0.1/include/ -I$SDKROOT/usr/include/"
# -I$SIMROOT/Developer/SDKs/iPhoneSimulator2.1.sdk/usr/include/"
export CFLAGS="$CPPFLAGS -arch armv6 -pipe -no-cpp-precomp -isysroot $SDKROOT"
export CPP="/usr/bin/cpp $CPPFLAGS"

# dynamic library location generated by the Unix package
#LIBPATH=src/.libs/.dylib
#LIBNAME=`basename $LIBPATH`
#,-dylib_install_name,@executable_path/$LIBNAME"
export LDFLAGS="-L$SDKROOT/usr/lib/ -Wl,-dylib_install_name,@executable_path/$LIBNAME"


echo $CPPFLAGS
echo $LDFLAGS
read -p "Press a key"

# static library that will be generated
LIBPATH_static=src/.libs/lighttpd.a
LIBNAME_static=`basename $LIBPATH_static`

./configure CC=$DEVROOT/usr/bin/arm-apple-darwin9-gcc-4.0.1 LD=$DEVROOT/usr/bin/ld --host=arm-apple-darwin -without-pcre

# --libdir=$SDKROOT/usr/lib/ --includedir=$SDKROOTk/usr/include/
make



#mkdir -p lnsout
#cp $LIBPATH_static lnsout/$LIBNAME_static.arm
exit



Saturday, 27 September 2008

Finder open Terminal Here

Just found this super useful button for the finder that will open the terminal at the location of the selected finder window

Tuesday, 19 August 2008

Stupid VPS

Stupid VPS keeps going down. I wonder if its modrails doing it.

I need to have another one ready to swap to.

Linux, TV & The XBox

A little while back I hacked the xbox ( softmodded ) using the well know technique of loading Splinter Cell and downloading a boot loader via  a saved game. I had to cut the wire of one of the controllers and wired it to a USB socket, I copied the bootloader onto my old iPod Shuffle and got linux installed on it.

Its worked great. I've been using elgato on a macmini to record films off tv, and have been scripting them to upload to my OSX Tiger Server. The xbox plays them great, streaming without a glitch. I've installed XBMC as the main dashboard and the scripts are pretty neat too.

After this, I decided that the bundle of wires under the TV was a pain, so I cancelled the cable tv, boxed up the DVD-R and all the other paraphernalia and was left with just the xbox and a digital-tv box. 

That wasn't enough, so I looked at MythTV for the mac mini, but after struggling to get it working, found out it couldnt access my TV usb stick, so was a bit stumped. Then I decided to try installing linux on the mini. A brief flirtation with Gentoo ( so much compiling ) and I had opensuse up and running and eventually the elgato-diversity ( Hauppage NovaT ) working with Kaffeine, Mplayer and xine. ( ppc is a pain, not many rpms, so compilation hell again ). I did try distcc and creating a cross compiler for the G5 but it wasn't to be. Another day perhaps?

Next stop. I'm trying to get MythTV compiled and working. It's a long road. but I hope to be able to schedule the recording of tv from anywhere I am and stream it too.. 

Meanwhile I had to start learning about AudioUnits....  and the rest of my life.

iPhone Dev

As a change from music, and because it fascinates me I've been working on some audio software for the iPhone/iPod Touch.  My app is currently in review. I am now working on a full version, that being a stripped down, how the hell do I do this version.

Thursday, 22 May 2008

Deprecated Functions

I think these 2 days can be categorised as trying to make old things run with newer libraries.

My main work website is on hosting rails at the moment, but I have a VPS Im trying to move everything to. Well when I looked at my local copy of the site, it wouldnt work on Locomotive anymore and I had no idea why.

Today I'm trying to compile openAL into an iphone app.  My demo app for cocoa uses alutloadwavfile.  

Both days, ive spent time trying to figure out 
1) where i was in the project when i left it
2) why it wont run
3) what the replacement for the bloody deprecated function is

doh!