LINUX.ORG.RU

Сборка драйвера mysql для android

 , , ,


0

1

Приветствую. Пытаюсь собрать драйвер,чтобы можно было отображать данные из базы mysql в приложении на android. Следовал этой инструкции http://habrahabr.ru/post/134502/. Только ставил не necessistas а Qt5 сразу. Дошел до «Перед сборкой в папке с исходниками нужно создать файл toolchain.cmake, который описывает правила сборки под нужную нам архитектуру. Образец можно скачать, например, здесь: https://github.com/qgis/qgis-android/blob/master/scripts/android.toolchain.cmake, его нужно будет немного модифицировать:

1. В строке set( ANDROID_NDK_DEFAULT_SEARCH_PATH /path/to/android-ndk ) указать путь, по которому расположен Android-ndk. 2. В строке set( ANDROID_NDK_TOOLCHAIN_DEFAULT_SEARCH_PATH /path/to/toolchain ) указать путь, по которому расположен набор инструментов сборки. » и застопорился. Нет таких строк. Может кто собирал уже драйвер другим путем или может мои действия подкорректировать? Дистрибутив ubuntu 12.10

Ответ на: комментарий от alextk

но где прописывать путь в __INIT_VARIABLE( ANDROID_STANDALONE_TOOLCHAIN PATH ENV_ANDROID_STANDALONE_TOOLCHAIN OBSOLETE_ANDROID_NDK_TOOLCHAIN_ROOT OBSOLETE_ENV_ANDROID_NDK_TOOLCHAIN_ROOT ) ?

tiprocop
() автор топика
Ответ на: комментарий от EXL

Я еще мало что понимаю,но если я верно уловил суть,надо в папке с исходниками создавать файл CMakeLists.txt куда записывать это https://github.com/qgis/qgis-android/blob/master/scripts/CMakeLists.txt и писать c соответствующими изменениями и выполнять

export ANDROID_NDK=/full/path/to/necessitas/android-ndk cmake -DCMAKE_TOOLCHAIN_FILE=/path/to/mysql-connector-c-6.0.2/android.cmake make

У меня началась сборка,но вывело ошибки

CMake Error: Error required internal CMake variable not set, cmake may be not be built correctly. Missing variable is: CMAKE_C_COMPILER_ENV_VAR CMake Error: Error required internal CMake variable not set, cmake may be not be built correctly. Missing variable is: CMAKE_C_COMPILER CMake Error: Could not find cmake module file:/opt/mysqlforand/mysql-connector-c-6.1.3-linux-glibc2.5-i686/CMakeFiles/CMakeCCompiler.cmake CMake Error: Error required internal CMake variable not set, cmake may be not be built correctly. Missing variable is: CMAKE_CXX_COMPILER_ENV_VAR CMake Error: Error required internal CMake variable not set, cmake may be not be built correctly. Missing variable is: CMAKE_CXX_COMPILER CMake Error: Could not find cmake module file:/opt/mysqlforand/mysql-connector-c-6.1.3-linux-glibc2.5-i686/CMakeFiles/CMakeCXXCompiler.cmake CMake Error: CMAKE_C_COMPILER not set, after EnableLanguage CMake Error: CMAKE_CXX_COMPILER not set, after EnableLanguage -- Configuring incomplete, errors occurred!

Я так понял,нужно прописать эти переменные в файле CMakeLists.txt и если да,то что там прописывать?

tiprocop
() автор топика
Ответ на: комментарий от tiprocop

Ничего не нужно создавать. Файл CMakeList.txt должен быть уже в исходниках MySQL драйвера. Просто нужно поместить https://github.com/qgis/qgis-android/blob/master/scripts/android.toolchain.cmake в каталог с исходниками и выполнить:

export ANDROID_NDK=/full/path/to/necessitas/android-ndk cmake -DCMAKE_TOOLCHAIN_FILE=/path/to/mysql-connector-c-6.0.2/android.cmake 
make
EXL ★★★★★
()
Ответ на: комментарий от darkenshvein

Ээ, для этого нужен драйвер?

А что не так?

Begemoth ★★★★★
()
Ответ на: комментарий от darkenshvein

Ну,мне кажется,что если текст ошибки выглядит как «Driver not loaded»,то дело в драйвере

tiprocop
() автор топика
Ответ на: комментарий от EXL

Качаю исходники из ссылки в мануале,с оффициального сайта, но в них нет файла CMakeList.txt

tiprocop
() автор топика
Ответ на: комментарий от tiprocop

Блин,вот я тупой. Скачал бинарники вместо исходников

tiprocop
() автор топика
Ответ на: комментарий от EXL

Все начало собираться,но выводит

-- Running cmake version 2.8.9
-- ANDROID_NDK_ABI - armeabi
-- ANDROID_NDK_ABI_EXT - arm-linux-androideabi
-- ANDROID_NDK_ARCH_CFLAGS - -D__ARM_ARCH_5__ -D__ARM_ARCH_5T__ -D__ARM_ARCH_5E__ -D__ARM_ARCH_5TE__ -Wno-psabi -march=armv5te -mtune=xscale -msoft-float -mthumb
-- GCC companion library: sh: 1: /toolchains/arm-linux-androideabi-4.8/prebuilt/linux-x86/bin/arm-linux-androideabi-gcc: not found
-- CMAKE_C_COMPILER: arm-linux-androideabi-gcc
-- CMAKE_CXX_COMPILER: arm-linux-androideabi-g++
-- ANDROID_NDK_SYSROOT: /platforms/android-9/arch-arm
CMake Error: your C compiler: "arm-linux-androideabi-gcc" was not found.   Please set CMAKE_C_COMPILER to a valid compiler path or name.
CMake Error: your CXX compiler: "arm-linux-androideabi-g++" was not found.   Please set CMAKE_CXX_COMPILER to a valid compiler path or name.
CMake Error at cmake/os/Linux.cmake:27 (STRING):
  string sub-command REPLACE requires at least four arguments.
Call Stack (most recent call first):
  CMakeLists.txt:130 (INCLUDE)


CMake Error at cmake/os/Linux.cmake:27 (STRING):
  string sub-command REPLACE requires at least four arguments.
Call Stack (most recent call first):
  CMakeLists.txt:130 (INCLUDE)


-- SIZEOF_VOIDP 
-- LibMySQL 6.1.3
-- Built from MySQL 5.7.4-m14 sources
-- Packaging as: mysql-connector-c-6.1.3-Linux-arm
-- Installing to: /usr/local/mysql
-- Could NOT find Threads (missing:  Threads_FOUND) 
-- Could NOT find Threads (missing:  Threads_FOUND) 
-- Check if the system is big endian
-- Searching 16 bit integer
CMake Error at /usr/share/cmake-2.8/Modules/TestBigEndian.cmake:44 (MESSAGE):
  no suitable type found
