diff options
author | Sylvestre Ledru <sylvestre.ledru@scilab.org> | 2011-05-11 16:43:08 +0200 |
---|---|---|
committer | Clément DAVID <clement.david@scilab.org> | 2011-05-11 17:40:49 +0200 |
commit | a5cbed5a0f7b8ea6ceed174cc6707a3ce4d655db (patch) | |
tree | 2a6baf35adc1f0faece7874ea824afe9da2cb515 /scilab/modules | |
parent | 52b763ae1692f4d0ea2697fbb0ee6c5651086dc0 (diff) | |
download | scilab-a5cbed5a0f7b8ea6ceed174cc6707a3ce4d655db.zip scilab-a5cbed5a0f7b8ea6ceed174cc6707a3ce4d655db.tar.gz |
* bug 7887 fixed - Under some GNU/Linux distributions (like Ubuntu or Mageia),5.3.2
the dynamic link process was using the libstdc++ embedded
into the Scilab distribution. Now, if the compiler is gcc,
the dynamic link guesses the libstdc++ path and use it
uppermost.
Change-Id: I74b0563f5a71bce668f250b15f82882594bd1bb9
Diffstat (limited to 'scilab/modules')
5 files changed, 43 insertions, 4 deletions
diff --git a/scilab/modules/dynamic_link/help/en_US/ilib_build.xml b/scilab/modules/dynamic_link/help/en_US/ilib_build.xml index 76c7873..3547f16 100644 --- a/scilab/modules/dynamic_link/help/en_US/ilib_build.xml +++ b/scilab/modules/dynamic_link/help/en_US/ilib_build.xml | |||
@@ -127,6 +127,11 @@ | |||
127 | 127 | ||
128 | <para><emphasis role="bold">Languages handle by this function are: C, C++, | 128 | <para><emphasis role="bold">Languages handle by this function are: C, C++, |
129 | Fortran and Fortran 90.</emphasis></para> | 129 | Fortran and Fortran 90.</emphasis></para> |
130 | |||
131 | <para>On the internal technical level, under GNU/Linux and Mac OS X, the ilib_* function are based on the autotools. First, a configure is executed to detect compilers available. Then, a make is launched with the provided arguments. For more information: <ulink url="http://wiki.scilab.org/Full%20technical%20description%20of%20the%20incremental%20link">Full technical description of the incremental link / dynamic link</ulink></para> | ||
132 | |||
133 | <para>Since version 5.3.2, under GNU/Linux, Scilab detects where the libstdc++ is located (thanks to the command <emphasis role="italic">gcc -print-search-dirs|grep ^install:|awk '{print $2}'</emphasis>). Previously, the dynamic link was using the libstdc++ embedded in Scilab.</para> | ||
134 | |||
130 | </refsection> | 135 | </refsection> |
131 | 136 | ||
132 | <refsection> | 137 | <refsection> |
diff --git a/scilab/modules/dynamic_link/help/en_US/ilib_compile.xml b/scilab/modules/dynamic_link/help/en_US/ilib_compile.xml index 5c419ce..cf2c3bc 100644 --- a/scilab/modules/dynamic_link/help/en_US/ilib_compile.xml +++ b/scilab/modules/dynamic_link/help/en_US/ilib_compile.xml | |||
@@ -69,6 +69,11 @@ | |||
69 | Shared libraries can then be used with the <literal>link</literal> and | 69 | Shared libraries can then be used with the <literal>link</literal> and |
70 | <literal>addinter</literal> Scilab function for incremental/dynamic link.</para> | 70 | <literal>addinter</literal> Scilab function for incremental/dynamic link.</para> |
71 | <para><emphasis role="bold">Note that a compiler must be available on the system to use this function.</emphasis></para> | 71 | <para><emphasis role="bold">Note that a compiler must be available on the system to use this function.</emphasis></para> |
72 | |||
73 | <para>On the internal technical level, under GNU/Linux and Mac OS X, the ilib_* function are based on the autotools. First, a configure is executed to detect compilers available. Then, a make is launched with the provided arguments. For more information: <ulink url="http://wiki.scilab.org/Full%20technical%20description%20of%20the%20incremental%20link">Full technical description of the incremental link / dynamic link</ulink></para> | ||
74 | |||
75 | <para>Since version 5.3.2, under GNU/Linux, Scilab detects where the libstdc++ is located (thanks to the command <emphasis role="italic">gcc -print-search-dirs|grep ^install:|awk '{print $2}'</emphasis>). Previously, the dynamic link was using the libstdc++ embedded in Scilab.</para> | ||
76 | |||
72 | </refsection> | 77 | </refsection> |
73 | <refsection role="see also"> | 78 | <refsection role="see also"> |
74 | <title>See Also</title> | 79 | <title>See Also</title> |
diff --git a/scilab/modules/dynamic_link/help/en_US/ilib_for_link.xml b/scilab/modules/dynamic_link/help/en_US/ilib_for_link.xml index 5b708c0..d0ae845 100644 --- a/scilab/modules/dynamic_link/help/en_US/ilib_for_link.xml +++ b/scilab/modules/dynamic_link/help/en_US/ilib_for_link.xml | |||
@@ -126,6 +126,11 @@ | |||
126 | directory. They are all released into the public domain.</para> | 126 | directory. They are all released into the public domain.</para> |
127 | <para><emphasis role="bold">Note that a compiler must be available on the system to use this function.</emphasis></para> | 127 | <para><emphasis role="bold">Note that a compiler must be available on the system to use this function.</emphasis></para> |
128 | <para><emphasis role="bold">Languages handle by this function are: C, C++, Fortran and Fortran 90.</emphasis></para> | 128 | <para><emphasis role="bold">Languages handle by this function are: C, C++, Fortran and Fortran 90.</emphasis></para> |
129 | |||
130 | <para>On the internal technical level, under GNU/Linux and Mac OS X, the ilib_* function are based on the autotools. First, a configure is executed to detect compilers available. Then, a make is launched with the provided arguments. For more information: <ulink url="http://wiki.scilab.org/Full%20technical%20description%20of%20the%20incremental%20link">Full technical description of the incremental link / dynamic link</ulink></para> | ||
131 | |||
132 | <para>Since version 5.3.2, under GNU/Linux, Scilab detects where the libstdc++ is located (thanks to the command <emphasis role="italic">gcc -print-search-dirs|grep ^install:|awk '{print $2}'</emphasis>). Previously, the dynamic link was using the libstdc++ embedded in Scilab.</para> | ||
133 | |||
129 | </refsection> | 134 | </refsection> |
130 | <refsection> | 135 | <refsection> |
131 | <title>Examples (C code)</title> | 136 | <title>Examples (C code)</title> |
diff --git a/scilab/modules/dynamic_link/macros/ilib_compile.sci b/scilab/modules/dynamic_link/macros/ilib_compile.sci index 604b29b..ebd0fcf 100644 --- a/scilab/modules/dynamic_link/macros/ilib_compile.sci +++ b/scilab/modules/dynamic_link/macros/ilib_compile.sci | |||
@@ -144,6 +144,17 @@ function libn = ilib_compile(lib_name, .. | |||
144 | // Switch back to the TMPDIR where the mandatory files are | 144 | // Switch back to the TMPDIR where the mandatory files are |
145 | 145 | ||
146 | chdir(TMPDIR+"/"+lib_name_orig); | 146 | chdir(TMPDIR+"/"+lib_name_orig); |
147 | |||
148 | // Detect the actual path to the libstdc++ library. For the dynamic link | ||
149 | // build, we want to use the same lib as the compiler installed. | ||
150 | // CF bug #7887 for more information. | ||
151 | // Note that, for the configure, the setup is done by compilerDetection.sh | ||
152 | cmdGCC="if test -x ""$(which gcc 2>/dev/null)""; then echo $(LC_ALL=C gcc -print-search-dirs|awk ''$1==""install:""{print $2}''); fi"; | ||
153 | [GCClibpath, ierr, stderr] = unix_g(cmdGCC); | ||
154 | if (GCClibpath <> "" & ierr == 0 & grep(getenv("LD_LIBRARY_PATH"),GCClibpath) == []) then | ||
155 | setenv("LD_LIBRARY_PATH",GCClibpath+"/../../../:"+getenv("LD_LIBRARY_PATH")); | ||
156 | end | ||
157 | |||
147 | cmd = "make " | 158 | cmd = "make " |
148 | 159 | ||
149 | cmd = cmd + gencompilationflags_unix(ldflags, cflags, fflags, cc, "build") | 160 | cmd = cmd + gencompilationflags_unix(ldflags, cflags, fflags, cc, "build") |
diff --git a/scilab/modules/dynamic_link/src/scripts/compilerDetection.sh b/scilab/modules/dynamic_link/src/scripts/compilerDetection.sh index cba21c5..03dcba7 100755 --- a/scilab/modules/dynamic_link/src/scripts/compilerDetection.sh +++ b/scilab/modules/dynamic_link/src/scripts/compilerDetection.sh | |||
@@ -3,12 +3,25 @@ | |||
3 | PROGNAME="$0" | 3 | PROGNAME="$0" |
4 | PATHTOCONFIGURE=`dirname "$PROGNAME"` | 4 | PATHTOCONFIGURE=`dirname "$PROGNAME"` |
5 | cd $PATHTOCONFIGURE | 5 | cd $PATHTOCONFIGURE |
6 | if test -x "$(which gcc 2>/dev/null)"; then | ||
7 | # Detect the actual path to the libstdc++ library. For the dynamic link | ||
8 | # build, we want to use the same lib as the compiler installed. | ||
9 | # CF bug #7887 for more information. | ||
10 | # Note that, for the Makefile, the setup is done in the Scilab macros | ||
11 | # ilib_compile | ||
12 | GCClibpath=$(LC_ALL=C gcc -print-search-dirs|awk '$1=="install:"{print $2}')/../../../ | ||
13 | |||
14 | if test -z "$(grep $GCClibpath $LD_LIBRARY_PATH 2>/dev/null)"; then | ||
15 | LD_LIBRARY_PATH="$GCClibpath${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}" | ||
16 | export LD_LIBRARY_PATH | ||
17 | fi | ||
18 | fi | ||
6 | 19 | ||
7 | # Relaunch configure if files are missing | 20 | # Relaunch configure if files are missing |
8 | if test ! -s Makefile.orig -o ! -s libtool; then | 21 | if test ! -s Makefile.orig -o ! -s libtool; then |
9 | echo "Detection of C/C++/Fortran Compilers" | 22 | echo "Detection of C/C++/Fortran Compilers" |
10 | ./configure --disable-static --disable-dependency-tracking "$@" | 23 | ./configure --disable-static --disable-dependency-tracking "$@" |
11 | mv Makefile Makefile.orig | 24 | mv Makefile Makefile.orig |
12 | else | 25 | else |
13 | echo "Detection of compilers already done" | 26 | echo "Detection of compilers already done" |
14 | fi | 27 | fi |