Linux - make it compile on linux, gstreamer 0.1 for now, needs to be moved to 1.0, cef probably fails when compiled with volume catcher enabled

master
Zi Ree 2022-09-20 19:29:39 +02:00
parent c607ff35d6
commit 45aef2c318
25 changed files with 164 additions and 59 deletions

View File

@ -22,9 +22,9 @@
<key>archive</key>
<map>
<key>hash</key>
<string>e6eecee825b9159b3be34b5fd21ef3e0</string>
<string>db1a758da143fe0177df2b472eaa8d78</string>
<key>url</key>
<string>http://3p.firestormviewer.org/SDL-2.0.20-linux64-222521433.tar.bz2</string>
<string>http://3p.firestormviewer.org/SDL2-2.0.20-linux64-222610218.tar.bz2</string>
</map>
<key>name</key>
<string>linux64</string>
@ -45,7 +45,7 @@
<string>gstreamer10</string>
<key>platforms</key>
<map>
<key>linux</key>
<key>linux64</key>
<map>
<key>archive</key>
<map>
@ -55,7 +55,7 @@
<string>http://downloads.phoenixviewer.com/gstreamer10-1.6.3.201605191852-linux-201605191852.tar.bz2</string>
</map>
<key>name</key>
<string>linux</string>
<string>linux64</string>
</map>
</map>
<key>version</key>
@ -83,7 +83,7 @@
<string>http://3p.firestormviewer.org/breakpad-4708e6fb-linux64_bionic-220392253.tar.bz2</string>
</map>
<key>name</key>
<string>linux</string>
<string>linux64</string>
</map>
</map>
<key>version</key>
@ -111,7 +111,7 @@
<string>http://3p.firestormviewer.org/glib-2.56.0.220911433-linux64_bionic-220911433.tar.bz2</string>
</map>
<key>name</key>
<string>linux</string>
<string>linux64</string>
</map>
</map>
<key>version</key>
@ -325,7 +325,7 @@
<key>name</key>
<string>darwin</string>
</map>
<key>linux</key>
<key>linux64</key>
<map>
<key>archive</key>
<map>
@ -335,7 +335,7 @@
<uri>http://3p.firestormviewer.org/libnotify-0.4.4-linux-20101003.tar.bz2</uri>
</map>
<key>name</key>
<string>linux</string>
<string>linux64</string>
</map>
<key>windows</key>
<map>
@ -831,16 +831,6 @@
<key>name</key>
<string>windows64</string>
</map>
<key>linux64</key>
<map>
<key>archive</key>
<map>
<key>hash</key>
<string>ac54672e0b38f52726f5c99047c913e4</string>
<key>url</key>
<string>https://automated-builds-secondlife-com.s3.amazonaws.com/ct2/89306/815431/cubemaptoequirectangular-1.1.0-windows64-564841.tar.bz2</string>
</map>
</map>
</map>
<key>version</key>
<string>1.1.0</string>
@ -952,7 +942,7 @@
<key>license</key>
<string>MPL</string>
<key>license_file</key>
<string>LICENSES/LICENSE.txt</string>
<string>LICENSES/CEF_LICENSE.txt</string>
<key>name</key>
<string>dullahan</string>
<key>platforms</key>
@ -2642,16 +2632,16 @@ Copyright (c) 2012, 2014, 2015, 2016 nghttp2 contributors</string>
<key>archive</key>
<map>
<key>hash</key>
<string>c7c1f7f656d155b5af852ae1ef4954d9</string>
<string>411c000af6328e454ff7064f90c18a81</string>
<key>url</key>
<string>http://3p.firestormviewer.org/open_libndofdev-0.13.222441031-linux64-222441031.tar.bz2</string>
<string>http://3p.firestormviewer.org/open_libndofdev-0.13.222610246-linux64-222610246.tar.bz2</string>
</map>
<key>name</key>
<string>linux64</string>
</map>
</map>
<key>version</key>
<string>0.13.222441031</string>
<string>0.13.222610246</string>
</map>
<key>openal</key>
<map>
@ -3819,6 +3809,50 @@ Copyright (c) 2012, 2014, 2015, 2016 nghttp2 contributors</string>
<key>name</key>
<string>default</string>
</map>
<key>ReleaseFS</key>
<map>
<key>build</key>
<map>
<key>options</key>
<array>
<string>--build</string>
<string>--platform linux</string>
</array>
</map>
<key>configure</key>
<map>
<key>options</key>
<array>
<string>--kdu</string>
<string>--fmodstudio</string>
<string>--platform linux</string>
</array>
</map>
<key>name</key>
<string>ReleaseFS</string>
</map>
<key>ReleaseFS_open</key>
<map>
<key>build</key>
<map>
<key>options</key>
<array>
<string>--build</string>
<string>--platform linux</string>
<string>--package</string>
</array>
</map>
<key>configure</key>
<map>
<key>options</key>
<array>
<string>--platform linux</string>
<string>--package</string>
</array>
</map>
<key>name</key>
<string>ReleaseFS_open</string>
</map>
</map>
<key>name</key>
<string>linux64</string>