Call Stack (most recent call first):
  configure.cmake:597 (TEST_BIG_ENDIAN)
  CMakeLists.txt:414 (INCLUDE)


-- Configuring incomplete, errors occurred!
Пробывал указывать для CMAKE_C_COMPILER прямой путь к arm-linux-androideabi-gcc и для CMAKE_CXX_COMPILER к arm-linux-androideabi-g++ толку - ноль. В чем дело?

tiprocop
() автор топика
Ответ на: комментарий от tiprocop

Значит неправильно указываешь.
Проблема на твоей стороне.
Проверь, вызывается ли компилятор по /toolchains/arm-linux-androideabi-4.8/prebuilt/linux-x86/bin/arm-linux-androideabi-gcc
Если нет, то либо его там вообще нет и ты неправильно задал префикс, либо у тебя x86_64 система, а компилятор для x86.
Сам файл CMakeList.txt править не нужно, правь только android.toolchain.cmake.

EXL ★★★★★
()
Ответ на: комментарий от EXL

Перехожу сюда /toolchains/arm-linux-androideabi-4.8/prebuilt/linux-x86/bin/arm-linux-androideabi-gcc, выполняю

./arm-linux-androideabi-gcc
Вывод
arm-linux-androideabi-gcc: fatal error: no input files
compilation terminated.
Такая же ситуация с g++. Я так понимаю,компилятор вызывается,но что компилировать я ему не указываю,поэтому пишет то,что пишет. Android NDK скачивал для 86_64 следовательно,компиляторы в нем тоже 86_64. Видимо что-то с путем к компилятору. Попробую исправить

tiprocop
() автор топика
Ответ на: комментарий от EXL

Итак,компиляторы нашлись. Теперь новая штука.

-- Running cmake version 2.8.9
-- ANDROID_NDK_ABI - armeabi
-- ANDROID_NDK_ABI_EXT - arm-linux-androideabi
-- ANDROID_NDK_ARCH_CFLAGS - -D__ARM_ARCH_5__ -D__ARM_ARCH_5T__ -D__ARM_ARCH_5E__ -D__ARM_ARCH_5TE__ -Wno-psabi -march=armv5te -mtune=xscale -msoft-float -mthumb
-- GCC companion library: sh: 1: /toolchains/arm-linux-androideabi-4.8/prebuilt/linux-x86/bin/arm-linux-androideabi-gcc: not found
-- CMAKE_C_COMPILER: /opt/android/android_ndk/android-ndk-r9d/toolchains/arm-linux-androideabi-4.8/prebuilt/linux-x86/bin/arm-linux-androideabi-gcc
-- CMAKE_CXX_COMPILER: /opt/android/android_ndk/android-ndk-r9d/toolchains/arm-linux-androideabi-4.8/prebuilt/linux-x86/bin/arm-linux-androideabi-g++
-- ANDROID_NDK_SYSROOT: /platforms/android-9/arch-arm
-- ANDROID_NDK_ABI - armeabi
-- ANDROID_NDK_ABI_EXT - arm-linux-androideabi
-- ANDROID_NDK_ARCH_CFLAGS - -D__ARM_ARCH_5__ -D__ARM_ARCH_5T__ -D__ARM_ARCH_5E__ -D__ARM_ARCH_5TE__ -Wno-psabi -march=armv5te -mtune=xscale -msoft-float -mthumb
-- GCC companion library: sh: 1: /toolchains/arm-linux-androideabi-4.8/prebuilt/linux-x86/bin/arm-linux-androideabi-gcc: not found
-- CMAKE_C_COMPILER: /opt/android/android_ndk/android-ndk-r9d/toolchains/arm-linux-androideabi-4.8/prebuilt/linux-x86/bin/arm-linux-androideabi-gcc
-- CMAKE_CXX_COMPILER: /opt/android/android_ndk/android-ndk-r9d/toolchains/arm-linux-androideabi-4.8/prebuilt/linux-x86/bin/arm-linux-androideabi-g++
-- ANDROID_NDK_SYSROOT: /platforms/android-9/arch-arm
-- The C compiler identification is GNU 4.8.0
-- The CXX compiler identification is GNU 4.8.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - failed
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - failed
-- Looking for SHM_HUGETLB
-- Looking for SHM_HUGETLB - not found.
-- Looking for sys/types.h
-- Looking for sys/types.h - not found
-- Looking for stdint.h
-- Looking for stdint.h - not found
-- Looking for stddef.h
-- Looking for stddef.h - not found
-- Check size of void *
-- Check size of void * - failed
-- SIZEOF_VOIDP 
-- LibMySQL 6.1.3
-- Built from MySQL 5.7.4-m14 sources
-- Packaging as: mysql-connector-c-6.1.3-Linux-arm
-- Installing to: /usr/local/mysql
-- Performing Test HAVE_LLVM_LIBCPP
-- Performing Test HAVE_LLVM_LIBCPP - Failed
-- Looking for floor
-- Looking for floor - not found
-- Looking for floor in m
-- Looking for floor in m - not found
-- Looking for __infinity
-- Looking for __infinity - not found
-- Looking for __infinity in m
-- Looking for __infinity in m - not found
-- Looking for gethostbyname_r
-ot found
-- Looking for clock_gettime in rt
-- Looking for clock_gettime in rt - not found
-- Looking for include file pthread.h
И дальше в том же стиле куча всего,а в конце
CMake Error at /usr/share/cmake-2.8/Modules/TestBigEndian.cmake:44 (MESSAGE):
  no suitable type found
Call Stack (most recent call first):
  configure.cmake:597 (TEST_BIG_ENDIAN)
  CMakeLists.txt:414 (INCLUDE)


-- Configuring incomplete, errors occurred!
это связано с отсутствием этих файлов или это другая ошибка?

tiprocop
() автор топика
Ответ на: комментарий от tiprocop

Проблемы с путями. Теперь хэдеры найти не может, ANDROID_NDK_SYSROOT задан неправильно видимо.

EXL ★★★★★
()
Ответ на: комментарий от tiprocop

Ну а подо что ещё? Ты компилируешь библиотеку для Android? Для Android. Так почему должны использовать какие-то другие компиляторы, кроме тех, что есть в Android NDK?

EXL ★★★★★
()
Ответ на: комментарий от EXL

Теперь половину файлов находит,половину нет. Можете посмотреть,что еще не так в android.toolchain.cmake? Android ndk лежит в /opt/android/android_ndk/android-ndk-r9d

