< prev index next >

buildSrc/linux.gradle

Print this page
rev 11154 : imported patch 12.patch


  25 
  26 ext.LINUX = [:]
  27 
  28 // Declare whether this particular target file applies to the current system
  29 LINUX.canBuild = IS_LINUX;
  30 if (!LINUX.canBuild) return;
  31 
  32 // All desktop related packages should be built
  33 LINUX.compileSwing = true;
  34 LINUX.compileSWT = true;
  35 
  36 // Libraries end up in the lib/$OS_ARCH directory for Linux
  37 LINUX.libDest = "lib"
  38 
  39 // Lambda for naming the generated libs
  40 LINUX.library = { name -> return "lib${name}.so" as String }
  41 
  42 // A set of common parameters to use for both compiling and linking
  43 def commonFlags = [
  44         "-fno-strict-aliasing", "-fPIC", "-fno-omit-frame-pointer", // optimization flags

  45         "-Wextra", "-Wall", "-Wformat-security", "-Wno-unused", "-Wno-parentheses", "-Werror=implicit-function-declaration"] // warning flags
  46 
  47 if (!IS_64) {
  48     commonFlags += "-m32"
  49 }
  50 
  51 // Specify the compilation parameters and link parameters
  52 def ccFlags = [
  53         commonFlags, "-I$JDK_HOME/include", "-I$JDK_HOME/include/linux", "-c",
  54         "-ffunction-sections", "-fdata-sections",
  55         IS_DEBUG_NATIVE ? ["-ggdb", "-DVERBOSE"] : ["-O2", "-DNDEBUG"]].flatten()
  56 def ccFlagsGTK3 = ccFlags
  57 //ccFlags.addAll(["-Wnon-virtual-dtor", "-Woverloaded-virtual", "-std=c++0x"])
  58 def linkFlags = ["-static-libgcc", "-static-libstdc++", "-shared", commonFlags,

  59                  "-Wl,--gc-sections"].flatten()
  60 
  61 if (IS_DEBUG_NATIVE) {
  62     linkFlags += "-g"
  63 }
  64 
  65 def toolchainDir
  66 if (hasProperty('toolchainDir')) {
  67     toolchainDir = ext.toolchainDir + "/"
  68 } else {
  69     toolchainDir = ""
  70 }
  71 
  72 def gtk2CCFlags = [  ];
  73 def gtk3CCFlags = [ "-Wno-deprecated-declarations" ];
  74 def gtk2LinkFlags = [ ];
  75 def gtk3LinkFlags = [ ];
  76 LINUX.buildGTK3 = true
  77 
  78 // Create $buildDir/linux_tools.properties file and load props from it




  25 
  26 ext.LINUX = [:]
  27 
  28 // Declare whether this particular target file applies to the current system
  29 LINUX.canBuild = IS_LINUX;
  30 if (!LINUX.canBuild) return;
  31 
  32 // All desktop related packages should be built
  33 LINUX.compileSwing = true;
  34 LINUX.compileSWT = true;
  35 
  36 // Libraries end up in the lib/$OS_ARCH directory for Linux
  37 LINUX.libDest = "lib"
  38 
  39 // Lambda for naming the generated libs
  40 LINUX.library = { name -> return "lib${name}.so" as String }
  41 
  42 // A set of common parameters to use for both compiling and linking
  43 def commonFlags = [
  44         "-fno-strict-aliasing", "-fPIC", "-fno-omit-frame-pointer", // optimization flags
  45         "-fstack-protector",
  46         "-Wextra", "-Wall", "-Wformat-security", "-Wno-unused", "-Wno-parentheses", "-Werror=implicit-function-declaration"] // warning flags
  47 
  48 if (!IS_64) {
  49     commonFlags += "-m32"
  50 }
  51 
  52 // Specify the compilation parameters and link parameters
  53 def ccFlags = [
  54         commonFlags, "-I$JDK_HOME/include", "-I$JDK_HOME/include/linux", "-c",
  55         "-ffunction-sections", "-fdata-sections",
  56         IS_DEBUG_NATIVE ? ["-ggdb", "-DVERBOSE"] : ["-O2", "-DNDEBUG"]].flatten()
  57 def ccFlagsGTK3 = ccFlags
  58 //ccFlags.addAll(["-Wnon-virtual-dtor", "-Woverloaded-virtual", "-std=c++0x"])
  59 def linkFlags = ["-static-libgcc", "-static-libstdc++", "-shared", commonFlags,
  60                  "-z", "relro",
  61                  "-Wl,--gc-sections"].flatten()
  62 
  63 if (IS_DEBUG_NATIVE) {
  64     linkFlags += "-g"
  65 }
  66 
  67 def toolchainDir
  68 if (hasProperty('toolchainDir')) {
  69     toolchainDir = ext.toolchainDir + "/"
  70 } else {
  71     toolchainDir = ""
  72 }
  73 
  74 def gtk2CCFlags = [  ];
  75 def gtk3CCFlags = [ "-Wno-deprecated-declarations" ];
  76 def gtk2LinkFlags = [ ];
  77 def gtk3LinkFlags = [ ];
  78 LINUX.buildGTK3 = true
  79 
  80 // Create $buildDir/linux_tools.properties file and load props from it


< prev index next >