View File

@ -216,7 +216,7 @@ if (LINUX OR DARWIN)
list(APPEND GCC_WARNINGS "$[GCC_WARNINGS] -Wno-reorder -Wno-unused-const-variable -Wno-format-extra-args -Wno-unused-private-field -Wno-unused-function -Wno-tautological-compare -Wno-empty-body -Wno-unused-variable -Wno-unused-value")
else (${CMAKE_CXX_COMPILER_ID} STREQUAL "Clang" AND DARWIN AND XCODE_VERSION GREATER 4.9)
#elseif (${CMAKE_CXX_COMPILER_ID} STREQUAL "GNU")
list(APPEND GCC_WARNINGS "${GCC_WARNINGS} -Wno-reorder -Wno-non-virtual-dtor -Wno-unused-variable")
list(APPEND GCC_WARNINGS -Wno-reorder -Wno-non-virtual-dtor -Wno-unused-variable)
endif ()
add_compile_options(${GCC_WARNINGS})

View File

@ -34,10 +34,11 @@ elseif (DARWIN)
iconv
)
else (WINDOWS)
# linux
target_link_libraries( ll::apr INTERFACE
apr-1
aprutil-1
iconv
# iconv # <FS:Zi> Doesn't seem to be necessary for Linux
uuid
rt
)

View File

@ -11,6 +11,7 @@ target_include_directories( ll::vorbis SYSTEM INTERFACE ${LIBS_PREBUILT_DIR}/inc
if (WINDOWS)
target_link_libraries(ll::vorbis INTERFACE ogg_static vorbis_static vorbisenc_static vorbisfile_static )
else (WINDOWS)
target_link_libraries(ll::vorbis INTERFACE ogg vorbis vorbisenc vorbisfile )
# <FS:Zi> These must be in this order, or it won't link: vorbisenc vorbisfile vorbis ogg
target_link_libraries(ll::vorbis INTERFACE vorbisenc vorbisfile vorbis ogg)
endif (WINDOWS)

View File

@ -28,12 +28,12 @@ if (WINDOWS)
libboost_wave-mt${addrsfx})
elseif (LINUX)
target_link_libraries( ll::boost INTERFACE
boost_context-mt${addrsfx}
# <FS:Zi> do not change the order: fiber first, context next, or SLPlugin will not build
boost_fiber-mt${addrsfx}
boost_context-mt${addrsfx}
boost_filesystem-mt${addrsfx}
boost_program_options-mt${addrsfx}
boost_regex-mt${addrsfx}
boost_signals-mt${addrsfx}
boost_system-mt${addrsfx}
boost_thread-mt${addrsfx}
boost_wave-mt${addrsfx})

View File