#
# Android NDK toolchain file for CMake
#
# (c) Copyrights 2009-2013 Hartmut Seichter
# 
# Note: this version only targets NDK 9
#
# Warning: early version:
# Supported: GCC 4.8 only! STLport or gnu STL, ARM only
#
# need to know where the NDK resides
#

set(ANDROID_NDK_ROOT "/opt/android/android_ndk/android-ndk-r9d" CACHE PATH "/opt/android/android_ndk/android-ndk-r9d")

set(ANDROID_NDK_TOOLCHAIN_DEBUG ON)

# check host platform
set(ANDROID_NDK_HOST)
if(APPLE)
	set(ANDROID_NDK_HOST "darwin-x86")
elseif(WIN32)
	set(ANDROID_NDK_HOST "windows")
elseif(UNIX)
	set(ANDROID_NDK_HOST "linux-x86")
else()
	message( FATAL_ERROR "Platform not supported" )
endif()

# basic setup
set(CMAKE_CROSSCOMPILING TRUE)
set(CMAKE_SYSTEM_NAME Linux)
SET(CMAKE_SKIP_RPATH ON)

# for convenience
set(ANDROID 1)

# set supported architecture
set(ANDROID_NDK_ARCH_SUPPORTED "arm;armv7;x86")
set(ANDROID_NDK_ARCH "arm" CACHE STRING "Android NDK CPU architecture (${ANDROID_NDK_ARCH_SUPPORTED})")
set_property(CACHE ANDROID_NDK_ARCH PROPERTY STRINGS ${ANDROID_NDK_ARCH_SUPPORTED})

# armeabi / armeabi-v7a / x86
set(ANDROID_NDK_ABI)
set(ANDROID_NDK_ABI_EXT)
set(ANDROID_NDK_GCC_PREFIX)

set(ANDROID_NDK_ARCH_CFLAGS)
set(ANDROID_NDK_ARCH_LDFLAGS)

if("${ANDROID_NDK_ARCH}" STREQUAL "arm" )
	set(CMAKE_SYSTEM_PROCESSOR "arm")
	set(ANDROID_NDK_ABI "armeabi")
	set(ANDROID_NDK_ABI_EXT "arm-linux-androideabi")
	set(ANDROID_NDK_GCC_PREFIX "arm-linux-androideabi")
	set(ANDROID_NDK_ARCH_CFLAGS "-D__ARM_ARCH_5__ -D__ARM_ARCH_5T__ -D__ARM_ARCH_5E__ -D__ARM_ARCH_5TE__ -Wno-psabi -march=armv5te -mtune=xscale -msoft-float -mthumb")
endif()	
if("${ANDROID_NDK_ARCH}" STREQUAL "armv7" )
	set(CMAKE_SYSTEM_PROCESSOR "arm")
	set(ANDROID_NDK_ABI "armeabi-v7a")
	set(ANDROID_NDK_ABI_EXT "arm-linux-androideabi")
	set(ANDROID_NDK_GCC_PREFIX "arm-linux-androideabi")
	set(ANDROID_NDK_ARCH_CFLAGS "-march=armv7-a -mfloat-abi=softfp")
	set(ANDROID_NDK_ARCH_LDFLAGS "-Wl,--fix-cortex-a8")
endif()
if("${ANDROID_NDK_ARCH}" STREQUAL "x86" )
	set(ANDROID_NDK_ABI "x86")
	set(ANDROID_NDK_ABI_EXT "x86")
	set(ANDROID_NDK_GCC_PREFIX "i686-android-linux")
endif()

if(ANDROID_NDK_TOOLCHAIN_DEBUG)
	message(STATUS "ANDROID_NDK_ABI - ${ANDROID_NDK_ABI}")
	message(STATUS "ANDROID_NDK_ABI_EXT - ${ANDROID_NDK_ABI_EXT}")
	message(STATUS "ANDROID_NDK_ARCH_CFLAGS - ${ANDROID_NDK_ARCH_CFLAGS}")
endif()

# global C flags
set(ANDROID_NDK_GLOBAL_CFLAGS "-fpic -fomit-frame-pointer -fno-strict-aliasing -finline-limit=64 -ffunction-sections -funwind-tables -fstack-protector")


# choose NDK STL implementation
set(ANDROID_NDK_STL_SUPPORTED "gnu-libstdc++;stlport;system;gabi++")
set(ANDROID_NDK_STL "stlport" CACHE STRING "Android NDK STL (${ANDROID_NDK_STL_SUPPORTED})")
set_property(CACHE ANDROID_NDK_STL PROPERTY STRINGS ${ANDROID_NDK_STL_SUPPORTED})


# set the Android Platform
set(ANDROID_API_SUPPORTED "android-8;android-9;android-14")
set(ANDROID_API "android-9" CACHE STRING "Android SDK API (${ANDROID_API_SUPPORTED})")
set_property(CACHE ANDROID_API PROPERTY STRINGS ${ANDROID_API_SUPPORTED})

# set sysroot - in Android this in function of Android API and architecture
set(ANDROID_NDK_SYSROOT)
if("${ANDROID_NDK_ARCH}" STREQUAL "arm" OR "${ANDROID_NDK_ARCH}" STREQUAL "armv7" )
	set(ANDROID_NDK_SYSROOT "/opt/android/android_ndk/android-ndk-r9d/platforms/android-9/arch-arm" CACHE PATH "NDK sysroot" FORCE)
elseif("${ANDROID_NDK_ARCH}" STREQUAL "x86")
	set(ANDROID_NDK_SYSROOT "/opt/android/android_ndk/android-ndk-r9d/platforms/android-9/arch-x86" CACHE PATH "NDK sysroot" FORCE)
endif()

set(CMAKE_C_COMPILER_WORKS 1)
set(CMAKE_CXX_COMPILER_WORKS 1)
set(CMAKE_SKIP_COMPATIBILITY_TESTS 1)

# set version
set(ANDROID_NDK_GCC_VERSION "4.8")

# STL
set(ANDROID_NDK_STL_CXXFLAGS)
set(ANDROID_NDK_STL_LIBRARYPATH)
set(ANDROID_NDK_STL_LDFLAGS)

if ("${ANDROID_NDK_STL}" STREQUAL "stlport") 
	set(ANDROID_NDK_STL_CXXFLAGS "-D_STLP_USE_SIMPLE_NODE_ALLOC -D_STLP_NO_EXCEPTIONS  -fno-exceptions -fno-rtti -I${ANDROID_NDK_ROOT}/sources/cxx-stl/${ANDROID_NDK_STL}/stlport") #-D_STLP_USE_NEWALLOC
	set(ANDROID_NDK_STL_LIBRARYPATH "${ANDROID_NDK_ROOT}/sources/cxx-stl/${ANDROID_NDK_STL}/libs/${ANDROID_NDK_ABI}")
	set(ANDROID_NDK_STL_LDFLAGS "-lstdc++")
