diff inst/private/get_vars.m.in @ 230:1a3674836579

Provide flags for just-in-time compilation * src/configure.ac: add inst/private/get_vars.m as configured file * inst/private/get_vars.m.in: a function returning proper compiler or linker flags * inst/provate/generate_makefile.m: use flags * src/Makefile.in: add get_vars.m in the cleanall recipe
author Eugenio Gianniti <eugenio.gianniti@mail.polimi.it>
date Fri, 13 Jun 2014 18:45:40 +0200
parents
children 5e9b5bbdc56b
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/inst/private/get_vars.m.in	Fri Jun 13 18:45:40 2014 +0200
@@ -0,0 +1,35 @@
+## Copyright (C) 2014 Eugenio Gianniti <eugenio.gianniti@mail.polimi.it>
+##
+## This program is free software; you can redistribute it and/or modify it under
+## the terms of the GNU General Public License as published by the Free Software
+## Foundation; either version 3 of the License, or (at your option) any later
+## version.
+##
+## This program is distributed in the hope that it will be useful, but WITHOUT
+## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+## FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
+## details.
+##
+## You should have received a copy of the GNU General Public License along with
+## this program; if not, see <http://www.gnu.org/licenses/>.
+
+
+## -*- texinfo -*-
+## function for internal usage only
+## @end deftypefn
+
+function var = get_vars (name)
+  persistent opts = {"CPPFLAGS",
+                     "LIBS"};
+  select = validatestring (name, opts, "get_vars", "name");
+  switch (select)
+    case "CPPFLAGS"
+      var = "@DENSE_CPPFLAGS@ @DOLFIN_CPPFLAGS@ @EIGEN_CPPFLAGS@";
+    case "LIBS"
+      tokens = strsplit (strtrim ("@EIGEN_LIBS@ @DOLFIN_LIBS@"));
+      var = strjoin (tokens, '" "');
+      var = ['"', var, '"'];
+    otherwise
+      error ("get_vars: the requested variable is not available.");
+  endswitch
+endfunction
\ No newline at end of file