mirror of
https://git.proxmox.com/git/libgit2
synced 2025-11-02 19:15:06 +00:00
Change to waf as the buildsystem
Signed-off-by: Vicent Marti <tanoku@gmail.com>
This commit is contained in:
parent
30b171a185
commit
357547fa12
70
wscript
Normal file
70
wscript
Normal file
@ -0,0 +1,70 @@
|
||||
CFLAGS = ["-g", "-O2", "-Wall", "-Wextra"]
|
||||
|
||||
def options(opt):
|
||||
opt.load('compiler_c')
|
||||
opt.add_option('--sha1', action='store', default='builtin', help='TODO')
|
||||
|
||||
def configure(conf):
|
||||
conf.load('compiler_c')
|
||||
|
||||
if conf.options.sha1 not in ['openssh', 'ppc', 'builtin']:
|
||||
ctx.fatal('Invalid SHA1 option')
|
||||
|
||||
conf.env.sha1 = conf.options.sha1
|
||||
|
||||
|
||||
def build(bld):
|
||||
import glob, sys
|
||||
|
||||
sources = glob.glob('src/*.c')
|
||||
flags = CFLAGS
|
||||
defines = []
|
||||
visibility = True
|
||||
os = 'unix'
|
||||
|
||||
if sys.platform == 'win32':
|
||||
# windows configuration
|
||||
flags = flags + ['-TC', '-W4', '-RTC1', '-Zi']
|
||||
defines = defines = ['WIN32', '_DEBUG', '_LIB']
|
||||
visibility = False
|
||||
os = 'win32'
|
||||
|
||||
elif sys.platform == 'cygwin':
|
||||
visibility = False
|
||||
|
||||
elif sys.platform == 'mingw': # TODO
|
||||
pass
|
||||
|
||||
if bld.env.sha1 == "openssh":
|
||||
defines.append('OPENSSL_SHA1')
|
||||
|
||||
elif bld.env.sha1 == "ppc":
|
||||
defines.append('PPC_SHA1')
|
||||
sources.append('src/ppc/sha1.c')
|
||||
|
||||
else:
|
||||
sources.append('src/block-sha1/sha1.c')
|
||||
|
||||
if not visibility:
|
||||
flags.append('-fvisibility=hidden')
|
||||
|
||||
sources = sources + glob.glob('src/%s/*.c' % os)
|
||||
|
||||
bld.stlib(
|
||||
source=sources,
|
||||
target='git2',
|
||||
includes='src',
|
||||
cflags=flags,
|
||||
defines=defines
|
||||
)
|
||||
|
||||
bld.shlib(
|
||||
source=sources,
|
||||
target='git2',
|
||||
includes='src',
|
||||
cflags=flags,
|
||||
defines=defines
|
||||
)
|
||||
|
||||
bld.install_files('${PREFIX}/include/git', glob.glob('src/git/*.h'))
|
||||
|
||||
Loading…
Reference in New Issue
Block a user