elseif("${ANDROID_NDK_STL}" STREQUAL "gnu-libstdc++")
	set(ANDROID_NDK_STL_CXXFLAGS "-I${ANDROID_NDK_ROOT}/sources/cxx-stl/${ANDROID_NDK_STL}/${ANDROID_NDK_GCC_VERSION}/include -I${ANDROID_NDK_ROOT}/sources/cxx-stl/${ANDROID_NDK_STL}/${ANDROID_NDK_GCC_VERSION}/libs/${ANDROID_NDK_ABI}/include")
	set(ANDROID_NDK_STL_LIBRARYPATH "${ANDROID_NDK_ROOT}/sources/cxx-stl/${ANDROID_NDK_STL}/${ANDROID_NDK_GCC_VERSION}/libs/${ANDROID_NDK_ABI}")
	set(ANDROID_NDK_STL_LDFLAGS "-lstdc++")
endif()

 

tiprocop
() автор топика
Ответ на: комментарий от tiprocop
# global linker flags
set(ANDROID_NDK_GLOBAL_LDFLAGS "-Wl,--no-undefined -Wl,-z,noexecstack -Wl,--gc-sections -Wl,-z,nocopyreloc")

# get the gcc companion lib
exec_program(
	${ANDROID_NDK_ROOT}/toolchains/${ANDROID_NDK_ABI_EXT}-${ANDROID_NDK_GCC_VERSION}/prebuilt/${ANDROID_NDK_HOST}/bin/${ANDROID_NDK_GCC_PREFIX}-gcc 
	ARGS "-print-libgcc-file-name"
	OUTPUT_VARIABLE ANDROID_NDK_GCC_COMPANIONLIBRARY
	)

get_filename_component(ANDROID_NDK_GCC_COMPANIONLIBRARY_PATH ${ANDROID_NDK_GCC_COMPANIONLIBRARY} PATH)
#set(CMAKE_CXX_IMPLICIT_LINK_DIRECTORIES "${ANDROID_NDK_GCC_COMPANIONLIBRARY_PATH}")

# hack
#add_definitions(-static-libgcc)
#link_libraries(${ANDROID_NDK_GCC_COMPANIONLIBRARY})


# some overrides (see docs/STANDALONE-TOOLCHAIN.html) 
# set(CMAKE_C_FLAGS "-MMD -MP -MF ${ANDROID_NDK_GLOBAL_CFLAGS} ${ANDROID_NDK_GLOBAL_LDFLAGS} --sysroot=${ANDROID_NDK_SYSROOT} -DANDROID ${ANDROID_NDK_ARCH_CFLAGS} ${ANDROID_NDK_ARCH_LDFLAGS} -L${ANDROID_NDK_GCC_COMPANIONLIBRARY_PATH} -nostdlib -landroid -llog -lc -lm -lgcc" CACHE STRING "C flags" FORCE)
# set(CMAKE_CXX_FLAGS "${CMAKE_C_FLAGS} ${ANDROID_NDK_STL_CXXFLAGS} -L${ANDROID_NDK_STL_LIBRARYPATH} ${ANDROID_NDK_STL_LDFLAGS}" CACHE STRING "C++ flags" FORCE)

# libs
# set(CMAKE_SHARED_LINKER_FLAGS "${ANDROID_NDK_GCC_COMPANIONLIBRARY}" CACHE STRING "Linker flags" FORCE)
# set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} ${ANDROID_NDK_GCC_COMPANIONLIBRARY}" CACHE STRING "Linker flags" FORCE)

#message(STATUS "${ANDROID_NDK_GCC_COMPANIONLIBRARY_PATH}")

# set(CMAKE_C_FLAGS "-v ${ANDROID_NDK_GLOBAL_CFLAGS} ${ANDROID_NDK_GLOBAL_LDFLAGS} --sysroot=${ANDROID_NDK_SYSROOT} -DANDROID ${ANDROID_NDK_ARCH_CFLAGS} ${ANDROID_NDK_ARCH_LDFLAGS} -L${ANDROID_NDK_GCC_COMPANIONLIBRARY_PATH} -nostdlib -landroid -llog -lc -lm -lgcc")

#set(CMAKE_C_COMPILER "${ANDROID_NDK_ROOT}/toolchains/${ANDROID_NDK_ABI_EXT}-${ANDROID_NDK_GCC_VERSION}/prebuilt/${ANDROID_NDK_HOST}/bin/${ANDROID_NDK_GCC_PREFIX}-gcc" CACHE PATH "C Compiler")
#set(CMAKE_CXX_COMPILER "${ANDROID_NDK_ROOT}/toolchains/${ANDROID_NDK_ABI_EXT}-${ANDROID_NDK_GCC_VERSION}/prebuilt/${ANDROID_NDK_HOST}/bin/${ANDROID_NDK_GCC_PREFIX}-g++" CACHE PATH "C++ Compiler")
# 
# include(CMakeForceCompiler)
# CMAKE_FORCE_C_COMPILER("${CMAKE_C_COMPILER}" GNU)
# CMAKE_FORCE_CXX_COMPILER("${CMAKE_CXX_COMPILER}" GNU)

set(COMMON_FLAGS "-DANDROID ${CMAKE_C_FLAGS} --sysroot=${ANDROID_NDK_SYSROOT}")

set(CMAKE_C_FLAGS "${COMMON_FLAGS}" CACHE STRING "C Flags" FORCE)
set(CMAKE_CXX_FLAGS "${COMMON_FLAGS} ${ANDROID_NDK_STL_CXXFLAGS} -L${ANDROID_NDK_STL_LIBRARYPATH} ${ANDROID_NDK_STL_LDFLAGS}" CACHE STRING "C++ Flags" FORCE)

set(CMAKE_C_COMPILER "/opt/android/android_ndk/android-ndk-r9d/toolchains/arm-linux-androideabi-4.8/prebuilt/linux-x86/bin/arm-linux-androideabi-gcc")
set(CMAKE_CXX_COMPILER "/opt/android/android_ndk/android-ndk-r9d/toolchains/arm-linux-androideabi-4.8/prebuilt/linux-x86/bin/arm-linux-androideabi-g++")

if(ANDROID_NDK_TOOLCHAIN_DEBUG)
	message(STATUS "GCC companion library: ${ANDROID_NDK_GCC_COMPANIONLIBRARY}")
	message(STATUS "CMAKE_C_COMPILER: ${CMAKE_C_COMPILER}")
	message(STATUS "CMAKE_CXX_COMPILER: ${CMAKE_CXX_COMPILER}")
	message(STATUS "ANDROID_NDK_SYSROOT: ${ANDROID_NDK_SYSROOT}")
