Saturday, April 27, 2024
5
rated 0 times [  5] [ 0]  / answers: 1 / hits: 9248  / 2 Years ago, sun, may 1, 2022, 6:06:54

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?


More From » symbolic-link

 Answers
0

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
exec /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
exec ./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

[#44384] Monday, May 2, 2022, 2 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
theurn

Total Points: 30
Total Questions: 110
Total Answers: 111

Location: Bahrain
Member since Fri, Sep 16, 2022
2 Years ago
theurn questions
Tue, Apr 5, 22, 14:18, 2 Years ago
Mon, Feb 14, 22, 16:29, 2 Years ago
Sat, Apr 8, 23, 05:26, 1 Year ago
Tue, Jan 10, 23, 23:59, 1 Year ago
Fri, Apr 8, 22, 01:36, 2 Years ago
;