@ -13,7 +13,6 @@ set(cmake_SOURCE_FILES
bugsplat.cmake
BuildVersion.cmake
CEFPlugin.cmake
CEFPlugin.cmake
CMakeCopyIfDifferent.cmake
ConfigurePkgConfig.cmake
CURL.cmake
@ -45,6 +44,7 @@ set(cmake_SOURCE_FILES
LLTestCommand.cmake
LLWindow.cmake
Linking.cmake
MediaPluginBase.cmake # <FS:Zi> Linux volume catcher
Meshoptimizer.cmake
NDOF.cmake
OPENAL.cmake

View File

@ -251,7 +251,6 @@ elseif(LINUX)
list( APPEND release_files
libapr-1.so.0
libaprutil-1.so.0
libatk-1.0.so
libfreetype.so.6.6.2
libfreetype.so.6
libhunspell-1.3.so.0.0.0
@ -259,8 +258,8 @@ elseif(LINUX)
libuuid.so.16.0.22
libfontconfig.so.1.8.0
libfontconfig.so.1
libgmodule-2.0.so
libgobject-2.0.so
libgmodule-2.0.a
libgobject-2.0.a
)
endif()

View File

@ -10,7 +10,7 @@ if (WINDOWS)
elseif (DARWIN)
target_link_libraries( fs::glod INTERFACE libGLOD.dylib)
elseif (LINUX)
target_link_libraries( fs::glod INTERFACE libGLOD.a)
target_link_libraries( fs::glod INTERFACE libGLOD.a libvds.a)
endif (WINDOWS)
target_include_directories( fs::glod SYSTEM INTERFACE

View File

@ -10,3 +10,5 @@ use_system_binary(gstreamer)
use_prebuilt_binary(gstreamer)
# <FS:Zi> Not sure if this is the correct place to add this, but it works
target_include_directories( ll::gstreamer SYSTEM INTERFACE ${LIBS_PREBUILT_DIR}/include/gstreamer-0.10)

View File

@ -2,6 +2,8 @@
# Growl is actually libnotify on linux systems.
if (DARWIN OR WINDOWS) # <FS:Zi> no need to do these things on Linux
include_guard()
add_library( fs::growl INTERFACE IMPORTED )
@ -13,8 +15,9 @@ elseif (DARWIN)
target_link_libraries( fs:growl INTERFACE libgrowl.dylib libgrowl++.dylib)
endif (WINDOWS)
add_compile_definitions(HAS_GROWL)
target_include_directories( fs::growl SYSTEM INTERFACE
${AUTOBUILD_INSTALL_DIR}/include/Growl
)
)
endif (DARWIN OR WINDOWS) # <FS:Zi> no need to do these things on Linux
add_compile_definitions(HAS_GROWL)

View File

@ -12,6 +12,6 @@ if (WINDOWS)
elseif (DARWIN)
target_link_libraries( ll::jsoncpp INTERFACE libjson_darwin_libmt.a )
elseif (LINUX)
target_link_libraries( ll::jsoncpp INTERFACE libjson_linux-gcc-4.1.3_libmt.a )
target_link_libraries( ll::jsoncpp INTERFACE libjson_linux-gcc-5.4.0_libmt.a )
endif (WINDOWS)
target_include_directories( ll::jsoncpp SYSTEM INTERFACE ${LIBS_PREBUILT_DIR}/include)

View File

@ -16,7 +16,6 @@ if (LINUX)
#use_prebuilt_binary(SDL)
target_include_directories( ll::SDL SYSTEM INTERFACE ${LIBS_PREBUILT_DIR}/include)
target_link_libraries( ll::SDL INTERFACE SDL directfb fusion direct X11)
if( USE_SDL1 )
target_compile_definitions( ll::SDL INTERFACE LL_SDL=1 )
@ -25,7 +24,7 @@ if (LINUX)
use_prebuilt_binary(SDL)
set (SDL_FOUND TRUE)
target_link_libraries (sdl INTERFACE SDL directfb fusion direct X11)
target_link_libraries (ll::SDL INTERFACE SDL directfb fusion direct X11)
else()
target_compile_definitions( ll::SDL INTERFACE LL_SDL2=1 LL_SDL=1 )

View File

@ -0,0 +1,29 @@
# -*- cmake -*-
set(CMAKE_VERBOSE_MAKEFILE ON) # <FS:Zi> remove this once things work
# <FS:ND> Try to find pulse header, if we got them we can use the linux volume catcher
if (LINUX)
include(GLIB)
include_directories( ${GLIB_INCLUDE_DIRS} )
foreach( PULSE_FILE pulse/introspect.h pulse/context.h pulse/subscribe.h pulse/glib-mainloop.h )
find_path( PULSE_FILE_${PULSE_FILE}_FOUND ${PULSE_FILE} NO_CACHE)
if( NOT PULSE_FILE_${PULSE_FILE}_FOUND )
message( "Looking for ${PULSE_FILE} ... not found")
message( FATAL_ERROR "Pulse header not found" )
else()
message( "Looking for ${PULSE_FILE} ... found")
endif()
endforeach()
message( "Building with linux volume catcher" )
set(LINUX_VOLUME_CATCHER linux_volume_catcher.cpp)
set(MEDIA_PLUGIN_BASE_INCLUDE_DIRS
${LIBS_OPEN_DIR}/media_plugins/base/
)
set(MEDIA_PLUGIN_BASE_LIBRARIES media_plugin_base)
endif() # <FS:Zi> make sure no changes happen to other platforms by moving endif() here

View File

@ -12,7 +12,7 @@ use_prebuilt_binary(meshoptimizer)
if (WINDOWS)
target_link_libraries( ll::meshoptimizer INTERFACE meshoptimizer.lib)
elseif (LINUX)
target_link_libraries( ll::meshoptimizer INTERFACE meshoptimizer.o)
target_link_libraries( ll::meshoptimizer INTERFACE libmeshoptimizer.a)
elseif (DARWIN)
target_link_libraries( ll::meshoptimizer INTERFACE libmeshoptimizer.a)
endif (WINDOWS)

View File

@ -9,6 +9,12 @@ include_guard()
# It probably makes sense to to completely remove it
set(USE_OPENAL OFF CACHE BOOL "Enable OpenAL")
# <FS:Zi> Always download the libopenal.so library on Linux for SLVoice
if (LINUX)
use_prebuilt_binary(openal)
endif (LINUX)
# ND: To streamline arguments passed, switch from OPENAL to USE_OPENAL
# To not break all old build scripts convert old arguments but warn about it
if(OPENAL)

View File

@ -1,5 +1,11 @@
# -*- cmake -*-
if(LINUX)
# <FS:Zi> make sure to link to libGL.so instead of libOpenGL.so so the linker does not
# complain about libGL.so.1: error adding symbols: DSO missing from command line
set(OpenGL_GL_PREFERENCE "LEGACY")
endif()
include(Variables)
include(Prebuilt)
include(FindOpenGL)

View File

@ -6,31 +6,28 @@ include(GLIB)
add_library( ll::uilibraries INTERFACE IMPORTED )
if (LINUX)
target_compile_definitions(ll::uilibraries INTERFACE LL_GTK=1 LL_X11=1 )
use_prebuilt_binary(fltk)
target_compile_definitions(ll::uilibraries INTERFACE LL_FLTK=1 LL_X11=1 )
if( USE_CONAN )
target_link_libraries( ll::uilibraries INTERFACE CONAN_PKG::gtk )
return()
endif()
use_prebuilt_binary(gtk-atk-pango-glib)
target_link_libraries( ll::uilibraries INTERFACE
atk-1.0
gdk-x11-2.0
gdk_pixbuf-2.0
fltk
X11
Xinerama
glib-2.0
gmodule-2.0
gobject-2.0
gthread-2.0
gtk-x11-2.0
pango-1.0
pangoft2-1.0
pangox-1.0
pangoxft-1.0
Xinerama
ll::freetype
)
target_include_directories( ll::uilibraries SYSTEM INTERFACE
${GLIB_INCLUDE_DIRS}
)
endif (LINUX)
if( WINDOWS )
target_link_libraries( ll::uilibraries INTERFACE

View File

@ -2,7 +2,7 @@
include(Prebuilt)
if (LINUX)
#use_prebuilt_binary(libuuid)
use_prebuilt_binary(libuuid)
add_library( ll::fontconfig INTERFACE IMPORTED )
if( NOT USE_CONAN )

View File

@ -2,8 +2,9 @@
add_subdirectory(base)
if (LINUX)
#add_subdirectory(gstreamer010)
add_subdirectory(example)
add_subdirectory(gstreamer010)
add_subdirectory(cef)
#add_subdirectory(example)
endif (LINUX)
if (DARWIN)

View File

@ -8,6 +8,7 @@ include(LLCommon)
include(LLWindow)
include(Linking)
include(PluginAPI)
include(MediaPluginBase) # <FS:Zi> Linux volume catcher
include(CEFPlugin)
@ -30,14 +31,17 @@ set(media_plugin_cef_HEADER_FILES
volume_catcher.h
)
if (NOT DISABLE_VOLUME_CATCHER) # <FS:Zi> disable volume catcher in cef with -DDISABLE_VOLUME_CATCHER=TRUE
add_compile_definitions(LL_VOLUME_CATCHER)
# Select which VolumeCatcher implementation to use
if (LINUX)
# message(FATAL_ERROR "CEF plugin has been enabled for a Linux compile.\n"
# " Please create a volume_catcher implementation for this platform.")
list(APPEND media_plugin_cef_SOURCE_FILES ${LINUX_VOLUME_CATCHER})
set(CMAKE_SHARED_LINKER_FLAGS "-Wl,--build-id -Wl,-rpath,'$ORIGIN:$ORIGIN/../../lib'")
list(APPEND media_plugin_cef_LINK_LIBRARIES llwindow )
list(APPEND media_plugin_cef_LINK_LIBRARIES llwindow ${MEDIA_PLUGIN_BASE_LIBRARIES})
elseif (DARWIN)
list(APPEND media_plugin_cef_SOURCE_FILES mac_volume_catcher_null.cpp)
find_library(CORESERVICES_LIBRARY CoreServices)
@ -50,6 +54,8 @@ elseif (WINDOWS)
list(APPEND media_plugin_cef_SOURCE_FILES windows_volume_catcher.cpp)
endif (LINUX)
endif (NOT DISABLE_VOLUME_CATCHER)
list(APPEND media_plugin_cef_SOURCE_FILES ${media_plugin_cef_HEADER_FILES})
add_library(media_plugin_cef

View File

@ -35,7 +35,9 @@
#include "llpluginmessage.h"
#include "llpluginmessageclasses.h"
#include "llstring.h"
#if LL_VOLUME_CATCHER
#include "volume_catcher.h"
#endif
#include "media_plugin_base.h"
#include "dullahan.h"
@ -109,7 +111,9 @@ private:
std::string mCefLogFile;
bool mCefLogVerbose;
std::vector<std::string> mPickedFiles;
#if LL_VOLUME_CATCHER
VolumeCatcher mVolumeCatcher;
#endif
F32 mCurVolume;
dullahan* mCEFLib;
};
@ -544,7 +548,9 @@ void MediaPluginCEF::receiveMessage(const char* message_string)
{
mCEFLib->update();
#if LL_VOLUME_CATCHER
mVolumeCatcher.pump();
#endif
// this seems bad but unless the state changes (it won't until we figure out
// how to get CEF to tell us if copy/cut/paste is available) then this function
@ -1171,7 +1177,9 @@ void MediaPluginCEF::checkEditState()
void MediaPluginCEF::setVolume()
{
#if LL_VOLUME_CATCHER
mVolumeCatcher.setVolume(mCurVolume);
#endif
}
////////////////////////////////////////////////////////////////////////////////

View File

@ -10,6 +10,7 @@ include(LLWindow)
include(Linking)
include(PluginAPI)
include(OpenGL)
include(MediaPluginBase) # <FS:Zi> Linux volume catcher
include(GStreamer010Plugin)

View File

@ -8,6 +8,7 @@ include(LLImage)
include(LLWindow)
include(Linking)
include(PluginAPI)
include(MediaPluginBase) # <FS:Zi> Linux volume catcher
include(LibVLCPlugin)

View File

@ -2375,7 +2375,7 @@ target_link_libraries(${VIEWER_BINARY_NAME}
ll::bugsplat
ll::tracy
fs::glod # <FS:Beq/> restore GLOD dependencies
fs::growl # <FS:Ansariel> Growl support
# fs::growl # <FS:Ansariel> Growl support <FS:Zi> added further down for win/mac only
)
if( TARGET ll::intel_memops )
@ -2392,6 +2392,7 @@ endif (USE_BUGSPLAT)
if (WINDOWS)
target_link_libraries(${VIEWER_BINARY_NAME}
fs::growl # <FS:Ansariel> Growl support
${GROWL_LIBRARY}
)
endif (WINDOWS)
@ -2401,7 +2402,15 @@ if( TARGET ll::nvapi )
endif()
if (LINUX)
target_link_libraries(${VIEWER_BINARY_NAME} "dl" )
# <FS:Zi> put these additional libraries in the viewer build target here as it didn't
# work to put them in via their cmake/* files
target_link_libraries(${VIEWER_BINARY_NAME}
"dl"
# <FS:Zi> I wish I knew how to make this cleaner, this looks like a mess
"fontconfig" # <FS:Zi> tried ll::fontconfig, didn't work
ll::vorbis
${GIO_LIBRARIES}
)
endif (LINUX)
set(ARTWORK_DIR ${CMAKE_CURRENT_SOURCE_DIR} CACHE PATH
@ -2414,11 +2423,13 @@ if (LINUX)
set(COPY_INPUT_DEPENDENCIES
${VIEWER_BINARY_NAME}
SLPlugin
#media_plugin_gstreamer010
media_plugin_cef
media_plugin_gstreamer010
llcommon
linux-crash-logger
)
add_dependencies(${VIEWER_BINARY_NAME} SLPlugin media_plugin_gstreamer10 media_plugin_cef linux-crash-logger)
add_dependencies(${VIEWER_BINARY_NAME} SLPlugin media_plugin_gstreamer010 media_plugin_cef linux-crash-logger)
add_custom_command(
OUTPUT ${product}.tar.bz2

View File

@ -1910,7 +1910,7 @@ class LinuxManifest(ViewerManifest):
# plugins
with self.prefix(src=os.path.join(self.args['build'], os.pardir, 'media_plugins'), dst="bin/llplugin"):
self.path("gstreamer10/libmedia_plugin_gstreamer10.so", "libmedia_plugin_gstreamer.so")
self.path("gstreamer010/libmedia_plugin_gstreamer010.so", "libmedia_plugin_gstreamer.so")
self.path("cef/libmedia_plugin_cef.so", "libmedia_plugin_cef.so" )
# CEF files