endif()


# root path
set(CMAKE_FIND_ROOT_PATH ${ANDROID_NDK_SYSROOT})

set(CMAKE_SYSTEM_PROGRAM_PATH 	"${ANDROID_NDK_ROOT}/toolchains/${ANDROID_NDK_ABI_EXT}-${ANDROID_NDK_GCC_VERSION}/prebuilt/${ANDROID_NDK_HOST}/bin/"
	)

# search paths
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)



# # specify compiler
# set(CMAKE_C_COMPILER   "${ANDROID_NDK_ROOT}/toolchains/${ANDROID_NDK_ABI_EXT}-${ANDROID_NDK_GCC_VERSION}/prebuilt/${ANDROID_NDK_HOST}/bin/${ANDROID_NDK_GCC_PREFIX}-gcc" CACHE PATH "C compiler" FORCE)
# set(CMAKE_CXX_COMPILER "${ANDROID_NDK_ROOT}/toolchains/${ANDROID_NDK_ABI_EXT}-${ANDROID_NDK_GCC_VERSION}/prebuilt/${ANDROID_NDK_HOST}/bin/${ANDROID_NDK_GCC_PREFIX}-g++" CACHE PATH "C++ compiler" FORCE)
#
tiprocop
() автор топика
Ответ на: комментарий от EXL
- Running cmake version 2.8.9
-- ANDROID_NDK_ABI - armeabi
-- ANDROID_NDK_ABI_EXT - arm-linux-androideabi
-- ANDROID_NDK_ARCH_CFLAGS - -D__ARM_ARCH_5__ -D__ARM_ARCH_5T__ -D__ARM_ARCH_5E__ -D__ARM_ARCH_5TE__ -Wno-psabi -march=armv5te -mtune=xscale -msoft-float -mthumb
-- GCC companion library: /opt/android/android_ndk/android-ndk-r9d/toolchains/arm-linux-androideabi-4.8/prebuilt/linux-x86/bin/../lib/gcc/arm-linux-androideabi/4.8/libgcc.a
-- CMAKE_C_COMPILER: /opt/android/android_ndk/android-ndk-r9d/toolchains/arm-linux-androideabi-4.8/prebuilt/linux-x86/bin/arm-linux-androideabi-gcc
-- CMAKE_CXX_COMPILER: /opt/android/android_ndk/android-ndk-r9d/toolchains/arm-linux-androideabi-4.8/prebuilt/linux-x86/bin/arm-linux-androideabi-g++
-- ANDROID_NDK_SYSROOT: /opt/android/android_ndk/android-ndk-r9d/platforms/android-9/arch-arm
-- ANDROID_NDK_ABI - armeabi
-- ANDROID_NDK_ABI_EXT - arm-linux-androideabi
-- ANDROID_NDK_ARCH_CFLAGS - -D__ARM_ARCH_5__ -D__ARM_ARCH_5T__ -D__ARM_ARCH_5E__ -D__ARM_ARCH_5TE__ -Wno-psabi -march=armv5te -mtune=xscale -msoft-float -mthumb
-- GCC companion library: /opt/android/android_ndk/android-ndk-r9d/toolchains/arm-linux-androideabi-4.8/prebuilt/linux-x86/bin/../lib/gcc/arm-linux-androideabi/4.8/libgcc.a
-- CMAKE_C_COMPILER: /opt/android/android_ndk/android-ndk-r9d/toolchains/arm-linux-androideabi-4.8/prebuilt/linux-x86/bin/arm-linux-androideabi-gcc
-- CMAKE_CXX_COMPILER: /opt/android/android_ndk/android-ndk-r9d/toolchains/arm-linux-androideabi-4.8/prebuilt/linux-x86/bin/arm-linux-androideabi-g++
-- ANDROID_NDK_SYSROOT: /opt/android/android_ndk/android-ndk-r9d/platforms/android-9/arch-arm
-- The C compiler identification is GNU 4.8.0
-- The CXX compiler identification is GNU 4.8.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Looking for SHM_HUGETLB
-- Looking for SHM_HUGETLB - not found.
-- Looking for sys/types.h
-- Looking for sys/types.h - found
-- Looking for stdint.h
-- Looking for stdint.h - found
-- Looking for stddef.h
-- Looking for stddef.h - found
-- Check size of void *
-- Check size of void * - done
-- SIZEOF_VOIDP 4
-- LibMySQL 6.1.3
-- Built from MySQL 5.7.4-m14 sources
-- Packaging as: mysql-connector-c-6.1.3-Linux-arm
-- Installing to: /usr/local/mysql
-- Performing Test HAVE_LLVM_LIBCPP
CMake Error: TRY_RUN() invoked in cross-compiling mode, please set the following cache variables appropriately:
   HAVE_LLVM_LIBCPP_EXITCODE (advanced)
