qt5base-lts/mkspecs/unsupported/android-g++/qmake.conf
Axel Waggershauser 5fcf441392 Fix '=' alignment and replace tabs in *.conf (whitespace only change)
Replace all tabs with proper space characters and consistently align
the '=' characters. The default alignment for the '=' of 25 characters
has been left as is to get a minimal diff. Lines with the '=' further
to the right and those belonging to 'proper code (TM)' have not been
touched.

The work was mostly done using the following python script (might
come in handy again...):

import sys, re
indent_eq = 25 + 0*4 # 25 characters was the most widely used indentation for the '=' character
p = re.compile(r'(\w+)[ \t]*([\-\+]?)(=$|= )[ \t]*(.*$)')

for fn in sys.argv[1:]:
    with open(fn, 'r+') as f:
        lines = []
        nl_count = 0
        continuity_indent = None
        for l in f:
            m = p.match(l)
            nl = l
            if m:
                n_spaces = max(m.start(3), indent_eq - 1) - len(m.group(2)) - len(m.group(1))
                if m.group(2) and m.start(2) >= indent_eq-1 and m.start(2) % 4 == 0:
                    n_spaces -= 1 # left-shift '+=' by one if the '+' is aligned to a multiple of 4
                n_spaces = max(1, n_spaces) # we want at least one space before '='/'+='
                nl = m.group(1) + ' '*n_spaces + ''.join(m.group(2,3,4)) + '\n'
                continuity_indent = nl.find('= ') + 2 if l[-2] == '\\' else None # remember indent on '\\$'
            elif continuity_indent:
                nl = ' '*continuity_indent + l.lstrip()
                if l[-2] != '\\': # check when to stop the continuation
                    continuity_indent = None
            elif l.startswith('#'):
                nl = l.expandtabs(2)
            if l != nl:
                nl_count += 1
            lines.append(nl)
        if nl_count > 0:
            print fn, nl_count, len(lines)
            f.seek(0)
            f.writelines(lines)
            f.truncate()

Change-Id: I1d2870d0a2fe2e30d398c140fe523e69dd20c81b
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
2013-03-27 17:16:37 +01:00

186 lines
8.1 KiB
Plaintext

