aboutsummaryrefslogtreecommitdiff
path: root/ports/libffi
diff options
context:
space:
mode:
authorTodor Prokopov <koprok@users.noreply.github.com>2019-03-01 08:58:46 +0200
committerVictor Romero <romerosanchezv@gmail.com>2019-02-28 22:58:46 -0800
commit1afa2b0f7ba4079ff1bb1dd7724733b0cfc583d2 (patch)
tree0af0b26a45608a5ccf3ce20a0ab44bf7afb0aba3 /ports/libffi
parent590f3a78b2d64ef1beb71129feca3db24c710a25 (diff)
downloadvcpkg-1afa2b0f7ba4079ff1bb1dd7724733b0cfc583d2.tar.gz
vcpkg-1afa2b0f7ba4079ff1bb1dd7724733b0cfc583d2.zip
Build glib on x86-linux (#5313)
* Build glib on x86-linux * [libffi] Code cleanup * [glib] Use CMAKE_CXX_FLAGS instead of VCPKG_CXX_FLAGS * [libffi] Use ${TARGET} in conditions
Diffstat (limited to 'ports/libffi')
-rw-r--r--ports/libffi/CMakeLists.txt16
-rw-r--r--ports/libffi/CONTROL2
-rw-r--r--ports/libffi/fficonfig.h8
-rw-r--r--ports/libffi/portfile.cmake11
4 files changed, 23 insertions, 14 deletions
diff --git a/ports/libffi/CMakeLists.txt b/ports/libffi/CMakeLists.txt
index 1f8e2d332..2be7a2574 100644
--- a/ports/libffi/CMakeLists.txt
+++ b/ports/libffi/CMakeLists.txt
@@ -97,18 +97,22 @@ macro(add_assembly ASMFILE)
endif()
endmacro()
-if("${TARGET}" STREQUAL "X86")
+if(${TARGET} STREQUAL "X86")
+ set(CMAKE_ASM_FLAGS "${CMAKE_ASM_FLAGS} -m32")
+endif()
+
+if(${TARGET} STREQUAL "X86")
add_assembly(src/x86/sysv.S)
add_assembly(src/x86/win32.S)
-elseif("${TARGET}" STREQUAL "X86_64")
+elseif(${TARGET} STREQUAL "X86_64")
list(APPEND FFI_SOURCES src/x86/ffi64.c)
add_assembly(src/x86/unix64.S)
add_assembly(src/x86/sysv.S)
-elseif("${TARGET}" STREQUAL "X86_WIN32")
+elseif(${TARGET} STREQUAL "X86_WIN32")
add_assembly(src/x86/win32.S)
-elseif("${TARGET}" STREQUAL "X86_WIN64")
+elseif(${TARGET} STREQUAL "X86_WIN64")
add_assembly(src/x86/win64.S)
-elseif("${TARGET}" STREQUAL "X86_DARWIN")
+elseif(${TARGET} STREQUAL "X86_DARWIN")
list(APPEND FFI_SOURCES src/x86/ffi64.c)
add_assembly(src/x86/darwin.S)
add_assembly(src/x86/darwin64.S)
@@ -116,7 +120,7 @@ else()
message(FATAL_ERROR "Target not implemented")
endif()
-if(CMAKE_BUILD_TYPE STREQUAL Debug)
+if(CMAKE_BUILD_TYPE STREQUAL "Debug")
list(APPEND FFI_SOURCES src/debug.c)
add_definitions(-DFFI_DEBUG)
endif()
diff --git a/ports/libffi/CONTROL b/ports/libffi/CONTROL
index ee1f0de9e..b008d7595 100644
--- a/ports/libffi/CONTROL
+++ b/ports/libffi/CONTROL
@@ -1,3 +1,3 @@
Source: libffi
-Version: 3.1-1
+Version: 3.1-4
Description: Portable, high level programming interface to various calling conventions
diff --git a/ports/libffi/fficonfig.h b/ports/libffi/fficonfig.h
index ff8b0ca44..044b791c1 100644
--- a/ports/libffi/fficonfig.h
+++ b/ports/libffi/fficonfig.h
@@ -1,3 +1,6 @@
+#ifdef __linux__
+#define EH_FRAME_FLAGS "a"
+#endif
#define HAVE_ALLOCA 1
#ifndef _WIN64
#define HAVE_AS_ASCII_PSEUDO_OP 1
@@ -8,6 +11,9 @@
#ifndef _WIN64
#define HAVE_AS_X86_PCREL 1
#endif
+#ifdef __linux__
+#define HAVE_HIDDEN_VISIBILITY_ATTRIBUTE 1
+#endif
#define HAVE_INTTYPES_H 1
#define HAVE_MEMORY_H 1
#define HAVE_STDINT_H 1
@@ -31,9 +37,11 @@
#define SIZEOF_SIZE_T 8
#endif
#define STDC_HEADERS 1
+#ifndef __linux__
#ifndef _WIN64
#define SYMBOL_UNDERSCORE 1
#endif
+#endif
#define VERSION "3.1"
#if defined AC_APPLE_UNIVERSAL_BUILD
# if defined __BIG_ENDIAN__
diff --git a/ports/libffi/portfile.cmake b/ports/libffi/portfile.cmake
index 8799e23a8..b72a6cd5a 100644
--- a/ports/libffi/portfile.cmake
+++ b/ports/libffi/portfile.cmake
@@ -9,18 +9,15 @@ vcpkg_from_github(
REF v3.1
SHA512 b214e4a876995f44e0a93bad5bf1b3501ea1fbedafbf33ea600007bd08c9bc965a1f0dd90ea870281c3add6c051febd19aa6cdce36f3ee8ba535ba2c0703153c
HEAD_REF master
+ PATCHES
+ export-global-data.patch
)
file(COPY ${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt DESTINATION ${SOURCE_PATH})
-vcpkg_apply_patches(
- SOURCE_PATH ${SOURCE_PATH}
- PATCHES
- ${CMAKE_CURRENT_LIST_DIR}/export-global-data.patch
-)
-
vcpkg_configure_cmake(
SOURCE_PATH ${SOURCE_PATH}
+ PREFER_NINJA
OPTIONS
-DFFI_CONFIG_FILE=${CMAKE_CURRENT_LIST_DIR}/fficonfig.h
OPTIONS_DEBUG
@@ -30,7 +27,7 @@ vcpkg_configure_cmake(
vcpkg_install_cmake()
vcpkg_copy_pdbs()
-if(VCPKG_LIBRARY_LINKAGE STREQUAL static)
+if(VCPKG_LIBRARY_LINKAGE STREQUAL "static")
vcpkg_apply_patches(
SOURCE_PATH ${CURRENT_PACKAGES_DIR}/include
PATCHES