Please note:The SCons wiki is now restored from the attack in March 2013. All old passwords have been invalidated. Please reset your password if you have an account. If you note missing pages, please report them to webmaster@scons.org. Also, new account creation is currently disabled due to an ongoing spam flood (2013/08/27).
Differences between revisions 3 and 4
Revision 3 as of 2012-11-19 03:11:43
Size: 777
Editor: 192
Comment:
Revision 4 as of 2012-11-19 03:23:41
Size: 993
Editor: 192
Comment:
Deletions are marked like this. Additions are marked like this.
Line 1: Line 1:
This page explains how to correctly create a soft link. This page explains how to correctly create symbolic links.

Creating symbolic links is required when you create a shared library. You'll need to set up a link from the ''soname'' to the real name.
Line 6: Line 8:
 * sconstruct
 * backend/some_code.c
 * backend/sconstruct
Line 7: Line 12:
 * sconstruct

 *
backend\some_code.c

 * bac
kend\sconstruct

And you wish to create two soft lin
ks in directory ''backend'', named ''liba.so.0'' pointing to ''liba.so'', and ''liba.so.0.0.1'' pointing to ''liba.so''.

For some reason (e.g., different compiling option between the folders), you use ''sconstruct'' and ''backend\sconstruct'' separately to compile different folders.
Assume somehow you have built ''backend/liba.so.0.0.1''. Then you wish to create two soft links in directory ''backend'', named ''liba.so.0'' pointing to ''liba.so.0.0.1'', and ''liba.so'' pointing to ''liba.so.0.0.1''. For some reason (e.g., different compiling option between the folders), you use ''sconstruct'' and ''backend\sconstruct'' separately to compile different folders.
Line 25: Line 22:
 * env.Command('liba.so.0', 'liba.so', 'ln -s ${SOURCE.file} $TARGET')
 * env.Command('liba.so.0.0.1', 'liba.so', 'ln -s ${SOURCE.file} $TARGET')
 * env.Command('liba.so', 'liba.so.0.0.1', 'ln -s '''${SOURCE.file}''' $TARGET')
 * env.Command('liba.so.0', 'liba.so.0.0.1', 'ln -s '''${SOURCE.file}''' $TARGET')

This page explains how to correctly create symbolic links.

Creating symbolic links is required when you create a shared library. You'll need to set up a link from the soname to the real name.

Assume the files in your project are

  • some_code.c
  • sconstruct
  • backend/some_code.c
  • backend/sconstruct

Assume somehow you have built backend/liba.so.0.0.1. Then you wish to create two soft links in directory backend, named liba.so.0 pointing to liba.so.0.0.1, and liba.so pointing to liba.so.0.0.1. For some reason (e.g., different compiling option between the folders), you use sconstruct and backend\sconstruct separately to compile different folders.

Here is a solution.

In sconstruct:

  • env.SConscript('backend/sconstruct')

In backend/sconstruct:

  • env.Command('liba.so', 'liba.so.0.0.1', 'ln -s ${SOURCE.file} $TARGET')

  • env.Command('liba.so.0', 'liba.so.0.0.1', 'ln -s ${SOURCE.file} $TARGET')

CreateSoftLink (last edited 2012-11-19 03:23:41 by 192)