- sys.exit(-1)
-
-#
-# Version and Copyright
-#
-VersionNumber = "0.01"
-__version__ = "%prog Version " + VersionNumber
-__copyright__ = "Copyright (c) 2008 - 2010, Intel Corporation. All rights reserved."
-
-class Config:
- """class Config
-
- Stores the configuration options for the rest of the script.
-
- Handles the command line options, and allows the code within
- the script to easily interact with the 'config' requested by
- the user.
- """
-
- def __init__(self):
- self.base_dir = os.getcwd()
- (self.options, self.args) = self.CheckOptions()
- self.__init_dirs__()
-
- def CheckOptions(self):
- Parser = \
- OptionParser(
- description=__copyright__,
- version=__version__,
- prog="mingw-gcc-build",
- usage="%prog [options] [target]"
- )
- Parser.add_option(
- "--arch",
- action = "store", type = "string",
- default = '',
- dest = "arch",
- help = "Processor architecture to build gcc for."
- )
- Parser.add_option(
- "--src-dir",
- action = "store", type = "string", dest = "src_dir",
- default = os.path.join(self.base_dir, 'src'),
- help = "Directory to download/extract binutils/gcc sources"
- )
- Parser.add_option(
- "--build-dir",
- action = "store", type = "string", dest = "build_dir",
- default = os.path.join(self.base_dir, 'build'),
- help = "Directory to download/extract binutils/gcc sources"
- )
- Parser.add_option(
- "--prefix",
- action = "store", type = "string", dest = "prefix",
- default = os.path.join(self.base_dir, 'install'),
- help = "Prefix to install binutils/gcc into"
- )
- Parser.add_option(
- "--skip-binutils",
- action = "store_true", dest = "skip_binutils",
- default = False,
- help = "Will skip building binutils"
- )
- Parser.add_option(
- "--skip-gcc",
- action = "store_true", dest = "skip_gcc",
- default = False,
- help = "Will skip building GCC"
- )
- Parser.add_option(
- "--symlinks",
- action = "store", type = "string", dest = "symlinks",
- default = os.path.join(self.base_dir, 'symlinks'),
- help = "Directory to create binutils/gcc symbolic links into."
- )
- Parser.add_option(
- "-v", "--verbose",
- action="store_true",
- type=None, help="Print verbose messages"
- )
-
- (Opt, Args) = Parser.parse_args()
-
- self.arch = Opt.arch.lower()
- allowedArchs = ('ia32', 'x64', 'ipf')
- if self.arch not in allowedArchs:
- Parser.error(
- 'Please use --arch to specify one of: %s' %
- ', '.join(allowedArchs)
- )
- self.target_arch = {'ia32': 'i686', 'x64': 'x86_64', 'ipf': 'ia64'}[self.arch]
- self.target_sys = {'ia32': 'pc', 'x64': 'pc', 'ipf': 'pc'}[self.arch]
- self.target_bin = {'ia32': 'mingw32', 'x64': 'mingw32', 'ipf': 'elf'}[self.arch]
- self.target_combo = '-'.join((self.target_arch, self.target_sys, self.target_bin))
-
- return (Opt, Args)
-
- def __init_dirs__(self):
- self.src_dir = os.path.realpath(os.path.expanduser(self.options.src_dir))
- self.build_dir = os.path.realpath(os.path.expanduser(self.options.build_dir))
- self.prefix = os.path.realpath(os.path.expanduser(self.options.prefix))
- self.symlinks = os.path.realpath(os.path.expanduser(self.options.symlinks))
-
- def IsConfigOk(self):
-
- building = []
- if not self.options.skip_binutils:
- building.append('binutils')
- if not self.options.skip_gcc:
- building.append('gcc')
- if len(building) == 0:
+ sys.exit(-1)\r
+\r
+#\r
+# Version and Copyright\r
+#\r
+VersionNumber = "0.01"\r
+__version__ = "%prog Version " + VersionNumber\r
+__copyright__ = "Copyright (c) 2008 - 2018, Intel Corporation. All rights reserved."\r
+\r
+class Config:\r
+ """class Config\r
+\r
+ Stores the configuration options for the rest of the script.\r
+\r
+ Handles the command line options, and allows the code within\r
+ the script to easily interact with the 'config' requested by\r
+ the user.\r
+ """\r
+\r
+ def __init__(self):\r
+ self.base_dir = os.getcwd()\r
+ (self.options, self.args) = self.CheckOptions()\r
+ self.__init_dirs__()\r
+\r
+ def CheckOptions(self):\r
+ Parser = \\r
+ OptionParser(\r
+ description=__copyright__,\r
+ version=__version__,\r
+ prog="mingw-gcc-build",\r
+ usage="%prog [options] [target]"\r
+ )\r
+ Parser.add_option(\r
+ "--arch",\r
+ action = "store", type = "string",\r
+ default = '',\r
+ dest = "arch",\r
+ help = "Processor architecture to build gcc for."\r
+ )\r
+ Parser.add_option(\r
+ "--src-dir",\r
+ action = "store", type = "string", dest = "src_dir",\r
+ default = os.path.join(self.base_dir, 'src'),\r
+ help = "Directory to download/extract binutils/gcc sources"\r
+ )\r
+ Parser.add_option(\r
+ "--build-dir",\r
+ action = "store", type = "string", dest = "build_dir",\r
+ default = os.path.join(self.base_dir, 'build'),\r
+ help = "Directory to download/extract binutils/gcc sources"\r
+ )\r
+ Parser.add_option(\r
+ "--prefix",\r
+ action = "store", type = "string", dest = "prefix",\r
+ default = os.path.join(self.base_dir, 'install'),\r
+ help = "Prefix to install binutils/gcc into"\r
+ )\r
+ Parser.add_option(\r
+ "--skip-binutils",\r
+ action = "store_true", dest = "skip_binutils",\r
+ default = False,\r
+ help = "Will skip building binutils"\r
+ )\r
+ Parser.add_option(\r
+ "--skip-gcc",\r
+ action = "store_true", dest = "skip_gcc",\r
+ default = False,\r
+ help = "Will skip building GCC"\r
+ )\r
+ Parser.add_option(\r
+ "--symlinks",\r
+ action = "store", type = "string", dest = "symlinks",\r
+ default = os.path.join(self.base_dir, 'symlinks'),\r
+ help = "Directory to create binutils/gcc symbolic links into."\r
+ )\r
+ Parser.add_option(\r
+ "-v", "--verbose",\r
+ action="store_true",\r
+ type=None, help="Print verbose messages"\r
+ )\r
+\r
+ (Opt, Args) = Parser.parse_args()\r
+\r
+ self.arch = Opt.arch.lower()\r
+ allowedArchs = ('ia32', 'x64', 'ipf')\r
+ if self.arch not in allowedArchs:\r
+ Parser.error(\r
+ 'Please use --arch to specify one of: %s' %\r
+ ', '.join(allowedArchs)\r
+ )\r
+ self.target_arch = {'ia32': 'i686', 'x64': 'x86_64', 'ipf': 'ia64'}[self.arch]\r
+ self.target_sys = {'ia32': 'pc', 'x64': 'pc', 'ipf': 'pc'}[self.arch]\r
+ self.target_bin = {'ia32': 'mingw32', 'x64': 'mingw32', 'ipf': 'elf'}[self.arch]\r
+ self.target_combo = '-'.join((self.target_arch, self.target_sys, self.target_bin))\r
+\r
+ return (Opt, Args)\r
+\r
+ def __init_dirs__(self):\r
+ self.src_dir = os.path.realpath(os.path.expanduser(self.options.src_dir))\r
+ self.build_dir = os.path.realpath(os.path.expanduser(self.options.build_dir))\r
+ self.prefix = os.path.realpath(os.path.expanduser(self.options.prefix))\r
+ self.symlinks = os.path.realpath(os.path.expanduser(self.options.symlinks))\r
+\r
+ def IsConfigOk(self):\r
+\r
+ building = []\r
+ if not self.options.skip_binutils:\r
+ building.append('binutils')\r
+ if not self.options.skip_gcc:\r
+ building.append('gcc')\r
+ if len(building) == 0:\r