For details see /opt/mysqlforand/mysql-connector-c-6.1.3-src/TryRunResults.cmake
-- Performing Test HAVE_LLVM_LIBCPP - Failed
-- Looking for floor
-- Looking for floor - not found
-- Looking for floor in m
-- Looking for floor in m - found
-- Looking for gethostbyname_r
-- Looking for gethostbyname_r - found
-- Looking for bind
-- Looking for bind - found
-- Looking for crypt
-- Looking for crypt - not found
-- Looking for crypt in crypt
-- Looking for crypt in crypt - not found
-- Looking for setsockopt
-- Looking for setsockopt - found
-- Looking for dlopen
-- Looking for dlopen - found
-- Looking for sched_yield
-- Looking for sched_yield - found
-- Looking for clock_gettime
-- Looking for clock_gettime - found
-- Looking for include file pthread.h
-- Looking for include file pthread.h - found
-- Looking for pthread_create
-- Looking for pthread_create - found
-- Found Threads: TRUE  
-- Looking for include file alloca.h
-- Looking for include file alloca.h - found
-- Looking for include file arpa/inet.h
-- Looking for include file arpa/inet.h - found
-- Looking for include file crypt.h
-- Looking for include file crypt.h - not found.
-- Looking for include file cxxabi.h
-- Looking for include file cxxabi.h - not found.
-- Looking for include file dirent.h
-- Looking for include file dirent.h - found
-- Looking for include file dlfcn.h
-- Looking for include file dlfcn.h - found
-- Looking for include file execinfo.h
-- Looking for include file execinfo.h - not found.
-- Looking for include file fcntl.h
-- Looking for include file fcntl.h - found
-- Looking for include file fenv.h
-- Looking for include file fenv.h - found
-- Looking for include file fpu_control.h
-- Looking for include file fpu_control.h - not found.
-- Looking for include file grp.h
-- Looking for include file grp.h - found
-- Looking for include file ieeefp.h
-- Looking for include file ieeefp.h - not found.
-- Looking for include file inttypes.h
-- Looking for include file inttypes.h - found
-- Looking for include file langinfo.h
-- Looking for include file langinfo.h - not found.
-- Looking for include file malloc.h
-- Looking for include file malloc.h - found
-- Looking for include file ndir.h
-- Looking for include file ndir.h - not found.
-- Looking for include file netinet/in.h
-- Looking for include file netinet/in.h - found
-- Looking for include file paths.h
-- Looking for include file paths.h - found
-- Looking for include file poll.h
-- Looking for include file poll.h - found
-- Looking for include file pwd.h
-- Looking for include file pwd.h - found
-- Looking for include file sched.h
-- Looking for include file sched.h - found
-- Looking for include file select.h
-- Looking for include file select.h - not found.
-- Looking for include files sys/types.h, sys/dir.h
-- Looking for include files sys/types.h, sys/dir.h - not found.
-- Looking for include file sys/ndir.h
-- Looking for include file sys/ndir.h - not found.
-- Looking for include file strings.h
-- Looking for include file strings.h - found
-- Looking for include file synch.h
-- Looking for include file synch.h - not found.
-- Looking for include file sysent.h
-- Looking for include file sysent.h - not found.
-- Looking for include file sys/cdefs.h
-- Looking for include file sys/cdefs.h - found
-- Looking for include file sys/ioctl.h
-- Looking for include file sys/ioctl.h - found
-- Looking for include file sys/ipc.h
-- Looking for include file sys/ipc.h - found
-- Looking for include file sys/malloc.h
-- Looking for include file sys/malloc.h - not found.
-- Looking for include file sys/mman.h
-- Looking for include file sys/mman.h - found
-- Looking for include file sys/prctl.h
-- Looking for include file sys/prctl.h - found
-- Looking for include file sys/resource.h
-- Looking for include file sys/resource.h - found
-- Looking for include file sys/select.h
-- Looking for include file sys/select.h - found
-- Looking for include file sys/shm.h
-- Looking for include file sys/shm.h - not found.
-- Looking for include file sys/socket.h
-- Looking for include file sys/socket.h - found
-- Looking for include file sys/stat.h
-- Looking for include file sys/stat.h - found
-- Looking for include files curses.h, term.h
-- Looking for include files curses.h, term.h - not found.
-- Looking for include file asm/termbits.h
-- Looking for include file asm/termbits.h - found
-- Looking for include file termbits.h
-- Looking for include file termbits.h - not found.
-- Looking for include file termios.h
-- Looking for include file termios.h - found
-- Looking for include file termio.h
-- Looking for include file termio.h - found
-- Looking for include file termcap.h
-- Looking for include file termcap.h - not found.
tiprocop
() автор топика
Ответ на: комментарий от EXL
-- Looking for include file unistd.h
-- Looking for include file unistd.h - found
-- Looking for include file utime.h
-- Looking for include file utime.h - found
-- Looking for include file sys/time.h
-- Looking for include file sys/time.h - found
-- Looking for include file sys/utime.h
-- Looking for include file sys/utime.h - found
-- Looking for include file sys/wait.h
-- Looking for include file sys/wait.h - found
-- Looking for include file sys/param.h
-- Looking for include file sys/param.h - found
-- Looking for include file sys/vadvise.h
-- Looking for include file sys/vadvise.h - not found.
-- Looking for include file fnmatch.h
-- Looking for include file fnmatch.h - found
-- Looking for include files stdlib.h, sys/un.h
-- Looking for include files stdlib.h, sys/un.h - found
-- Looking for include file vis.h
-- Looking for include file vis.h - not found.
-- Looking for include file sasl/sasl.h
-- Looking for include file sasl/sasl.h - not found.
-- Looking for include file sys/devpoll.h
-- Looking for include file sys/devpoll.h - not found.
-- Looking for include file sys/epoll.h
-- Looking for include file sys/epoll.h - found
-- Looking for TAILQ_FOREACH
-- Looking for TAILQ_FOREACH - found
-- Performing Test HAVE_WERROR_FLAG
-- Performing Test HAVE_WERROR_FLAG - Success
-- Performing Test HAVE_PTHREAD_ONCE_INIT
-- Performing Test HAVE_PTHREAD_ONCE_INIT - Success
-- Looking for _aligned_malloc
-- Looking for _aligned_malloc - not found
-- Looking for alarm
-- Looking for alarm - found
-- Looking for backtrace
-- Looking for backtrace - not found
-- Looking for backtrace_symbols
-- Looking for backtrace_symbols - not found
-- Looking for backtrace_symbols_fd
-- Looking for backtrace_symbols_fd - not found
-- Looking for printstack
-- Looking for printstack - not found
-- Looking for index
-- Looking for index - found
-- Looking for clock_gettime
-- Looking for clock_gettime - found
-- Looking for cuserid
-- Looking for cuserid - not found
-- Looking for directio
-- Looking for directio - not found
-- Looking for ftruncate
-- Looking for ftruncate - found
-- Looking for compress
-- Looking for compress - not found
-- Looking for crypt
-- Looking for crypt - not found
-- Looking for dlerror
-- Looking for dlerror - found
-- Looking for dlopen
-- Looking for dlopen - found
-- Looking for fchmod
-- Looking for fchmod - found
-- Looking for fcntl
-- Looking for fcntl - found
-- Looking for fdatasync
-- Looking for fdatasync - found
-- Looking for fdatasync
-- Looking for fdatasync - found
-- Looking for fedisableexcept
-- Looking for fedisableexcept - not found
-- Looking for fseeko
-- Looking for fseeko - found
-- Looking for fsync
-- Looking for fsync - found
-- Looking for gethostbyaddr_r
-- Looking for gethostbyaddr_r - not found
-- Looking for gethrtime
-- Looking for gethrtime - not found
-- Looking for getnameinfo
-- Looking for getnameinfo - found
-- Looking for getpass
-- Looking for getpass - not found
-- Looking for getpassphrase
-- Looking for getpassphrase - not found
-- Looking for getpwnam
-- Looking for getpwnam - found
-- Looking for getpwuid
-- Looking for getpwuid - found
-- Looking for getrlimit
-- Looking for getrlimit - found
-- Looking for getrusage
-- Looking for getrusage - found
-- Looking for initgroups
-- Looking for initgroups - found
-- Looking for issetugid
-- Looking for issetugid - found
-- Looking for getuid
-- Looking for getuid - found
-- Looking for geteuid
-- Looking for geteuid - found
-- Looking for getgid
-- Looking for getgid - found
-- Looking for getegid
-- Looking for getegid - found
-- Looking for lstat
-- Looking for lstat - found
-- Looking for madvise
-- Looking for madvise - found
-- Looking for malloc_info
-- Looking for malloc_info - not found
-- Looking for mlock
-- Looking for mlock - found
-- Looking for mlockall
-- Looking for mlockall - not found
-- Looking for mmap
-- Looking for mmap - found
-- Looking for mmap64
-- Looking for mmap64 - not found
-- Looking for poll
-- Looking for poll - found
-- Looking for posix_fallocate
-- Looking for posix_fallocate - not found
-- Looking for posix_memalign
-- Looking for posix_memalign - not found
-- Looking for pread
-- Looking for pread - found
-- Looking for pthread_attr_getguardsize
-- Looking for pthread_attr_getguardsize - found
-- Looking for pthread_condattr_setclock
-- Looking for pthread_condattr_setclock - not found
-- Looking for pthread_sigmask
-- Looking for pthread_sigmask - found
-- Looking for pthread_yield_np
-- Looking for pthread_yield_np - not found

