From d495b0cfc29f885e9201a73a4f7b2fc983f24e0c Mon Sep 17 00:00:00 2001 From: KO Myung-Hun Date: Mon, 18 Jan 2016 18:16:37 +0900 Subject: [PATCH 1/4] Disable IPv6 on OS/2 OS/2 does not support IPv6, yet. Signed-off-by: derselbst --- CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 1676da76..b27775e6 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -83,6 +83,7 @@ endif ( ${CMAKE_SYSTEM} MATCHES "Darwin" ) if ( ${CMAKE_SYSTEM} MATCHES "OS2" ) option ( enable-dart "compile DART support (if it is available)" on ) + set ( enable-ipv6 off ) endif ( ${CMAKE_SYSTEM} MATCHES "OS2" ) # Initialize the library directory name suffix. From ae6d1dd8baa9e431c132854e3202bfe13aee5661 Mon Sep 17 00:00:00 2001 From: KO Myung-Hun Date: Mon, 18 Jan 2016 18:17:45 +0900 Subject: [PATCH 2/4] Remove -fvisibility=hidden flag on OS/2 On OS/2, -fvisibility=hidden is ignored. Signed-off-by: derselbst --- CMakeLists.txt | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index b27775e6..cafeb27f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -144,10 +144,16 @@ if ( CMAKE_COMPILER_IS_GNUCC OR "${CMAKE_C_COMPILER_ID}" STREQUAL "Clang" ) "${CMAKE_SHARED_LINKER_FLAGS} -Wl,--no-undefined" ) endif ( NOT APPLE AND NOT OS2 ) + if ( OS2 ) + set ( GNUCC_VISIBILITY_FLAG "" ) + else ( OS2 ) + set ( GNUCC_VISIBILITY_FLAG "-fvisibility=hidden" ) + endif ( OS2 ) + set ( GNUCC_WARNING_FLAGS "-Wall -W -Wpointer-arith -Wbad-function-cast -Wno-cast-qual -Wcast-align -Wstrict-prototypes -Wno-unused-parameter -Wdeclaration-after-statement" ) - set ( CMAKE_C_FLAGS_DEBUG "-std=gnu89 -g -fvisibility=hidden -DDEBUG ${GNUCC_WARNING_FLAGS}" ) - set ( CMAKE_C_FLAGS_RELEASE "-std=gnu89 -O2 -fomit-frame-pointer -finline-functions -fvisibility=hidden -DNDEBUG ${GNUCC_WARNING_FLAGS}" ) - set ( CMAKE_C_FLAGS_RELWITHDEBINFO "-std=gnu89 -O2 -g -fomit-frame-pointer -finline-functions -fvisibility=hidden -DNDEBUG ${GNUCC_WARNING_FLAGS}" ) + set ( CMAKE_C_FLAGS_DEBUG "-std=gnu89 -g ${GNUCC_VISIBILITY_FLAG} -DDEBUG ${GNUCC_WARNING_FLAGS}" ) + set ( CMAKE_C_FLAGS_RELEASE "-std=gnu89 -O2 -fomit-frame-pointer -finline-functions ${GNUCC_VISIBILITY_FLAG} -DNDEBUG ${GNUCC_WARNING_FLAGS}" ) + set ( CMAKE_C_FLAGS_RELWITHDEBINFO "-std=gnu89 -O2 -g -fomit-frame-pointer -finline-functions ${GNUCC_VISIBILITY_FLAG} -DNDEBUG ${GNUCC_WARNING_FLAGS}" ) endif ( CMAKE_COMPILER_IS_GNUCC OR "${CMAKE_C_COMPILER_ID}" STREQUAL "Clang" ) # Windows From 0130cbdd4d8aa84c0aaa5541bc1afb728fc6c3e0 Mon Sep 17 00:00:00 2001 From: KO Myung-Hun Date: Thu, 21 Jan 2016 21:25:21 +0900 Subject: [PATCH 3/4] Remove ${} from CMAKE_SYSTEM variable in IF statement IF statement interprets a variable without ${}. And without this, CMAKE_SYSTEM is not checked correctly on CMAKE 3.4.1. Signed-off-by: derselbst --- CMakeLists.txt | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index cafeb27f..93739e93 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -70,21 +70,22 @@ option ( BUILD_SHARED_LIBS "Build a shared object or DLL" on ) option ( enable-ipv6 "enable ipv6 support " on ) # Platform specific options -if ( ${CMAKE_SYSTEM} MATCHES "Linux" ) +if ( CMAKE_SYSTEM MATCHES "Linux" ) + option ( enable-ladcca "compile LADCCA support if it is available (deprecated)" off ) option ( enable-lash "compile LASH support (if it is available)" on ) option ( enable-alsa "compile ALSA support (if it is available)" on ) -endif ( ${CMAKE_SYSTEM} MATCHES "Linux" ) +endif ( CMAKE_SYSTEM MATCHES "Linux" ) -if ( ${CMAKE_SYSTEM} MATCHES "Darwin" ) +if ( CMAKE_SYSTEM MATCHES "Darwin" ) option ( enable-coreaudio "compile CoreAudio support (if it is available)" on ) option ( enable-coremidi "compile CoreMIDI support (if it is available)" on ) option ( enable-framework "create a Mac OSX style FluidSynth.framework" on ) -endif ( ${CMAKE_SYSTEM} MATCHES "Darwin" ) +endif ( CMAKE_SYSTEM MATCHES "Darwin" ) -if ( ${CMAKE_SYSTEM} MATCHES "OS2" ) +if ( CMAKE_SYSTEM MATCHES "OS2" ) option ( enable-dart "compile DART support (if it is available)" on ) set ( enable-ipv6 off ) -endif ( ${CMAKE_SYSTEM} MATCHES "OS2" ) +endif ( CMAKE_SYSTEM MATCHES "OS2" ) # Initialize the library directory name suffix. if ( CMAKE_SIZEOF_VOID_P EQUAL 8 ) @@ -187,7 +188,7 @@ endif ( WIN32 ) unset ( DART_SUPPORT CACHE ) unset ( DART_LIBS CACHE ) unset ( DART_INCLUDE_DIRS CACHE ) -if ( ${CMAKE_SYSTEM} MATCHES "OS2" ) +if ( CMAKE_SYSTEM MATCHES "OS2" ) set ( CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Zbin-files" ) set ( CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Zbin-files" ) if ( enable-dart ) @@ -195,13 +196,13 @@ if ( ${CMAKE_SYSTEM} MATCHES "OS2" ) set ( DART_SUPPORT ${HAVE_DART_H} ) unset ( DART_INCLUDE_DIRS CACHE ) endif ( enable-dart ) -endif ( ${CMAKE_SYSTEM} MATCHES "OS2" ) +endif ( CMAKE_SYSTEM MATCHES "OS2" ) # Solaris / SunOS -if ( ${CMAKE_SYSTEM} MATCHES "SunOS" ) +if ( CMAKE_SYSTEM MATCHES "SunOS" ) set ( FLUID_LIBS "${FLUID_LIBS};nsl;socket" ) set ( LIBFLUID_LIBS "${LIBFLUID_LIBS};nsl;socket" ) -endif ( ${CMAKE_SYSTEM} MATCHES "SunOS" ) +endif ( CMAKE_SYSTEM MATCHES "SunOS" ) # Apple Mac OSX unset ( COREAUDIO_SUPPORT CACHE ) @@ -210,7 +211,7 @@ unset ( COREMIDI_SUPPORT CACHE ) unset ( COREMIDI_LIBS CACHE ) unset ( DARWIN CACHE ) unset ( MACOSX_FRAMEWORK CACHE ) -if ( ${CMAKE_SYSTEM} MATCHES "Darwin" ) +if ( CMAKE_SYSTEM MATCHES "Darwin" ) set ( DARWIN 1 ) set ( CMAKE_INSTALL_NAME_DIR ${CMAKE_INSTALL_PREFIX}/${LIB_INSTALL_DIR}${LIB_SUFFIX} ) @@ -231,7 +232,7 @@ if ( ${CMAKE_SYSTEM} MATCHES "Darwin" ) if ( enable-framework ) set ( MACOSX_FRAMEWORK 1 ) endif ( enable-framework ) -endif ( ${CMAKE_SYSTEM} MATCHES "Darwin" ) +endif ( CMAKE_SYSTEM MATCHES "Darwin" ) unset ( HAVE_INETNTOP CACHE ) From 692e6ef2ce4d46229f3c8c1669f67c4eb7900bb9 Mon Sep 17 00:00:00 2001 From: KO Myung-Hun Date: Thu, 21 Jan 2016 21:26:43 +0900 Subject: [PATCH 4/4] Use normal library name for OS/2 Now, CMake for OS/2 can process a DLL name properly longer than 8 characters. Signed-off-by: derselbst --- src/CMakeLists.txt | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 6147b69b..6ffd6fd2 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -264,8 +264,7 @@ if ( MACOSX_FRAMEWORK ) elseif ( OS2 ) set_target_properties ( libfluidsynth PROPERTIES - OUTPUT_NAME "fluidsyn" - ARCHIVE_OUTPUT_NAME "fluidsynth" + OUTPUT_NAME "fluidsynth" VERSION ${LIB_VERSION_INFO} SOVERSION ${LIB_VERSION_CURRENT} )