Re: Compile broken after upgrading to Ubuntu 18.04 LTS

new topic     » goto parent     » topic index » view thread      » older message » newer message
irv said...

I would try this:

 system(text:format("make -j[] -f []_mak -C build",{CORES,appname})) 
  
 -- might require filename(appname) or whatever to remove path and extension. 

Ok, Thanks ... This works:

#!/home/ken/euphoria-4.1.0-Linux-x64/bin/eui 
-- 
--  For Ubuntu  based Linux distributions since 17.10 
 
--  Euc.ex  <== compile and place in the Euphoria bin directory. 
--  passes flags to compiler necessary to compile Euphoria programs 
-- also allows passing a number  of jobs flag to compiler: 
 
-- usage:  
--  eui Euc.ex search.ex 8     -- where 8 is the number of jobs/cores to utilize 
--  Euc search.ex 8                -- if Euc.ex is compiled and placed in bin directory       
--  eui Euc.ex search.ex        -- default compile with only one core utilized 
 
--  Based on ghaberak's compile script from OpenEuForum: 
--  https://openeuphoria.org/forum/m/134187.wc 
--  euc -build-dir build -extra-lflags="-no-pie" -makefile appname.ex  
--  make -j8 -f appname.mak -C build  
 
--  https://openeuphoria.org/forum/m/134183.wc 
--  As of Ubuntu 17.10, their GCC uses -fPIE (position independent executable)  
--  as the default over -fPIC (position independent code).  
--  You just need to add -extra-lflags="-no-pie" to the command line.  
--  euc -extra-lflags="-no-pie" search.ex  
 
include std/filesys.e 
include std/convert.e 
include std/text.e 
 
sequence cmd, appname, appname_mak 
integer CORES = 1,  -- default 
CORES_MAX = 8  -- system dependent 
 
cmd = command_line()  
if length(cmd) = 3 then 
   system_exec("euc -extra-lflags=\"-no-pie\""&' '& cmd[3]) 
elsif length(cmd) = 4 then 
   CORES = to_number(cmd[4]) 
   if CORES > CORES_MAX then CORES = CORES_MAX end if 
    appname = cmd[3] 
    appname_mak = filebase(appname)&".mak" 
    system_exec("euc -build-dir build -extra-lflags=\"-no-pie\" -makefile"&' '&appname)  
    system(text:format("make -j[] -f [] -C build",{CORES,appname_mak})) -- Thanks Irv! 
end if 

Thanks, Ken

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu