diff --git a/server/docker-base/Dockerfile b/server/docker-base/Dockerfile index 67f5cc9c..e7c4affe 100644 --- a/server/docker-base/Dockerfile +++ b/server/docker-base/Dockerfile @@ -1,5 +1,6 @@ FROM ubuntu:16.04 + # Base stuff RUN \ dpkg --add-architecture i386 && \ @@ -27,43 +28,14 @@ RUN \ rm -rf /var/lib/apt/lists/* && \ rm -rf /var/cache/oracle-jdk8-installer -# Android SDK/NDK -ENV ANDROID_ROOT /opt/android -ENV ANDROID_SDK_FILENAME android-sdk_r24.3.3-linux.tgz -ENV ANDROID_SDK_URL http://dl.google.com/android/${ANDROID_SDK_FILENAME} -ENV ANDROID_BUILD_TOOLS_VERSION 23.0.2 -ENV ANDROID_HOME ${ANDROID_ROOT}/android-sdk-linux -ENV ANDROID_NDK_VERSION 10e -ENV ANDROID_NDK_API_VERSION 14 -ENV ANDROID_TARGET_API_LEVEL 23 -ENV ANDROID_MIN_API_LEVEL 9 -ENV ANDROID_GCC_VERSION 4.8 -ENV ANDROID_NDK_PATH ${ANDROID_ROOT}/android-ndk-r${ANDROID_NDK_VERSION} -ENV ANDROID_NDK_INCLUDE ${ANDROID_ROOT}/tmp/android-ndk-r${ANDROID_NDK_VERSION}/platforms/android-${ANDROID_NDK_API_VERSION}/arch-arm/usr/include -ENV ANDROID_STL_INCLUDE ${ANDROID_ROOT}/android-ndk-r${ANDROID_NDK_VERSION}/sources/cxx-stl/gnu-libstdc++/${ANDROID_GCC_VERSION}/include -ENV ANDROID_STL_ARCH_INCLUDE ${ANDROID_ROOT}/android-ndk-r${ANDROID_NDK_VERSION}/sources/cxx-stl/gnu-libstdc++/${ANDROID_GCC_VERSION}/libs/armeabi-v7a/include -ENV ANDROID_STL_LIB ${ANDROID_ROOT}/android-ndk-r${ANDROID_NDK_VERSION}/sources/cxx-stl/gnu-libstdc++/${ANDROID_GCC_VERSION}/libs/armeabi-v7a -ENV ANDROID_SYSROOT ${ANDROID_ROOT}/android-ndk-r${ANDROID_NDK_VERSION}/platforms/android-${ANDROID_NDK_API_VERSION}/arch-arm -ENV ANDROID_BIN_PATH ${ANDROID_ROOT}/android-ndk-r${ANDROID_NDK_VERSION}/toolchains/arm-linux-androideabi-${ANDROID_GCC_VERSION}/prebuilt/linux-x86_64/bin -ENV ANDROID_SDK_BUILD_TOOLS_PATH ${ANDROID_ROOT}/android-sdk/build-tools/${ANDROID_BUILD_TOOLS_VERSION} +# Add extender user +RUN useradd -r -u 2222 extender && \ + mkdir -p /var/extender && \ + chown extender: /var/extender && \ + chown extender: $(readlink -f /usr/bin/java) && \ + chmod +s $(readlink -f /usr/bin/java) -ENV PATH ${PATH}:${ANDROID_HOME}/tools:${ANDROID_HOME}/platform-tools:${ANDROID_BIN_PATH}:${ANDROID_SDK_BUILD_TOOLS_PATH} - -ENV ANDROID_NDK_FILENAME android-ndk-r${ANDROID_NDK_VERSION}-linux-x86_64.zip -ENV ANDROID_NDK_URL https://dl.google.com/android/repository/${ANDROID_NDK_FILENAME} - -RUN mkdir -p cd ${ANDROID_ROOT} && \ - cd ${ANDROID_ROOT} && \ - wget -q -O - ${ANDROID_SDK_URL} | tar -zxvf - && \ - echo y | android update sdk --no-ui -a --filter tools,platform-tools,android-${ANDROID_TARGET_API_LEVEL},build-tools-${ANDROID_BUILD_TOOLS_VERSION} && \ - ln -s android-sdk-linux android-sdk && \ - wget -q ${ANDROID_NDK_URL} && \ - chmod +x ${ANDROID_NDK_FILENAME} && \ - unzip ${ANDROID_NDK_FILENAME} && \ - chmod +r -R ${ANDROID_ROOT} && \ - rm ${ANDROID_NDK_FILENAME} && \ - chmod -R 755 ${ANDROID_ROOT}/android-ndk-r${ANDROID_NDK_VERSION} ENV S3_URL https://s3-eu-west-1.amazonaws.com/defold-packages @@ -119,6 +91,10 @@ RUN \ apt-get remove -y git cmake +# +# iOS + OSX +# + # Keeping iOS 9.3 and MaxOSX 10.11 around for a few weeks (should also remove iPhoneOS.sdk folder) RUN \ wget -q -O - ${S3_URL}/iPhoneOS9.3.sdk.tar.gz | tar xz -C /opt && \ @@ -136,8 +112,10 @@ RUN \ ln -s /usr/local/bin/clang /usr/local/bin/x86_64-apple-darwin12-clang && \ ln -s /usr/local/bin/llvm-ar /usr/local/bin/x86_64-apple-darwin12-clang-ar - +# # EMSCRIPTEN +# + RUN apt-get install -y --no-install-recommends python2.7 && \ ln -s /usr/bin/python2.7 /usr/local/bin/python && \ ln -s /usr/bin/python2.7 /usr/local/bin/python2 @@ -163,8 +141,10 @@ RUN \ echo TEMP_DIR = \'/var/extender/builds\' >> ${EMSCRIPTEN_CONFIG} && \ chmod -R 755 ${EMSCRIPTEN_HOME} - +# # Windows +# + RUN \ apt-get install apt-transport-https @@ -204,6 +184,8 @@ ENV WINEPREFIX "/var/extender/.wine" # Also, for the installed packages, create symlinks without spaces in the paths! # Once we run wine, the folder is created for the root user, this needs to be chown'ed back to the extender user (see next Dockerfile) +USER extender + RUN \ mkdir -p ${WINEPREFIX} && \ wine cmd /c echo Initialized Wine folder && \ @@ -216,3 +198,65 @@ RUN \ wget -q -O - ${S3_URL}/Microsoft-Visual-Studio-14-0.tar.gz | tar xz -C ${WINEPREFIX}/drive_c/ProgramFilesx86 && \ ln -s ${WINEPREFIX}/drive_c/ProgramFilesx86/Microsoft\ Visual\ Studio\ 14.0 ${WINEPREFIX}/drive_c/ProgramFilesx86/MicrosoftVisualStudio14.0 +USER root + +RUN apt-get update && \ + apt-get install -y \ + gcc-multilib \ + g++-multilib + +# +# Android SDK/NDK +# +ENV ANDROID_ROOT /opt/android +ENV ANDROID_TOOLS_FILENAME sdk-tools-linux-3859397.zip +ENV ANDROID_TOOLS_URL https://dl.google.com/android/repository/${ANDROID_TOOLS_FILENAME} + +ENV ANDROID_BUILD_TOOLS_VERSION 23.0.2 +ENV ANDROID_HOME ${ANDROID_ROOT}/android-sdk-linux + +ENV ANDROID_NDK_VERSION 10e +ENV ANDROID_NDK_API_VERSION 14 +ENV ANDROID_TARGET_API_LEVEL 23 +ENV ANDROID_MIN_API_LEVEL 9 +ENV ANDROID_GCC_VERSION 4.8 +ENV ANDROID_NDK_PATH ${ANDROID_ROOT}/android-ndk-r${ANDROID_NDK_VERSION} +ENV ANDROID_NDK_INCLUDE ${ANDROID_ROOT}/tmp/android-ndk-r${ANDROID_NDK_VERSION}/platforms/android-${ANDROID_NDK_API_VERSION}/arch-arm/usr/include +ENV ANDROID_STL_INCLUDE ${ANDROID_ROOT}/android-ndk-r${ANDROID_NDK_VERSION}/sources/cxx-stl/gnu-libstdc++/${ANDROID_GCC_VERSION}/include +ENV ANDROID_STL_ARCH_INCLUDE ${ANDROID_ROOT}/android-ndk-r${ANDROID_NDK_VERSION}/sources/cxx-stl/gnu-libstdc++/${ANDROID_GCC_VERSION}/libs/armeabi-v7a/include +ENV ANDROID_STL_LIB ${ANDROID_ROOT}/android-ndk-r${ANDROID_NDK_VERSION}/sources/cxx-stl/gnu-libstdc++/${ANDROID_GCC_VERSION}/libs/armeabi-v7a +ENV ANDROID_SYSROOT ${ANDROID_ROOT}/android-ndk-r${ANDROID_NDK_VERSION}/platforms/android-${ANDROID_NDK_API_VERSION}/arch-arm +ENV ANDROID_BIN_PATH ${ANDROID_ROOT}/android-ndk-r${ANDROID_NDK_VERSION}/toolchains/arm-linux-androideabi-${ANDROID_GCC_VERSION}/prebuilt/linux-x86_64/bin +ENV ANDROID_SDK_BUILD_TOOLS_PATH ${ANDROID_HOME}/build-tools/${ANDROID_BUILD_TOOLS_VERSION} + +ENV PATH ${PATH}:${ANDROID_HOME}/tools:${ANDROID_HOME}/platform-tools:${ANDROID_BIN_PATH}:${ANDROID_SDK_BUILD_TOOLS_PATH} + +ENV ANDROID_NDK_FILENAME android-ndk-r${ANDROID_NDK_VERSION}-linux-x86_64.zip +ENV ANDROID_NDK_URL https://dl.google.com/android/repository/${ANDROID_NDK_FILENAME} + +RUN mkdir -p ${ANDROID_HOME} && \ + cd ${ANDROID_ROOT} && \ + wget -q ${ANDROID_NDK_URL} && \ + chmod +x ${ANDROID_NDK_FILENAME} && \ + unzip -q ${ANDROID_NDK_FILENAME} && \ + chmod +r -R ${ANDROID_ROOT} && \ + rm ${ANDROID_NDK_FILENAME} && \ + chmod -R 755 ${ANDROID_ROOT}/android-ndk-r${ANDROID_NDK_VERSION} && \ + cd ${ANDROID_HOME} && \ + echo ${ANDROID_TOOLS_URL} && \ + wget ${ANDROID_TOOLS_URL} && \ + unzip -q ${ANDROID_TOOLS_FILENAME} && \ + rm ${ANDROID_TOOLS_FILENAME} && \ + chown -R extender: ${ANDROID_HOME} + +# The sdk manager wants user access folder +USER extender +RUN cd ${ANDROID_HOME} && \ + echo y | ./tools/bin/sdkmanager --verbose "tools" "platform-tools" "platforms;android-${ANDROID_TARGET_API_LEVEL}" "build-tools;${ANDROID_BUILD_TOOLS_VERSION}" && \ + # make sure it exists! + ls -la ./build-tools/${ANDROID_BUILD_TOOLS_VERSION}/dx + +# Remove the rights again from the extender user +USER root +RUN cd ${ANDROID_HOME} && \ + chown -R root: ${ANDROID_HOME} diff --git a/server/docker/Dockerfile b/server/docker/Dockerfile index cebfd9d8..1ec97c05 100644 --- a/server/docker/Dockerfile +++ b/server/docker/Dockerfile @@ -1,13 +1,5 @@ FROM extender-base -RUN \ - useradd -r -u 2222 extender && \ - mkdir -p /var/extender && \ - chown extender: /var/extender && \ - chown extender: $(readlink -f /usr/bin/java) && \ - chmod +s $(readlink -f /usr/bin/java) && \ - chown -R extender:extender ${WINEPREFIX} - USER extender ADD extender-0.1.0.jar app.jar diff --git a/server/test-data/build-libs.sh b/server/test-data/build-libs.sh index c3d16c67..a7ba3f08 100755 --- a/server/test-data/build-libs.sh +++ b/server/test-data/build-libs.sh @@ -31,15 +31,17 @@ function Copy { CompileLibsToExtension enginelibs engineext/lib -# # copy these into the "a" sdk +# copy these into the "a" sdk mkdir -p sdk/a/defoldsdk/lib -cp -v -r engineext/lib/ sdk/a/defoldsdk/lib +cp -v -r engineext/lib sdk/a/defoldsdk/ rm -rf ./engineext -# # The sdk's has different naming +# The sdk's has different naming mv sdk/a/defoldsdk/lib/x86-osx sdk/a/defoldsdk/lib/darwin mv sdk/a/defoldsdk/lib/x86_64-osx sdk/a/defoldsdk/lib/x86_64-darwin +mv sdk/a/defoldsdk/lib/x86-linux sdk/a/defoldsdk/lib/linux + # Need these folders as well (empty is fine) mkdir -p sdk/a/defoldsdk/ext/lib/darwin mkdir -p sdk/a/defoldsdk/ext/lib/x86_64-darwin diff --git a/server/test-data/compile.sh b/server/test-data/compile.sh index a2ea8ce4..f7bc4ff2 100755 --- a/server/test-data/compile.sh +++ b/server/test-data/compile.sh @@ -15,6 +15,8 @@ EMAR=$DYNAMO_HOME/ext/bin/emsdk_portable/emscripten/1.35.0/emar WIN32_CL=cl.exe WIN32_LIB=lib.exe +LINUX_GCC=/usr/bin/g++ +LINUX_AR=/usr/bin/ar function RemoveTarget { @@ -147,6 +149,31 @@ function CompileWindows { done } +function CompileLinux { + local name=$1 + local src=$2 + local targetdir=$3 + + archs=( "x86" "x86_64") + for arch in "${archs[@]}" + do + local archname=$arch-linux + local flags="" + if [ "$arch" == "x86" ]; then + flags="-m32" + fi + + local target=$targetdir/$archname/lib$name.a + + RemoveTarget $target + mkdir -p $(dirname $target) + + $LINUX_GCC $flags -fomit-frame-pointer -fno-strict-aliasing -fno-exceptions $src -c -o /tmp/$name-$archname.o + $LINUX_AR rcs $target /tmp/$name-$archname.o + + echo Wrote $target + done +} function Compile { local name=$1 @@ -162,4 +189,7 @@ function Compile { if [ "$(uname)" == "MINGW32_NT-6.2" ]; then CompileWindows $name $src $targetdir fi + if [ "$(uname)" == "Linux" ]; then + CompileLinux $name $src $targetdir + fi } diff --git a/server/test-data/ext/lib/x86-linux/libalib.a b/server/test-data/ext/lib/x86-linux/libalib.a new file mode 100644 index 00000000..970deeaf Binary files /dev/null and b/server/test-data/ext/lib/x86-linux/libalib.a differ diff --git a/server/test-data/ext/lib/x86_64-linux/libalib.a b/server/test-data/ext/lib/x86_64-linux/libalib.a new file mode 100644 index 00000000..c8e3607a Binary files /dev/null and b/server/test-data/ext/lib/x86_64-linux/libalib.a differ diff --git a/server/test-data/ext2/lib/x86-linux/libalib.a b/server/test-data/ext2/lib/x86-linux/libalib.a new file mode 100644 index 00000000..970deeaf Binary files /dev/null and b/server/test-data/ext2/lib/x86-linux/libalib.a differ diff --git a/server/test-data/ext2/lib/x86-linux/libblib.a b/server/test-data/ext2/lib/x86-linux/libblib.a new file mode 100644 index 00000000..ebd7e10d Binary files /dev/null and b/server/test-data/ext2/lib/x86-linux/libblib.a differ diff --git a/server/test-data/ext2/lib/x86_64-linux/libalib.a b/server/test-data/ext2/lib/x86_64-linux/libalib.a new file mode 100644 index 00000000..c8e3607a Binary files /dev/null and b/server/test-data/ext2/lib/x86_64-linux/libalib.a differ diff --git a/server/test-data/ext2/lib/x86_64-linux/libblib.a b/server/test-data/ext2/lib/x86_64-linux/libblib.a new file mode 100644 index 00000000..4b5c05d7 Binary files /dev/null and b/server/test-data/ext2/lib/x86_64-linux/libblib.a differ diff --git a/server/test-data/sdk/a/defoldsdk/extender/build.yml b/server/test-data/sdk/a/defoldsdk/extender/build.yml index 5187d83e..496c7f8c 100644 --- a/server/test-data/sdk/a/defoldsdk/extender/build.yml +++ b/server/test-data/sdk/a/defoldsdk/extender/build.yml @@ -91,6 +91,25 @@ platforms: linkCmd: 'clang++ -arch i386 -target x86_64-apple-darwin12 -isysroot /opt/MacOSX10.12.sdk/ -m32 -O2 -g -mmacosx-version-min=10.7 -o {{tgt}} {{#linkFlags}}{{{.}}} {{/linkFlags}} {{#ext.libPaths}}-L{{{.}}} {{/ext.libPaths}} {{#libs}}-l{{{.}}} {{/libs}} {{#ext.libs}}-l{{{.}}} {{/ext.libs}} {{#ext.frameworkPaths}}-F{{{.}}} {{/ext.frameworkPaths}} {{#ext.frameworks}}-framework {{{.}}} {{/ext.frameworks}} {{#frameworks}}-framework {{{.}}} {{/frameworks}} {{#libPaths}}-L{{{.}}} {{/libPaths}} {{#engineLibs}}-l{{{.}}} {{/engineLibs}} {{#src}}{{{.}}} {{/src}}' libCmd: 'llvm-ar rcs {{tgt}} {{#objs}}{{{.}}} {{/objs}}' + x86_64-osx: + context: + frameworks: [] + engineLibs: ["engine_main", "engine_foo"] + libPaths: ["{{dynamo_home}}/lib/x86_64-darwin", "{{dynamo_home}}/ext/lib/x86_64-darwin", "{{dynamo_home}}/lib/x86_64-osx"] + + exePrefix: '' + exeExt: '' + shlibRe: 'lib(.+)\.dylib' + stlibRe: 'lib(.+)\.a' + writeLibPattern: 'lib%s.a' + writeExePattern: 'dmengine' + sourceRe: '(?i).*(.cpp|.c|.cc|.mm|.m)' + allowedLibs: ['lber','apr-1.0','AVFAudio','netsnmpmibs.25','bsm','form.5.4','tk','QMIParserDynamic','gmalloc','ncurses','heimdal-asn1','iodbcinst','krb5','tidy','curl.4','pmenergy','python2.7','icucore','ecpg','ATCommandStudioDynamic','dtrace_dyld','lzma.5','pcre.0','pgtypes.3.4','pq.5.6','pam.1','netsnmp.5','energytrace','sasl2.2.0.15','python2.6','germantok','cmph','ssh-keychain','xar.1','xml2','pcreposix.0','m','pam.2','apr-1','auto','alias','c++','ipconfig','Match','crypto.35','netsnmpmibs','cups','exslt.0','iodbcinst.2.1.18','pgtypes.3','mx.A','CRFSuite','cupsmime.1','aprutil-1.0','objc.A','edit','crypto.0.9.8','pmsample','des425','gcc_s.10.5','ruby.2.0','crypto.0.9.7','CRFSuite0.12','auditd.0','edit.2','pthread','ecpg.6.5','odfde','tcl8.5','z.1.1.3','netsnmp.5.2.1','cupsppdc.1','util','lapack','extension','ffi','System','iodbcinst.2','dns_services','pcreposix','mx','panel','ldap','readline','IASUnifiedProgress','edit.3','ssl.0.9.7','csfde','python','hunspell-1.2.0.0.0','netsnmp.25','charset.1.0.0','panel.5.4','gssapi_krb5','aprutil-1','cupsimage.2','BSDPClient.A','menu.5.4','info','spindump','marisa','dl','cupsimage','pq.5','com_err','auditd','UniversalAccess','sasl2.2.0.22','ecpg.6','blas','XSEvent','z','form','ktrace','krb5support','DiagnosticMessagesClient','c++abi','expat.1','System_debug','iodbc','tk8.5','Xplugin.1','pcap.A','curl.3','dbm','iconv','ssl','gcc_s.10.4','netsnmp.15.1.2','xar','menu','exslt','odmodule','alias.A','sasl2','charset','sasl2.2','ThaiTokenizer','tidy.A','archive','bz2.1.0.5','netsnmptrapd','ncurses.5.4','pcre','Fosl_dynamic','cblas','pq','System.B_debug','mecab','ipsec.A','ecpg_compat.3.5','f77lapack','cupsppdc','ipsec','netsnmphelpers.25','edit.3.0','tls','z.1.2.5','netsnmp.15','xslt','resolv','sasl2.2.0.1','iconv.2','ecpg_compat','netsnmpagent','krb524','OpenScriptingUtil','dtrace','cupsmime','bz2','AccountPolicyTranslation','netsnmpagent.25','expat','ssl.0.9.8','cups.2','netsnmphelpers','crypto','z.1','netsnmp','sandbox','CoreStorage','util1.0','DHCPServer.A','langid','Match.1','iodbc.2.1.18','xml2.2','quit','prequelite','stdc++.6.0.9','pcap','objc','ecpg_compat.3','ruby','ScreenReader','c++.1','tls.6','System.B','ChineseTokenizer','ssl.35','sqlite3','proc','BSDPClient','k5crypto','network','hunspell-1.2.0','cupscgi.1','sysmon','bz2.1.0','IASAuthReboot','ldap_r','c','termcap','ncurses.5','archive.2','cupscgi','bsm.0','lzma','iconv.2.4.0','xcselect','poll','sandbox.1','gcc_s.1','iodbc.2','curl','Xplugin','krb4','hunspell-1.2','stdc++','netsnmptrapd.25','rpcsvc','pam','clapack','tcl','mecabra','sasl2.2.0.21','resolv.9','compression','charset.1','icucore.A','pgtypes','DHCPServer','systemstats','TelephonyUtilDynamic','ruby.2.0.0','system_notify','system_c','system_secinit','system_dnssd','removefile','system_malloc','system_blocks','copyfile','xpc','mathCommon','unwind','system_platform','dyld','system_network','system_sandbox','dispatch','system_trace','system_info','keymgr','system_kernel','mathCommon.A','system_networkextension','system_coreservices','system_asl','unc','launch','system_coretls','dispatch','system_pthread','system_m','system_configuration','kxld','quarantine','corecrypto','macho','commonCrypto','system_pthread','compiler_rt','cache','sqlite3.0','stdc++.6','xslt.1','mecab.1.0.0','curses','Accelerate','Accounts','AddressBook','AGL','AppKit','AppKitScripting','AppleScriptKit','AppleScriptObjC','ApplicationServices','AudioToolbox','AudioUnit','AudioVideoBridging','Automator','AVFoundation','AVKit','CalendarStore','Carbon','CFNetwork','CloudKit','Cocoa','Collaboration','Contacts','ContactsUI','CoreAudio','CoreAudioKit','CoreBluetooth','CoreData','CoreFoundation','CoreGraphics','CoreImage','CoreLocation','CoreMedia','CoreMediaIO','CoreMIDI','CoreMIDIServer','CoreServices','CoreTelephony','CoreText','CoreVideo','CoreWLAN','CryptoTokenKit','DirectoryService','DiscRecording','DiscRecordingUI','DiskArbitration','DrawSprocket','DVComponentGlue','DVDPlayback','EventKit','ExceptionHandling','FinderSync','ForceFeedback','Foundation','FWAUserLib','GameController','GameKit','GameplayKit','GLKit','GLUT','GSS','Hypervisor','ICADevices','ImageCaptureCore','ImageIO','IMServicePlugIn','InputMethodKit','InstallerPlugins','InstantMessage','IOBluetooth','IOBluetoothUI','IOKit','IOSurface','JavaFrameEmbedding','JavaScriptCore','JavaVM','Kerberos','Kernel','LatentSemanticMapping','LDAP','LocalAuthentication','MapKit','MediaAccessibility','MediaLibrary','MediaToolbox','Message','Metal','MetalKit','ModelIO','MultipeerConnectivity','NetFS','NetworkExtension','NotificationCenter','OpenAL','OpenCL','OpenDirectory','OpenGL','OSAKit','PCSC','Photos','PhotosUI','PreferencePanes','PubSub','Python','QTKit','QuartzCore','Quartz','QuickLook','QuickTime','Ruby','SceneKit','ScreenSaver','ScriptingBridge','Scripting','SecurityFoundation','Security','SecurityInterface','ServiceManagement','Social','SpriteKit','StoreKit','SyncServices','SystemConfiguration','System','Tcl','Tk','TWAIN','vecLib','VideoDecodeAcceleration','VideoToolbox','vmnet','WebKit'] + allowedFlags: ["-ObjC","-ObjC++","-Wa,{{comma_separated_arg}}","-W{{warning}}","-ansi","--ansi","-std-default={{arg}}","-stdlib=(libstdc\\+\\+|libc\\+\\+)","-w","-std=(c89|c99|c\\+\\+0x|c\\+\\+11|c\\+\\+14|c\\+\\+17)","-Wp,{{comma_separated_arg}}","-W{{warning}}","--extra-warnings","--warn-{{warning}}","--warn-={{warning}}","-ferror-limit={{number}}","-O([0-4]?|fast|s|z)"] + compileCmd: 'clang++ -c -arch x86_64 -target x86_64-apple-darwin12 -isysroot /opt/MacOSX10.12.sdk/ -m64 -O2 -g -mmacosx-version-min=10.7 {{#defines}}-D{{{.}}} {{/defines}} {{#flags}}{{{.}}} {{/flags}} {{#ext.includes}}-I{{{.}}} {{/ext.includes}} {{#ext.frameworkPaths}}-F{{{.}}} {{/ext.frameworkPaths}} {{#includes}}-I{{{.}}} {{/includes}} {{src}} -o{{tgt}}' + linkCmd: 'clang++ -arch x86_64 -target x86_64-apple-darwin12 -isysroot /opt/MacOSX10.12.sdk/ -m64 -O2 -g -mmacosx-version-min=10.7 -o {{tgt}} {{#linkFlags}}{{{.}}} {{/linkFlags}} {{#ext.libPaths}}-L{{{.}}} {{/ext.libPaths}} {{#libs}}-l{{{.}}} {{/libs}} {{#ext.libs}}-l{{{.}}} {{/ext.libs}} {{#ext.frameworkPaths}}-F{{{.}}} {{/ext.frameworkPaths}} {{#ext.frameworks}}-framework {{{.}}} {{/ext.frameworks}} {{#frameworks}}-framework {{{.}}} {{/frameworks}} {{#libPaths}}-L{{{.}}} {{/libPaths}} {{#engineLibs}}-l{{{.}}} {{/engineLibs}} {{#src}}{{{.}}} {{/src}}' + libCmd: 'llvm-ar rcs {{tgt}} {{#objs}}{{{.}}} {{/objs}}' + armv7-android: context: engineJars: ["{{dynamo_home}}/share/java/Engine.jar"] @@ -166,3 +185,28 @@ platforms: linkCmd: 'wine link.exe {{#src}}{{{.}}} {{/src}} /OUT:{{tgt}} /NOLOGO /MANIFEST {{#ext.libPaths}}/LIBPATH:{{{.}}} {{/ext.libPaths}} {{#libPaths}}/LIBPATH:{{{.}}} {{/libPaths}} {{#libs}}{{{.}}}.lib {{/libs}} {{#ext.libs}}{{{.}}}.lib {{/ext.libs}} {{#engineLibs}}{{{.}}}.lib {{/engineLibs}}' libCmd: 'wine lib.exe /nologo /OUT:{{tgt}} {{#objs}}{{{.}}} {{/objs}}' mtCmd: 'wine mt.exe /nologo -manifest {{tgt}}.manifest -outputresource:{{tgt}};1' + + x86_64-linux: + context: + engineLibs: ["engine_main", "engine_foo"] + libPaths: ["{{dynamo_home}}/lib/x86_64-linux","{{dynamo_home}}/ext/lib/x86_64-linux"] + includes: ["{{dynamo_home}}/include/x86_64-linux"] + defines: ["DM_PLATFORM_LINUX", "__STDC_LIMIT_MACROS"] + flags: ["-ffloat-store", "-g", "-O2", "-D__STDC_LIMIT_MACROS", "-Wall", "-Werror=format", "-fno-exceptions", "-fPIC"] + linkFlags: [] + libs: [] + # this happens to contain some dynamic engine libs too (vpx+openal) + dynamicLibs: ["openal","Xext","X11","Xi","GL","GLU","pthread","m","dl"] + + exePrefix: '' + exeExt: '' + shlibRe: 'lib(.+).so' + stlibRe: 'lib(.+).a' + sourceRe: '(?i).*(\.cpp|\.c|\.cc|\.cxx|\.c\+\+)' + writeLibPattern: 'lib%s.a' + writeExePattern: 'dmengine' + allowedLibs: ["sotruss-lib","IBM871","CP1256","SJIS","IBM865","CWI","BRF","CP772","IBM933","CP774","VISCII","IBM420","UTF-7","IBM423","IBM891","IBM939","IBM4909","T.61","JISX0213","IBM930","IBM851","IBM1155","IBM4517","ISO_6937-2","IBM275","IBM856","NATS-DANO","RK1048","EBCDIC-FR","HP-GREEK8","TIS-620","MAC-IS","ISOIR165","MAC-SAMI","CP737","IBM868","LATIN-GREEK","PT154","IBM1162","EBCDIC-UK","IBM1122","CP1251","IBM284","IBM281","ISO8859-9E","IBM880","IBM862","CP771","EBCDIC-AT-DE-A","IBM918","HP-TURKISH8","IBM1046","IBM866","CP1258","ISO_6937","IBM1124","ISO8859-6","IBM437","IBM500","ISO8859-9","IBM1008_420","EBCDIC-IS-FRISS","INIS-8","CP10007","IBM1163","HP-THAI8","KOI-8","CNS","IBM9448","IBM274","IBM855","TCVN5712-1","IBM866NAV","ISO_11548-1","ISO8859-10","IBM9030","KOI8-T","IBM861","SHIFT_JISX0213","IBM4971","IBM857","IBM875","IBM424","IEC_P27-1","IBM863","UTF-16","KOI8-U","GREEK-CCITT","ISO_5427-EXT","GB18030","ISO8859-11","HP-ROMAN8","ANSI_X3.110","IBM803","EUC-JP-MS","IBM1158","IBM1147","IBM852","UHC","IBM1161","ISO8859-13","IBM1160","TSCII","GBK","IBM1047","UNICODE","ISO8859-15","IBM1129","IBM1130","ISO-2022-CN-EXT","IBM1026","ISO8859-14","ISO8859-7","MACINTOSH","IBM850","IBM904","IBM864","CP1257","ISIRI-3342","ISO8859-3","CP932","EBCDIC-ES-S","IBM937","IBM1132","IBM1144","IBM869","ISO646","EUC-CN","CP1255","IBM1142","CP1253","IBM1140","GEORGIAN-PS","IBM1156","EBCDIC-ES","IBM256","MIK","IBM1008","CP1254","IBM921","JIS","LATIN-GREEK-1","GBGBK","IBM874","IBM1167","IBM1364","ISO-2022-JP","ISO8859-16","ISO8859-5","IBM1123","IBM901","GBBIG5","IBM1153","IBM1112","GOST_19768-74","INIS","IBM037","EBCDIC-DK-NO","IBM902","IBM4899","ISO-2022-JP-3","ARMSCII-8","IBM5347","ISO_5428","IBM932","IBM1149","IBM1388","IBM1164","IBM1146","EBCDIC-PT","IBM903","CP1125","ISO_5427","EBCDIC-FI-SE-A","IBM297","EBCDIC-CA-FR","EBCDIC-FI-SE","EUC-JISX0213","MAC-CENTRALEUROPE","IBM1025","KOI8-RU","EUC-JP","IBM1399","EBCDIC-ES-A","CP775","EBCDIC-DK-NO-A","BIG5","EUC-KR","IBM1166","IBM9066","ISO-2022-CN","ISO8859-2","ISO8859-4","EUC-TW","IBM1137","UTF-32","MAC-UK","IBM1371","EBCDIC-US","IBM285","IBM1390","IBM290","CP773","IBM1145","IBM943","ASMO_449","CP1252","IBM870","IBM277","ISO_10367-BOX","NATS-SEFI","KSC","IBM273","GB","JOHAB","IBM1154","ISO-IR-209","SAMI-WS2","IBM278","GREEK7-OLD","BIG5HKSCS","IBM1143","IBM905","CSN_369103","IBM16804","IBM935","IBM280","ISO_2033","HP-ROMAN9","IBM038","IBM860","GEORGIAN-ACADEMY","INIS-CYRILLIC","ISO8859-8","IBM1004","IBM1148","CP1250","IBM922","ISO8859-1","IBM1133","IBM1097","IBM12712","ISO-2022-KR","IBM1141","IBM1157","EBCDIC-IT","EBCDIC-AT-DE","GREEK7","ECMA-CYRILLIC","DEC-MCS","ISO-IR-197","KOI8-R","CP770","stdbuf","Socket","IO","POSIX","Util","Util","attributes","Cwd","Fcntl","re","Glob","SysV","threads","shared","Socket","B","SDBM_File","Peek","PPPort","IO","Collate","Storable","Piece","HiRes","ODBM_File","POSIX","NDBM_File","SHA","MD5","FieldHash","Util","mro","Langinfo","Util","GDBM_File","attributes","Call","mmap","via","scalar","encoding","Cwd","Dumper","Syslog","Hostname","Opcode","FastCalc","DB_File","Fcntl","Base64","re","EBCDIC","TW","Unicode","CN","Encode","KR","Symbol","JP","Byte","NamedCapture","DosGlob","Glob","Bzip2","Zlib","arybase","db-5.3","v4l2convert","v4l-mplane","v4l1compat","tp6801","sipix_web2","jd11","enigma13","sipix_blink2","samsung","barbie","ricoh","smal","gsmart300","kodak_dc120","konica","sq905","jamcam","kodak_dc210","sony_dscf1","sx330z","mustek","polaroid_pdc320","panasonic_dc1580","panasonic_l859","jl2005a","sonix","spca50x","digigr8","polaroid_pdc640","st2205","pccam300","panasonic_dc1000","panasonic_coolshot","sierra","pentax","largan","dimera3500","adc65","kodak_ez200","mars","polaroid_pdc700","topfield","ax203","ricoh_g3","toshiba_pdrm11","clicksmart310","pccam600","stv0674","dimagev","agfa_cl20","jl2005c","lg_gsm","konica_qm150","iclick","directory","soundvision","fuji","ptp2","canon","kodak_dc3200","sony_dscf55","digita","casio_qv","hp215","aox","kodak_dc240","stv0680","asound_module_ctl_arcam_av","asound_module_pcm_oss","asound_module_ctl_oss","asound_module_pcm_usb_stream","asound_module_pcm_pulse","asound_module_pcm_jack","asound_module_rate_samplerate","asound_module_ctl_pulse","asound_module_conf_pulse","smixer-hda","smixer-ac97","smixer-sbase","asound_module_pcm_speex","asound_module_pcm_vdownmix","asound_module_rate_speexrate","asound_module_pcm_upmix","ptpip","usbdiskdirect","usb1","usbscsi","serial","disk","gsttcp","gstaudiorate","gstogg","gstaudioconvert","gstaudioresample","gsttheora","gstlibvisual","gstcoreelements","gstvideotestsrc","gstgio","gstvorbis","gstvolume","gstencodebin","gstcoretracers","gstaudiotestsrc","gstplayback","gstopus","gsttypefindfunctions","gstvideoscale","gstvideoconvert","gstadder","gstapp","gstsubparse","gstcdparanoia","gstvideorate","nn","pulsecommon-8.0","drm_intel","opcodes-2.26.1-system","Xft","bfd-2.26.1-system","drm_radeon","Mrm","m","X11","rt","util","xcb-xfixes","xshmfence","pthread","expat","dl","X11-xcb","crypto","BrokenLocale","GLw","uuid","mvec","Xm","chil","nuron","cswift","4758cca","padlock","gost","gmp","aep","atalla","sureware","ubsec","capi","xcb-randr","mvec_nonshared","glut","xcb","freetype","fontconfig","xcb-dri3","mcheck","nsl","Xdmcp","drm","elf-0.165","drm_amdgpu","drm_nouveau","xcb-sync","c","resolv","ssl","Xrender","Xi","GLU","Xfixes","Xau","m","xcb-dri2","pthread_nonshared","png12","ieee","xcb-glx","Xext","xcb-render","anl","rpcsvc","SM","c_nonshared","c","ICE","xcb-present","Xt","z","virtio_gpu_dri","i965_dri","i915_dri","vmwgfx_dri","r300_dri","radeon_dri","kms_swrast_dri","r200_dri","swrast_dri","nouveau_dri","nouveau_vieux_dri","radeonsi_dri","r600_dri","g","Uil","Xdamage","Xxf86vm","expatw","xcb-shape","pthread","crypt"] + allowedFlags: ["-Wa,{{comma_separated_arg}}","-W{{warning}}","-ansi","--ansi","-std-default={{arg}}","-stdlib=(libstdc\\+\\+|libc\\+\\+)","-w","-std=(c89|c99|c\\+\\+0x|c\\+\\+11|c\\+\\+14|c\\+\\+17)","-Wp,{{comma_separated_arg}}","-W{{warning}}","--extra-warnings","--warn-{{warning}}","--warn-={{warning}}","-ferror-limit={{number}}","-O([0-4]?|fast|s|z)"] + compileCmd: '/usr/bin/g++ {{#defines}}-D{{{.}}} {{/defines}} {{#flags}}{{{.}}} {{/flags}} {{#ext.includes}}-I{{{.}}} {{/ext.includes}} {{#includes}}-I{{{.}}} {{/includes}} {{src}} -c -o {{tgt}}' + linkCmd: '/usr/bin/g++ {{#src}}{{{.}}} {{/src}} -o {{tgt}} {{#linkFlags}}{{{.}}} {{/linkFlags}} {{#ext.libPaths}}-L{{{.}}} {{/ext.libPaths}} {{#libPaths}}-L{{{.}}} {{/libPaths}} -Wl,-Bstatic {{#ext.libs}}-l{{{.}}} {{/ext.libs}} {{#engineLibs}}-l{{{.}}} {{/engineLibs}} {{#libs}}-l{{{.}}} {{/libs}} -Wl,-Bdynamic {{#dynamicLibs}}-l{{{.}}} {{/dynamicLibs}}' + libCmd: '/usr/bin/ar rcs {{tgt}} {{#objs}}{{.}} {{/objs}}' diff --git a/server/test-data/sdk/a/defoldsdk/lib/x86_64-linux/libengine_foo.a b/server/test-data/sdk/a/defoldsdk/lib/x86_64-linux/libengine_foo.a new file mode 100644 index 00000000..e55967e8 Binary files /dev/null and b/server/test-data/sdk/a/defoldsdk/lib/x86_64-linux/libengine_foo.a differ diff --git a/server/test-data/sdk/a/defoldsdk/lib/x86_64-linux/libengine_main.a b/server/test-data/sdk/a/defoldsdk/lib/x86_64-linux/libengine_main.a new file mode 100644 index 00000000..0788dddb Binary files /dev/null and b/server/test-data/sdk/a/defoldsdk/lib/x86_64-linux/libengine_main.a differ diff --git a/server/test-data/testproject_appmanifest/ext/lib/x86-linux/libalib.a b/server/test-data/testproject_appmanifest/ext/lib/x86-linux/libalib.a new file mode 100644 index 00000000..c4161832 Binary files /dev/null and b/server/test-data/testproject_appmanifest/ext/lib/x86-linux/libalib.a differ diff --git a/server/test-data/testproject_appmanifest/ext/lib/x86_64-linux/libalib.a b/server/test-data/testproject_appmanifest/ext/lib/x86_64-linux/libalib.a new file mode 100644 index 00000000..fa976c24 Binary files /dev/null and b/server/test-data/testproject_appmanifest/ext/lib/x86_64-linux/libalib.a differ diff --git a/server/test-data/testproject_appmanifest/ext2/lib/x86-linux/libblib.a b/server/test-data/testproject_appmanifest/ext2/lib/x86-linux/libblib.a new file mode 100644 index 00000000..fbd4fdd7 Binary files /dev/null and b/server/test-data/testproject_appmanifest/ext2/lib/x86-linux/libblib.a differ diff --git a/server/test-data/testproject_appmanifest/ext2/lib/x86_64-linux/libblib.a b/server/test-data/testproject_appmanifest/ext2/lib/x86_64-linux/libblib.a new file mode 100644 index 00000000..580098f8 Binary files /dev/null and b/server/test-data/testproject_appmanifest/ext2/lib/x86_64-linux/libblib.a differ