tiprocop
() автор топика
Ответ на: комментарий от EXL
-- Looking for readdir_r
-- Looking for readdir_r - found
-- Looking for readlink
-- Looking for readlink - found
-- Looking for realpath
-- Looking for realpath - found
-- Looking for sched_yield
-- Looking for sched_yield - found
-- Looking for setenv
-- Looking for setenv - found
-- Looking for setfd
-- Looking for setfd - not found
-- Looking for sigaction
-- Looking for sigaction - found
-- Looking for sigset
-- Looking for sigset - not found
-- Looking for sleep
-- Looking for sleep - found
-- Looking for stpcpy
-- Looking for stpcpy - not found
-- Looking for stpncpy
-- Looking for stpncpy - not found
-- Looking for strlcpy
-- Looking for strlcpy - found
-- Looking for strnlen
-- Looking for strnlen - found
-- Looking for strlcat
-- Looking for strlcat - found
-- Looking for strsignal
-- Looking for strsignal - found
-- Looking for fgetln
-- Looking for fgetln - found
-- Looking for strsep
-- Looking for strsep - found
-- Looking for tell
-- Looking for tell - not found
-- Looking for thr_yield
-- Looking for thr_yield - not found
-- Looking for vasprintf
-- Looking for vasprintf - found
-- Looking for memalign
-- Looking for memalign - found
-- Looking for nl_langinfo
-- Looking for nl_langinfo - not found
-- Looking for ntohll
-- Looking for ntohll - not found
-- Looking for clock_gettime
-- Looking for clock_gettime - found
-- Looking for epoll_create
-- Looking for epoll_create - found
-- Looking for inet_ntop
-- Looking for inet_ntop - found
-- Looking for kqueue
-- Looking for kqueue - not found
-- Looking for timeradd
-- Looking for timeradd - found
-- Looking for timerclear
-- Looking for timerclear - found
-- Looking for timercmp
-- Looking for timercmp - found
-- Looking for timerisset
-- Looking for timerisset - found
-- Looking for include file sys/times.h
-- Looking for include file sys/times.h - found
-- Looking for include file asm/msr.h
-- Looking for include file asm/msr.h - not found.
-- Looking for times
-- Looking for times - found
-- Looking for gettimeofday
-- Looking for gettimeofday - found
-- Looking for rdtscll
-- Looking for rdtscll - not found
-- Looking for madvise
-- Looking for madvise - found
-- Looking for lrand48
-- Looking for lrand48 - found
-- Looking for TIOCGWINSZ
-- Looking for TIOCGWINSZ - found
-- Looking for FIONREAD
-- Looking for FIONREAD - found
-- Looking for FIONREAD
-- Looking for FIONREAD - not found.
-- Looking for log2
-- Looking for log2 - not found.
-- Looking for rint
-- Looking for rint - found
-- Performing Test HAVE_ISINF
-- Performing Test HAVE_ISINF - Success
-- Performing Test HAVE_FESETROUND
-- Performing Test HAVE_FESETROUND - Success
-- Check if the system is big endian
-- Searching 16 bit integer
-- Check size of unsigned short
-- Check size of unsigned short - done
-- Using unsigned short
-- Check if the system is big endian - little endian
-- Check size of sigset_t
-- Check size of sigset_t - done
-- Check size of mode_t
-- Check size of mode_t - done
-- Check size of char *
-- Check size of char * - done
-- Check size of long
-- Check size of long - done
-- Check size of char
-- Check size of char - done
-- Check size of short
-- Check size of short - done
-- Check size of int
-- Check size of int - done
-- Check size of long long
-- Check size of long long - done
-- Check size of off_t
-- Check size of off_t - done
-- Check size of uint
-- Check size of uint - done
-- Check size of ulong
-- Check size of ulong - failed
-- Check size of u_int32_t
-- Check size of u_int32_t - done
-- Check size of time_t
-- Check size of time_t - done
-- Performing Test TIME_T_UNSIGNED
-- Performing Test TIME_T_UNSIGNED - Failed
-- Performing Test HAVE_GETADDRINFO
-- Performing Test HAVE_GETADDRINFO - Success
-- Performing Test HAVE_SELECT
-- Performing Test HAVE_SELECT - Success
-- Performing Test QSORT_TYPE_IS_VOID
-- Performing Test QSORT_TYPE_IS_VOID - Success
-- Performing Test HAVE_SOCKET_SIZE_T_AS_socklen_t
-- Performing Test HAVE_SOCKET_SIZE_T_AS_socklen_t - Success
-- Performing Test HAVE_PTHREAD_YIELD_ZERO_ARG
-- Performing Test HAVE_PTHREAD_YIELD_ZERO_ARG - Failed
CMake Error at configure.cmake:770 (MESSAGE):
  STACK_DIRECTION is not defined.  Please specify -DSTACK_DIRECTION=1 or
  -DSTACK_DIRECTION=-1 when calling cmake.
Call Stack (most recent call first):
  CMakeLists.txt:414 (INCLUDE)


-- Configuring incomplete, errors occurred!
tiprocop
() автор топика
Ответ на: комментарий от tiprocop

Ну тебе же оно пишет: переменная STACK_DIRECTION не определена. Определи её перед вызовом cmake:

cmake -DSTACK_DIRECTION=1 ... 
make

EXL ★★★★★
()
Ответ на: комментарий от EXL
CMake Error: TRY_RUN() invoked in cross-compiling mode, please set the following cache variables appropriately:
   HAVE_LLVM_LIBCPP_EXITCODE (advanced)
For details see /opt/mysqlforand/mysql-connector-c-6.1.3-src/TryRunResults.cmake

Файл TryRunResults.cmake

