opkg

statically linked package installer
git clone anongit@rnpnr.xyz:opkg.git
Log | Files | Refs | Feed | Submodules | README | LICENSE

gen.lua (748B)


      1 -- TODO: i686 support?
      2 local arch = ({
      3 	x86_64='x86_64',
      4 })[config.target.platform:match('[^-]*')]
      5 if not arch then arch = 'generic' end
      6 
      7 local archcflags = {}
      8 local archldflags = {}
      9 archcflags['generic']  = {}
     10 archldflags['generic'] = {}
     11 archcflags['x86_64']   = {'-fno-asynchronous-unwind-tables', '-fno-stack-protector', '-fno-builtin'}
     12 archldflags['x86_64']  = {'-nostdlib', '-Wl,--gc-sections'}
     13 
     14 local archsrcs = {}
     15 archsrcs['generic'] = {'generic_main.c'}
     16 archsrcs['x86_64']  = {'linux_amd64_main.c'}
     17 
     18 cflags(archcflags[arch])
     19 set('ldflags', '$ldflags '..table.concat(archldflags[arch], ' '))
     20 
     21 exe('u-config', archsrcs[arch])
     22 file('bin/u-config', '755', '$outdir/u-config')
     23 sym('bin/pkg-config', 'u-config')
     24 man({'u-config.1'})
     25 
     26 fetch('git')