Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I've created the following symbolic link:

Source: /usr/local/android-ndk-r5/ndk-build
Destination: /usr/local/bin/ndk-build

However, when I attempt to use ndk-build from my source directory, it fails because it can't find files that the script depends on in the source directory.

How can I get the symbolic link to use the source directory as the working directory?

share|improve this question
add comment

1 Answer

up vote 2 down vote accepted

You can't, you need to make a wrapper script.

Assuming that the program relies on the filename for determining the script (likely):

#!/bin/sh
/usr/local/android-ndk-r5/ndk-build "$@"

Assuming that the program relies on the current working directory (unlikely):

#!/bin/sh
cd /usr/local/android-ndk-r5
./ndk-build "#@"

Save one of these files in /usr/local/bin/ndk-build and make it executable:

sudo editor /usr/local/bin/ndk-build
sudo chmod 755 /usr/local/bin/ndk-build
share|improve this answer
    
FYI, it was the first option. Thanks a bunch :) –  Mark Ingram Jul 4 '11 at 19:45
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.