# This file was generated by CMake because it detected TRY_RUN() commands
# in crosscompiling mode. It will be overwritten by the next CMake run.
# Copy it to a safe location, set the variables to appropriate values
# and use it then to preset the CMake cache (using -C).


# HAVE_LLVM_LIBCPP_EXITCODE
#    indicates whether the executable would have been able to run on its
#    target platform. If so, set HAVE_LLVM_LIBCPP_EXITCODE to
#    the exit code (in many cases 0 for success), otherwise enter "FAILED_TO_RUN".
# The HAVE_LLVM_LIBCPP_COMPILED variable holds the build result for this TRY_RUN().
# 
# Source file   : /opt/mysqlforand/mysql-connector-c-6.1.3-src/CMakeFiles/CMakeTmp/src.cxx
# Executable    : /opt/mysqlforand/mysql-connector-c-6.1.3-src/CMakeFiles/cmTryCompileExec1231755922-HAVE_LLVM_LIBCPP_EXITCODE
# Run arguments : 
#    Called from: [2]	/opt/mysqlforand/mysql-connector-c-6.1.3-src/configure.cmake
#                 [1]	/opt/mysqlforand/mysql-connector-c-6.1.3-src/CMakeLists.txt

SET( HAVE_LLVM_LIBCPP_EXITCODE 
     "PLEASE_FILL_OUT-FAILED_TO_RUN"
     CACHE STRING "Result from TRY_RUN" FORCE)
Но если второй раз запустить cmake - make файл собирается,но при make на 65% вылетает ошибка. Я так понял, нужно добавить
cmake -CHAVE_LLVM_LIBCPP_EXITCODE=2 или 1 

tiprocop
() автор топика
Ответ на: комментарий от EXL

Выполняю

cmake -DSTACK_DIRECTION=1 -DHAVE_LLVM_LIBCPP_EXITCODE=0 -DCMAKE_TOOLCHAIN_FILE=/opt/mysqlforand/mysql-connector-c-6.1.3-src/android.toolchain.cmake
Все собирается.Но make заканчивается вот этим
[ 64%] Building C object mysys/CMakeFiles/mysys.dir/my_lib.c.o
In file included from /opt/mysqlforand/mysql-connector-c-6.1.3-src/mysys/mysys_priv.h:16:0,
                 from /opt/mysqlforand/mysql-connector-c-6.1.3-src/mysys/my_lib.c:19:
/opt/mysqlforand/mysql-connector-c-6.1.3-src/include/my_global.h:886:0: warning: "__func__" redefined [enabled by default]
 #    define __func__ __FUNCTION__
 ^
In file included from /opt/android/android_ndk/android-ndk-r9d/platforms/android-9/arch-arm/usr/include/time.h:31:0,
                 from /opt/android/android_ndk/android-ndk-r9d/platforms/android-9/arch-arm/usr/include/pthread.h:31,
                 from /opt/mysqlforand/mysql-connector-c-6.1.3-src/include/my_global.h:185,
                 from /opt/mysqlforand/mysql-connector-c-6.1.3-src/mysys/mysys_priv.h:16,
                 from /opt/mysqlforand/mysql-connector-c-6.1.3-src/mysys/my_lib.c:19:
/opt/android/android_ndk/android-ndk-r9d/platforms/android-9/arch-arm/usr/include/sys/cdefs.h:230:0: note: this is the location of the previous definition
 #define __func__ __PRETTY_FUNCTION__
 ^
In file included from /opt/mysqlforand/mysql-connector-c-6.1.3-src/include/mysql/psi/mysql_file.h:24:0,
                 from /opt/mysqlforand/mysql-connector-c-6.1.3-src/mysys/mysys_priv.h:53,
                 from /opt/mysqlforand/mysql-connector-c-6.1.3-src/mysys/my_lib.c:19:
/opt/mysqlforand/mysql-connector-c-6.1.3-src/mysys/my_lib.c: In function 'my_dir':
/opt/mysqlforand/mysql-connector-c-6.1.3-src/include/my_dir.h:38:20: error: 'S_IREAD' undeclared (first use in this function)
 #define MY_S_IREAD S_IREAD /* read permission, owner */
                    ^
/opt/mysqlforand/mysql-connector-c-6.1.3-src/mysys/my_lib.c:145:37: note: in expansion of macro 'MY_S_IREAD'
       if (!(finfo.mystat->st_mode & MY_S_IREAD))
                                     ^
/opt/mysqlforand/mysql-connector-c-6.1.3-src/include/my_dir.h:38:20: note: each undeclared identifier is reported only once for each function it appears in
 #define MY_S_IREAD S_IREAD /* read permission, owner */
                    ^
/opt/mysqlforand/mysql-connector-c-6.1.3-src/mysys/my_lib.c:145:37: note: in expansion of macro 'MY_S_IREAD'
       if (!(finfo.mystat->st_mode & MY_S_IREAD))
                                     ^
make[2]: *** [mysys/CMakeFiles/mysys.dir/my_lib.c.o] Ошибка 1
make[1]: *** [mysys/CMakeFiles/mysys.dir/all] Ошибка 2
make: *** [all] Ошибка 2

в чем дело?

tiprocop
() автор топика
Ответ на: комментарий от tiprocop

Нет, это куцые заголовочные файлы из android-ndk.

Попробуй добавить это куда-нибудь:

# define S_IREAD        S_IRUSR
# define S_IWRITE       S_IWUSR
# define S_IEXEC        S_IXUSR

К примеру, в /opt/mysqlforand/mysql-connector-c-6.1.3-src/include/my_dir.h, над строкой

#define MY_S_IREAD S_IREAD
EXL ★★★★★
()
Ответ на: комментарий от EXL
[ 90%] Built target mysys_ssl
Scanning dependencies of target GenError
[ 90%] Generating ../include/mysqld_error.h, ../sql/share/english/errmsg.sys
/bin/sh: 1: comp_err: not found
make[2]: *** [include/mysqld_error.h] Ошибка 127
make[1]: *** [extra/CMakeFiles/GenError.dir/all] Ошибка 2
make: *** [all] Ошибка 2

И файла mysqld_error.h нет в /opt/mysqlforand/mysql-connector-c-6.1.3-src/include/

tiprocop
() автор топика
Ответ на: комментарий от EXL

что-то туговато я просветляюсь. Нужен просвещенный совет. Я правильно понял, что ошибка возникает потому что я компилирую под arm, но чтобы некоторые инструменты были доступны нужно скомпилировать сначала под x86?

tiprocop
() автор топика
Ответ на: комментарий от tiprocop

Я структуру mysql-проекта не знаю, но эта утилита определенно должна быть скомпилирована под твой хост (x86_64).

EXL ★★★★★
()
Вы не можете добавлять комментарии в эту тему. Тема перемещена в архив.