ANDROID_BUILD_TOP=$$(ANDROID_BUILD_TOP)
isEmpty(ANDROID_BUILD_TOP) : error("$ANDROID_BUILD_TOP is empty. Forgot to run 'lunch'?")
ANDROID_PRODUCT_OUT=$$(ANDROID_PRODUCT_OUT)
isEmpty(ANDROID_PRODUCT_OUT) : error("$ANDROID_PRODUCT_OUT is empty. forgot to run 'lunch'?")
defineReplace(getAndroidBuildVar) {
thevar = $$1
r=$$system(cd $$ANDROID_BUILD_TOP && CALLED_FROM_SETUP=true BUILD_SYSTEM=build/core make --no-print-directory -f build/core/config.mk dumpvar-$${thevar})
return($$r)
}
# .qmake.cache is not available at mkspec loading time.
# not caching those is horribly slow though
!exists($$PWD/android_build_vars) {
store_ANDROID_TOOLCHAIN_PREFIX = "ANDROID_TOOLCHAIN_PREFIX=$$getAndroidBuildVar(abs-TARGET_TOOLS_PREFIX)"
store_ANDROID_TARGET_CFLAGS = "ANDROID_TARGET_CFLAGS=$$getAndroidBuildVar(TARGET_GLOBAL_CFLAGS)"
store_ANDROID_TARGET_LDFLAGS = "ANDROID_TARGET_LDFLAGS=$$getAndroidBuildVar(TARGET_GLOBAL_LDFLAGS)"
store_ANDROID_TARGET_ARCH = "ANDROID_TARGET_ARCH=$$getAndroidBuildVar(TARGET_ARCH)"
store_ANDROID_VERSION = "ANDROID_VERSION=$$getAndroidBuildVar(PLATFORM_VERSION)"
write_file(android_build_vars, store_ANDROID_TOOLCHAIN_PREFIX)
write_file(android_build_vars, store_ANDROID_TARGET_CFLAGS, append)
write_file(android_build_vars, store_ANDROID_TARGET_LDFLAGS, append)
write_file(android_build_vars, store_ANDROID_TARGET_ARCH, append)
write_file(android_build_vars, store_ANDROID_VERSION, append)
}
info(using android build env from cache in $$PWD/android_build_vars . delete this file if you changed your build env )
exists($$PWD/android_build_vars) {
include($$PWD/android_build_vars)
}
ANDROID_VERSION_SPLIT = $$split(ANDROID_VERSION, ".")
ANDROID_VERSION_MAJOR = $$member(ANDROID_VERSION_SPLIT, 0)
ANDROID_VERSION_MINOR = $$member(ANDROID_VERSION_SPLIT, 1)
MAKEFILE_GENERATOR = UNIX
QMAKE_COMPILER = gcc
TARGET_PLATFORM = unix
TEMPLATE = app
QMAKE_INCREMENTAL_STYLE = sublib
include(../../common/linux.conf)
include(../../common/gcc-base-unix.conf)
CONFIG = qt warn_on release link_prl
QT = core gui
DEFINES += HAVE_ANDROID_OS Q_OS_ANDROID_NO_SDK
DEFINES += Q_ANDROID_VERSION_MAJOR=$$ANDROID_VERSION_MAJOR
DEFINES += Q_ANDROID_VERSION_MINOR=$$ANDROID_VERSION_MINOR
DEFINES += QT_NO_PRINTER QT_NO_PRINTDIALOG QT_NO_EXCEPTIONS
#note: -DANDROID results in weird behaviour of math.h
DEFINES += ANDROID
QT_QPA_DEFAULT_PLATFORM = eglfs
EGLFS_PLATFORM_HOOKS_SOURCES = $$PWD/qeglfshooks_surfaceflinger.cpp
EGLFS_PLATFORM_HOOKS_LIBS += -lui -lgui -lutils -lcutils
QMAKE_CC = $${ANDROID_TOOLCHAIN_PREFIX}gcc
QMAKE_CFLAGS = $${ANDROID_TARGET_CFLAGS}
QMAKE_CFLAGS -= -Werror=non-virtual-dtor
QMAKE_CFLAGS -= -DNDEBUG
QMAKE_CFLAGS_WARN_ON = -Wall -Wextra
QMAKE_CFLAGS_WARN_OFF = -Wno-psabi
QMAKE_CFLAGS_SHLIB = -fPIC
QMAKE_CFLAGS_YACC = -Wno-unused -Wno-parentheses
QMAKE_CFLAGS_THREAD = -D_REENTRANT
QMAKE_CFLAGS_HIDESYMS =
QMAKE_CXX = $${ANDROID_TOOLCHAIN_PREFIX}g++
QMAKE_CXXFLAGS = $$QMAKE_CFLAGS
QMAKE_CXXFLAGS_WARN_ON = $$QMAKE_CFLAGS_WARN_ON
QMAKE_CXXFLAGS_WARN_OFF = $$QMAKE_CFLAGS_WARN_OFF
QMAKE_CXXFLAGS_RELEASE += $$QMAKE_CFLAGS_RELEASE
QMAKE_CXXFLAGS_DEBUG += $$QMAKE_CFLAGS_DEBUG
QMAKE_CXXFLAGS_SHLIB = $$QMAKE_CFLAGS_SHLIB
QMAKE_CXXFLAGS_YACC = $$QMAKE_CFLAGS_YACC
QMAKE_CXXFLAGS_THREAD = $$QMAKE_CFLAGS_THREAD
QMAKE_CXXFLAGS_HIDESYMS = $$QMAKE_CFLAGS_HIDESYMS -fvisibility-inlines-hidden
QMAKE_LINK = $$QMAKE_CXX
QMAKE_LINK_SHLIB = $$QMAKE_LINK
QMAKE_AR = $${ANDROID_TOOLCHAIN_PREFIX}ar cqs
QMAKE_OBJCOPY = $${ANDROID_TOOLCHAIN_PREFIX}objcopy
QMAKE_STRIP = $${ANDROID_TOOLCHAIN_PREFIX}strip
QMAKE_RANLIB = $${ANDROID_TOOLCHAIN_PREFIX}ranlib
QMAKE_INCDIR = $${ANDROID_BUILD_TOP} \
$${ANDROID_BUILD_TOP}/dalvik/libnativehelper/include/nativehelper \
$${ANDROID_BUILD_TOP}/bionic \
$${ANDROID_BUILD_TOP}/bionic/libc/include \
$${ANDROID_BUILD_TOP}/bionic/libc/kernel/arch-arm \
$${ANDROID_BUILD_TOP}/bionic/libc/kernel/common \
$${ANDROID_BUILD_TOP}/bionic/libc/private \
$${ANDROID_BUILD_TOP}/bionic/libm/include \
$${ANDROID_BUILD_TOP}/bionic/libm/include/arm \
$${ANDROID_BUILD_TOP}/bionic/libstdc++/include \
$${ANDROID_BUILD_TOP}/bionic/libthread_db/include \
$${ANDROID_BUILD_TOP}/dalvik/libnativehelper/include \
$${ANDROID_BUILD_TOP}/external/icu4c/common/ \
$${ANDROID_BUILD_TOP}/external/icu4c/i18n/ \
$${ANDROID_BUILD_TOP}/external/skia/include \
$${ANDROID_BUILD_TOP}/external/stlport/stlport \
$${ANDROID_BUILD_TOP}/frameworks/include \
$${ANDROID_BUILD_TOP}/frameworks/native/include \
$${ANDROID_BUILD_TOP}/frameworks/native/include/gui \
$${ANDROID_BUILD_TOP}/frameworks/native/opengl/include \
$${ANDROID_BUILD_TOP}/frameworks/base/include \
$${ANDROID_BUILD_TOP}/frameworks/base/native/include \
$${ANDROID_BUILD_TOP}/frameworks/base/opengl/include \
$${ANDROID_BUILD_TOP}/hardware/libhardware/include \
$${ANDROID_BUILD_TOP}/hardware/libhardware_legacy/include \
$${ANDROID_BUILD_TOP}/hardware/ril/include \
$${ANDROID_BUILD_TOP}/system/core/include \
$${ANDROID_BUILD_TOP}/system/core/include/arch/linux-arm/ \
$${ANDROID_PRODUCT_OUT}/obj/include
QMAKE_INCDIR += $${ANDROID_BUILD_TOP}/bionic/libc/arch-$${ANDROID_TARGET_ARCH}/include
QMAKE_LIBDIR = ${ANDROID_PRODUCT_OUT}/obj/lib
QMAKE_INCDIR_X11 =
QMAKE_LIBDIR_X11 =
QMAKE_INCDIR_OPENGL =
QMAKE_INCDIR_OPENGL_ES1 =
QMAKE_LIBDIR_OPENGL_ES1 =
QMAKE_INCDIR_OPENGL_ES2 =
QMAKE_LIBDIR_OPENGL_ES2 =
QMAKE_LINK = $$QMAKE_CXX
QMAKE_LINK_SHLIB = $$QMAKE_CXX
QMAKE_LFLAGS = $${ANDROID_TARGET_LDFLAGS} \
-nostdlib \
-L${ANDROID_PRODUCT_OUT}/obj/lib \
-Wl,-rpath-link,${ANDROID_PRODUCT_OUT}/obj/lib
QMAKE_LFLAGS_PLUGIN = -Wl,-T,${ANDROID_BUILD_TOP}/build/core/armelf.xsc \
-Wl,-shared,-Bsymbolic
#apparantly this file is missing from some builds.
#it does work without, but this may change in future.
#QMAKE_LFLAGS_APP = -Wl,-T,${ANDROID_BUILD_TOP}/build/core/armelf.xs \
QMAKE_LFLAGS_APP = ${ANDROID_PRODUCT_OUT}/obj/lib/crtbegin_dynamic.o \
${ANDROID_PRODUCT_OUT}/obj/lib/crtend_android.o
QMAKE_LFLAGS_SHLIB = -Wl,-T,${ANDROID_BUILD_TOP}/build/core/armelf.xsc \
-Wl,-shared,-Bsymbolic \
${ANDROID_PRODUCT_OUT}/obj/lib/crtbegin_so.o \
${ANDROID_PRODUCT_OUT}/obj/lib/crtend_so.o
QMAKE_LFLAGS_SONAME =
QMAKE_LFLAGS_NOUNDEF = -Wl,--no-undefined
QMAKE_LFLAGS_RPATH = -Wl,-rpath=
QMAKE_LIBS = -lstlport -lstdc++ -llog -lz -lm -ldl -lc -lgcc
QMAKE_LIBS_X11 =
QMAKE_LIBS_X11SM =
QMAKE_LIBS_QT_THREAD =
QMAKE_LIBS_QT_OPENGL =
QMAKE_LIBS_QTOPIA =
QMAKE_LIBS_THREAD =
QMAKE_LIBS_OPENGL =
QMAKE_LIBS_OPENGL_ES1 = -lGLESv1_CM
QMAKE_LIBS_OPENGL_ES2 = -lEGL -lGLESv2 $$QMAKE_LIBS
CONFIG += linux-android-9 android-9 linux-android android android-no-sdk android_app
load(qt_config)
# we don't support exceptions, but right now this has no effect
# you need to manually delete mkspecs/features/exceptions.prf
CONFIG -= exceptions
CONFIG += exceptions_off