Skip to content

Commit

Permalink
Moving build to Ubuntu 16.04 LTS
Browse files Browse the repository at this point in the history
  • Loading branch information
rupor-github committed Jan 21, 2018
1 parent 8d53453 commit f3e5578
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 20 deletions.
34 changes: 17 additions & 17 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.0)
cmake_minimum_required(VERSION 3.7)
message(STATUS "Running cmake version ${CMAKE_VERSION}")

project(InpxCreator)
Expand All @@ -14,7 +14,7 @@ set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_SOURCE_DIR}/cmake)

# Project version number
set(PRJ_VERSION_MAJOR 9)
set(PRJ_VERSION_MINOR 41)
set(PRJ_VERSION_MINOR 42)
configure_file("${PROJECT_SOURCE_DIR}/cmake/version.h.in" "${PROJECT_BINARY_DIR}/version.h")
include_directories("${PROJECT_BINARY_DIR}")

Expand Down Expand Up @@ -44,14 +44,13 @@ else()
endif()
message(STATUS "Destination directory: ${DEST_DIR}")

set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
set(BUILD_SHARED_LIBS OFF)
if(UNIX)
# STATIC LINK set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -static -static-libgcc -static-libstdc++")
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -static-libgcc -static-libstdc++")
else()
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -static-libgcc -static-libstdc++")
endif()
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -static-libgcc -static-libstdc++")
# if(UNIX)
# set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -static -static-libgcc -static-libstdc++")
# endif()

if(CMAKE_BUILD_TYPE STREQUAL "Debug")
message(STATUS "** Debug mode")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g -D_XML_DEBUG")
Expand All @@ -64,12 +63,12 @@ find_package(Git REQUIRED)

set(Boost_USE_STATIC_LIBS ON)
set(Boost_USE_STATIC_RUNTIME ON)
find_package(Boost 1.63.0 REQUIRED COMPONENTS "date_time" "program_options" "filesystem")
find_package(Boost 1.58.0 REQUIRED COMPONENTS "date_time" "program_options" "filesystem")
find_package(Threads)
if(DEFINED ENV{MYSQL_PROPER})
find_package(MySQL 5.7.17 REQUIRED EXACT)
else()
find_package(MariaDB 10.1.26 REQUIRED)
find_package(MariaDB 10.1.26 REQUIRED EXACT)
endif()
find_package(ZLIB REQUIRED)
find_package(EXPAT REQUIRED)
Expand All @@ -92,13 +91,14 @@ set(SRCS_LIB2INPX lib2inpx/util.cpp lib2inpx/lib2inpx.cpp)
add_executable(lib2inpx ${SRCS_LIB2INPX})
if(UNIX)
set(ADD_LIBS "${CMAKE_THREAD_LIBS_INIT} -lm -lrt -ldl -lcrypt -laio")
if(ICONV_LIBRARIES MATCHES "libc")
target_link_libraries(lib2inpx minizip ${Boost_LIBRARIES} ${MYSQL_LIBRARIES} ${ZLIB_LIBRARIES} ${EXPAT_LIBRARIES} ${ADD_LIBS})
else()
target_link_libraries(lib2inpx minizip ${Boost_LIBRARIES} ${MYSQL_LIBRARIES} ${ZLIB_LIBRARIES} ${EXPAT_LIBRARIES} ${ICONV_LIBRARIES} ${ADD_LIBS})
endif()
else()
target_link_libraries(lib2inpx minizip ${Boost_LIBRARIES} ${MYSQL_LIBRARIES} ${ZLIB_LIBRARIES} ${EXPAT_LIBRARIES} ${ICONV_LIBRARIES})
endif()
target_link_libraries(lib2inpx minizip ${Boost_LIBRARIES} ${MYSQL_LIBRARIES} ${ZLIB_LIBRARIES} ${EXPAT_LIBRARIES} ${ICONV_LIBRARIES} ${ADD_LIBS})
# STATIC LINK
#if(UNIX)
# set_target_properties(lib2inpx PROPERTIES LINK_SEARCH_START_STATIC 1)
# set_target_properties(lib2inpx PROPERTIES LINK_SEARCH_END_STATIC 1)
#endif()

install(FILES ${PROJECT_BINARY_DIR}/history.txt DESTINATION ${DEST_DIR} CONFIGURATIONS Release)
FILE(GLOB files "misc/*")
Expand Down
10 changes: 7 additions & 3 deletions get-maria.sh
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
#!/bin/bash -e

echo "10.1.26 seems to be the last version supporting libmysqld.a"

ver_major=10.1
ver_minor=26

declare -A checkmap

from_url="https://downloads.mariadb.org/interstitial"
from_url="https://downloads.mariadb.com/MariaDB"

ARCH_INSTALLS="${ARCH_INSTALLS:-win32 win64 linux}"

Expand Down Expand Up @@ -40,6 +41,9 @@ for _mingw in ${ARCH_INSTALLS}; do

echo "Processing ${arch}..."
if [ ! -f ${file} ]; then
echo
echo "--> ${from_url}/mariadb-${ver_major}.${ver_minor}/${packagedir}/${file}"
echo
curl -L -O ${from_url}/mariadb-${ver_major}.${ver_minor}/${packagedir}/${file}
else
echo "Have ${file} locally."
Expand All @@ -65,7 +69,7 @@ for _mingw in ${ARCH_INSTALLS}; do
for dll in *.dll; do
echo "Creating Windows export library for ${dll}"
gendef -a ${dll}
dlltool -d ${dll%.*}.def -l ${dll}.a -k
${prefix}-w64-mingw32-dlltool -d ${dll%.*}.def -l ${dll}.a -k
rm ${dll%.*}.def
done
)
Expand Down

0 comments on commit f3e5578

Please sign in to comment.