File: test-ldlp.sh

package info (click to toggle)
scratchbox2 2.2.4-1debian1
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd, wheezy
  • size: 5,392 kB
  • ctags: 5,239
  • sloc: ansic: 21,734; sh: 4,360; perl: 2,170; cpp: 1,913; makefile: 610; python: 184
file content (19 lines) | stat: -rw-r--r-- 425 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
# LD_LIBRARY_PATH is readed by the rt-linker
set -e

cat > libfoo.c <<EOF
int alibcall(int a,int b) { return a+b; }
EOF

cat > foouser.c <<EOF
int alibcall(int a,int b);
main() { return alibcall(3,-3); }
EOF

gcc -fPIC libfoo.c -shared -o libfoo.so
gcc foouser.c -L. -lfoo -o foouser
if ./foouser 2> /dev/null; then
   echo Something wrong in the linking or rt-linker.
else
   LD_LIBRARY_PATH=$LD_LIBRARY_PATH:. ./foouser
fi