summaryrefslogtreecommitdiffstats
path: root/scilab/modules/dynamic_link
diff options
context:
space:
mode:
authorSylvestre Ledru <sylvestre.ledru@scilab.org>2010-04-13 14:16:42 +0200
committerPierre MARECHAL <pierre.marechal@scilab.org>2010-04-13 16:30:24 +0200
commitc9eebfa1dbed63ef98b03e2d402cbdc26f691d17 (patch)
tree72180df9dc132e86ed8299735be26747e544f2c2 /scilab/modules/dynamic_link
parent3fe389178602cb3489fabe2dbf2ea62f262a1dcc (diff)
downloadscilab-c9eebfa1dbed63ef98b03e2d402cbdc26f691d17.zip
scilab-c9eebfa1dbed63ef98b03e2d402cbdc26f691d17.tar.gz
LDFLAGS are also given to make (but not the configure)
Change-Id: I1a3fd3fe6ee1ec3570a7725722cc14d04d9f632e
Diffstat (limited to 'scilab/modules/dynamic_link')
-rw-r--r--scilab/modules/dynamic_link/macros/gencompilationflags_unix.sci30
-rw-r--r--scilab/modules/dynamic_link/macros/ilib_compile.sci2
-rw-r--r--scilab/modules/dynamic_link/macros/ilib_gen_Make_unix.sci2
3 files changed, 19 insertions, 15 deletions
diff --git a/scilab/modules/dynamic_link/macros/gencompilationflags_unix.sci b/scilab/modules/dynamic_link/macros/gencompilationflags_unix.sci
index 8a3f1fe..5696080 100644
--- a/scilab/modules/dynamic_link/macros/gencompilationflags_unix.sci
+++ b/scilab/modules/dynamic_link/macros/gencompilationflags_unix.sci
@@ -1,5 +1,6 @@
1// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab 1// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
2// Copyright (C) 2008 - INRIA - Sylvestre LEDRU 2// Copyright (C) 2008 - INRIA - Sylvestre LEDRU
3// Copyright (C) 2010 - DIGITEO - Sylvestre LEDRU
3// 4//
4// This file must be used under the terms of the CeCILL. 5// This file must be used under the terms of the CeCILL.
5// This source file is licensed as described in the file COPYING, which 6// This source file is licensed as described in the file COPYING, which
@@ -8,25 +9,28 @@
8// http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt 9// http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
9 10
10 11
11function cmd = gencompilationflags_unix(ldflags, cflags, fflags, cc) 12function cmd = gencompilationflags_unix(ldflags, cflags, fflags, cc, flagsType)
12 // This function is restricted to Linux/Unix user only 13
14 // This function is restricted to Linux/Unix user only
15
13 if MSDOS then 16 if MSDOS then
14 error(msprintf(gettext("%s: Feature not available under Microsoft Windows.\n"),'gencompilationflags_unix')); 17 error(msprintf(gettext("%s: Feature not available under Microsoft Windows.\n"),'gencompilationflags_unix'));
15 return; 18 return;
16 end 19 end
17 20
18 [lhs,rhs] = argn(0); 21 [lhs,rhs] = argn(0);
19 if rhs <> 4 then 22 if rhs <> 5 then
20 error(msprintf(gettext("%s: Wrong number of input argument(s).\n"),"gencompilationflags_unix")); 23 error(msprintf(gettext("%s: Wrong number of input arguments: %d expected.\n"),"gencompilationflags_unix",5));
21 return 24 return
22 end 25 end
23 26
24 cmd='' 27 cmd=''
28
25 // CFLAGS 29 // CFLAGS
26 if cflags <> '' then 30 if cflags <> '' then
27 cmd = cmd +" CFLAGS="""+cflags+"""" 31 cmd = cmd +" CFLAGS="""+cflags+""""
28 end 32 end
29 33
30 // CXXFLAGS ... use the same as C 34 // CXXFLAGS ... use the same as C
31 if cflags <> '' then 35 if cflags <> '' then
32 cmd = cmd +" CXXFLAGS="""+cflags+"""" 36 cmd = cmd +" CXXFLAGS="""+cflags+""""
@@ -34,9 +38,9 @@ function cmd = gencompilationflags_unix(ldflags, cflags, fflags, cc)
34 38
35 // LDFLAGS 39 // LDFLAGS
36 // Do not set the LDFLAGS See bug #4787 40 // Do not set the LDFLAGS See bug #4787
37 // if ldflags <> '' then 41 if ldflags <> '' & flagsType <> "configure" then
38 // cmd = cmd +" LDFLAGS="""+ldflags+"""" 42 cmd = cmd +" LDFLAGS="""+ldflags+""""
39 // end 43 end
40 44
41 // FFLAGS 45 // FFLAGS
42 if fflags <> '' then 46 if fflags <> '' then
@@ -48,4 +52,4 @@ function cmd = gencompilationflags_unix(ldflags, cflags, fflags, cc)
48 cmd = cmd +" CC="""+cc+"""" 52 cmd = cmd +" CC="""+cc+""""
49 end 53 end
50 54
51 endfunction \ No newline at end of file 55endfunction
diff --git a/scilab/modules/dynamic_link/macros/ilib_compile.sci b/scilab/modules/dynamic_link/macros/ilib_compile.sci
index fc28c83..305c3c7 100644
--- a/scilab/modules/dynamic_link/macros/ilib_compile.sci
+++ b/scilab/modules/dynamic_link/macros/ilib_compile.sci
@@ -126,7 +126,7 @@ function libn = ilib_compile(lib_name,makename,files, ..
126 chdir(TMPDIR); 126 chdir(TMPDIR);
127 cmd = "make " 127 cmd = "make "
128 128
129 cmd = cmd + gencompilationflags_unix(ldflags, cflags, fflags, cc) 129 cmd = cmd + gencompilationflags_unix(ldflags, cflags, fflags, cc, "build")
130 130
131 //** BEWARE : this function can cause errors if used with "old style" Makefile inside a Scilab 5 131 //** BEWARE : this function can cause errors if used with "old style" Makefile inside a Scilab 5
132 //** environment where the Makefile are created from a "./configure" 132 //** environment where the Makefile are created from a "./configure"
diff --git a/scilab/modules/dynamic_link/macros/ilib_gen_Make_unix.sci b/scilab/modules/dynamic_link/macros/ilib_gen_Make_unix.sci
index b8dbea6..d2de9d9 100644
--- a/scilab/modules/dynamic_link/macros/ilib_gen_Make_unix.sci
+++ b/scilab/modules/dynamic_link/macros/ilib_gen_Make_unix.sci
@@ -249,7 +249,7 @@ function generateConfigure(workingPath, ..
249 if ( ilib_verbose() <> 0 ) then 249 if ( ilib_verbose() <> 0 ) then
250 mprintf(gettext(" %s: configure : Generate Makefile.\n"),"ilib_gen_Make"); 250 mprintf(gettext(" %s: configure : Generate Makefile.\n"),"ilib_gen_Make");
251 end 251 end
252 cmd = gencompilationflags_unix(ldflags, cflags, fflags, cc) 252 cmd = gencompilationflags_unix(ldflags, cflags, fflags, cc, "configure")
253 cmd = workingPath+"/compilerDetection.sh "+cmd 253 cmd = workingPath+"/compilerDetection.sh "+cmd
254 254
255 [msg,ierr,stderr] = unix_g(cmd); 255 [msg,ierr,stderr] = unix_g(cmd);