SConstruct (9420:965d857ac791) SConstruct (9477:d0aacc54cee9)
1# -*- mode:python -*-
2
3# Copyright (c) 2011 Advanced Micro Devices, Inc.
4# Copyright (c) 2009 The Hewlett-Packard Development Company
5# Copyright (c) 2004-2005 The Regents of The University of Michigan
6# All rights reserved.
7#
8# Redistribution and use in source and binary forms, with or without

--- 623 unchanged lines hidden (view full) ---

632# First two words should be "libprotoc x.y.z"
633if len(protoc_version) < 2 or protoc_version[0] != 'libprotoc':
634 print termcap.Yellow + termcap.Bold + \
635 'Warning: Protocol buffer compiler (protoc) not found.\n' + \
636 ' Please install protobuf-compiler for tracing support.' + \
637 termcap.Normal
638 main['PROTOC'] = False
639else:
1# -*- mode:python -*-
2
3# Copyright (c) 2011 Advanced Micro Devices, Inc.
4# Copyright (c) 2009 The Hewlett-Packard Development Company
5# Copyright (c) 2004-2005 The Regents of The University of Michigan
6# All rights reserved.
7#
8# Redistribution and use in source and binary forms, with or without

--- 623 unchanged lines hidden (view full) ---

632# First two words should be "libprotoc x.y.z"
633if len(protoc_version) < 2 or protoc_version[0] != 'libprotoc':
634 print termcap.Yellow + termcap.Bold + \
635 'Warning: Protocol buffer compiler (protoc) not found.\n' + \
636 ' Please install protobuf-compiler for tracing support.' + \
637 termcap.Normal
638 main['PROTOC'] = False
639else:
640 # Determine the appropriate include path and library path using
641 # pkg-config, that means we also need to check for pkg-config
642 if not readCommand(['pkg-config', '--version'], exception=''):
643 print 'Error: pkg-config not found. Please install and retry.'
644 Exit(1)
645
646 main.ParseConfig('pkg-config --cflags --libs-only-L protobuf')
647
648 # Based on the availability of the compress stream wrappers,
649 # require 2.1.0
650 min_protoc_version = '2.1.0'
651 if compareVersions(protoc_version[1], min_protoc_version) < 0:
640 # Based on the availability of the compress stream wrappers,
641 # require 2.1.0
642 min_protoc_version = '2.1.0'
643 if compareVersions(protoc_version[1], min_protoc_version) < 0:
652 print 'Error: protoc version', min_protoc_version, 'or newer required.'
653 print ' Installed version:', protoc_version[1]
654 Exit(1)
644 print termcap.Yellow + termcap.Bold + \
645 'Warning: protoc version', min_protoc_version, \
646 'or newer required.\n' + \
647 ' Installed version:', protoc_version[1], \
648 termcap.Normal
649 main['PROTOC'] = False
650 else:
651 # Attempt to determine the appropriate include path and
652 # library path using pkg-config, that means we also need to
653 # check for pkg-config. Note that it is possible to use
654 # protobuf without the involvement of pkg-config. Later on we
655 # check go a library config check and at that point the test
656 # will fail if libprotobuf cannot be found.
657 if readCommand(['pkg-config', '--version'], exception=''):
658 try:
659 # Attempt to establish what linking flags to add for protobuf
660 # using pkg-config
661 main.ParseConfig('pkg-config --cflags --libs-only-L protobuf')
662 except:
663 print termcap.Yellow + termcap.Bold + \
664 'Warning: pkg-config could not get protobuf flags.' + \
665 termcap.Normal
655
656# Check for SWIG
657if not main.has_key('SWIG'):
658 print 'Error: SWIG utility not found.'
659 print ' Please install (see http://www.swig.org) and retry.'
660 Exit(1)
661
662# Check for appropriate SWIG version

--- 178 unchanged lines hidden (view full) ---

841# development libraries. If the check passes, libprotobuf will be
842# automatically added to the LIBS environment variable. After
843# this, we can use the HAVE_PROTOBUF flag to determine if we have
844# got both protoc and libprotobuf available.
845main['HAVE_PROTOBUF'] = main['PROTOC'] and \
846 conf.CheckLibWithHeader('protobuf', 'google/protobuf/message.h',
847 'C++', 'GOOGLE_PROTOBUF_VERIFY_VERSION;')
848
666
667# Check for SWIG
668if not main.has_key('SWIG'):
669 print 'Error: SWIG utility not found.'
670 print ' Please install (see http://www.swig.org) and retry.'
671 Exit(1)
672
673# Check for appropriate SWIG version

--- 178 unchanged lines hidden (view full) ---

852# development libraries. If the check passes, libprotobuf will be
853# automatically added to the LIBS environment variable. After
854# this, we can use the HAVE_PROTOBUF flag to determine if we have
855# got both protoc and libprotobuf available.
856main['HAVE_PROTOBUF'] = main['PROTOC'] and \
857 conf.CheckLibWithHeader('protobuf', 'google/protobuf/message.h',
858 'C++', 'GOOGLE_PROTOBUF_VERIFY_VERSION;')
859
849# If we have the compiler but not the library, treat it as an error.
860# If we have the compiler but not the library, print another warning.
850if main['PROTOC'] and not main['HAVE_PROTOBUF']:
861if main['PROTOC'] and not main['HAVE_PROTOBUF']:
851 print 'Error: did not find protocol buffer library and/or headers.'
852 print ' Please install libprotobuf-dev and try again.'
853 Exit(1)
862 print termcap.Yellow + termcap.Bold + \
863 'Warning: did not find protocol buffer library and/or headers.\n' + \
864 ' Please install libprotobuf-dev for tracing support.' + \
865 termcap.Normal
854
855# Check for librt.
856have_posix_clock = \
857 conf.CheckLibWithHeader(None, 'time.h', 'C',
858 'clock_nanosleep(0,0,NULL,NULL);') or \
859 conf.CheckLibWithHeader('rt', 'time.h', 'C',
860 'clock_nanosleep(0,0,NULL,NULL);')
861

--- 308 unchanged lines hidden ---
866
867# Check for librt.
868have_posix_clock = \
869 conf.CheckLibWithHeader(None, 'time.h', 'C',
870 'clock_nanosleep(0,0,NULL,NULL);') or \
871 conf.CheckLibWithHeader('rt', 'time.h', 'C',
872 'clock_nanosleep(0,0,NULL,NULL);')
873

--- 308 unchanged lines hidden ---