File: gencompilationflags_unix.sci

package info (click to toggle)
scilab 5.3.3-10
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 330,656 kB
file content (55 lines) | stat: -rw-r--r-- 1,602 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
// Copyright (C) 2008 - INRIA - Sylvestre LEDRU
// Copyright (C) 2010 - DIGITEO - Sylvestre LEDRU
//
// This file must be used under the terms of the CeCILL.
// This source file is licensed as described in the file COPYING, which
// you should have received as part of this distribution.  The terms
// are also available at
// http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt

//=============================================================================
function cmd = gencompilationflags_unix(ldflags, cflags, fflags, cc, flagsType)

  // This function is restricted to Linux/Unix user only
  if getos() == 'Windows' then
    error(msprintf(gettext("%s: Feature not available under Microsoft Windows.\n"),'gencompilationflags_unix'));
    return;
  end

  [lhs,rhs] = argn(0);
  if rhs <> 5 then
    error(msprintf(gettext("%s: Wrong number of input arguments: %d expected.\n"),"gencompilationflags_unix",5));
    return
  end

  cmd=''

  // CFLAGS
  if cflags <> '' then
    cmd = cmd +" CFLAGS="""+cflags+""""
  end

  // CXXFLAGS ... use the same as C
  if cflags <> '' then
    cmd = cmd +" CXXFLAGS="""+cflags+""""
  end

  // LDFLAGS
  // Do not set the LDFLAGS See bug #4787
  if ldflags <> '' & flagsType <> "configure" then
    cmd = cmd +" LDFLAGS="""+ldflags+""""
  end

  // FFLAGS
  if fflags <> '' then
    cmd = cmd +" FFLAGS="""+fflags+""""
  end

  // CC
  if cc <> '' then
    cmd = cmd +" CC="""+cc+""""
  end

endfunction
//=============================================================================