aboutsummaryrefslogtreecommitdiff
path: root/configure
diff options
context:
space:
mode:
authorJohannes Schickel2016-01-12 22:41:23 +0100
committerJohannes Schickel2016-01-12 22:45:41 +0100
commit90354bf8e1aad6b06c41cb38b5f73e4ff2d6afbf (patch)
treeb4b72f98481153e753fe01586879599275f72b13 /configure
parent7be4a743054db6bbde68fafb577130c3f4aa5289 (diff)
downloadscummvm-rg350-90354bf8e1aad6b06c41cb38b5f73e4ff2d6afbf.tar.gz
scummvm-rg350-90354bf8e1aad6b06c41cb38b5f73e4ff2d6afbf.tar.bz2
scummvm-rg350-90354bf8e1aad6b06c41cb38b5f73e4ff2d6afbf.zip
CONFIGURE: Make FluidSynth detection more reliable.
1. We use actual FluidSynth symbols in our test program now. This assures that linking actually checks for presence of symbols. Which in turn checks that the library linked can be used with our link configuration. 2. Add simple hardcoded list of FluidSynth dependencies. This helps detection of statically built FluidSynth.
Diffstat (limited to 'configure')
-rwxr-xr-xconfigure54
1 files changed, 40 insertions, 14 deletions
diff --git a/configure b/configure
index 3ad30fef70..fe2db0255b 100755
--- a/configure
+++ b/configure
@@ -3892,26 +3892,52 @@ fi
echo "$_sparkle"
#
-# Check for libfluidsynth
+# Check for FluidSynth
#
-echocheck "libfluidsynth"
-if test "$_fluidsynth" = auto ; then
+echocheck "FluidSynth"
+
+append_var FLUIDSYNTH_LIBS "-lfluidsynth"
+case $_host_os in
+ mingw*)
+ # TODO: Modern FluidSynth requires glib. Our buildbot uses an older
+ # FluidSynth version which does not require glib. Additionally, it
+ # does not contain any glib libraries. We hack the libraries
+ # required for static linking here to make it work with buildbot.
+ # Once we upgraded to a new version, glib and its dependencies
+ # should be added.
+ FLUIDSYNTH_STATIC_LIBS="$FLUIDSYNTH_LIBS -ldsound -lwinmm"
+ ;;
+
+ darwin*)
+ # TODO: Check actual requirements for static FluidSynth and
+ # dependencies linking. This is currently based on iOS dependencies
+ # which might be different due to less features enabled for iOS.
+ FLUIDSYNTH_STATIC_LIBS="$FLUIDSYNTH_LIBS -framework Foundation -framework CoreMIDI -lglib-2.0 -lintl -liconv"
+ ;;
+
+ iphone)
+ FLUIDSYNTH_STATIC_LIBS="$FLUIDSYNTH_LIBS -framework Foundation -framework CoreMIDI -lglib-2.0 -lintl -liconv"
+ ;;
+
+ *)
+ FLUIDSYNTH_STATIC_LIBS="$FLUIDSYNTH_LIBS -lglib-2.0 -lintl -liconv"
+ ;;
+esac
+
+if test "$_fluidsynth" = auto; then
_fluidsynth=no
cat > $TMPC << EOF
#include <fluidsynth.h>
-int main(void) { return 0; }
+int main(void) { delete_fluid_settings(new_fluid_settings()); return 0; }
EOF
- cc_check $FLUIDSYNTH_CFLAGS $FLUIDSYNTH_LIBS -lfluidsynth && _fluidsynth=yes
+ cc_check_no_clean $FLUIDSYNTH_CFLAGS $FLUIDSYNTH_LIBS && _fluidsynth=yes
+ if test "$_fluidsynth" != yes; then
+ FLUIDSYNTH_LIBS="$FLUIDSYNTH_STATIC_LIBS"
+ cc_check_no_clean $FLUIDSYNTH_CFLAGS $FLUIDSYNTH_LIBS && _fluidsynth=yes
+ fi
fi
-if test "$_fluidsynth" = yes ; then
- case $_host_os in
- mingw*)
- append_var LIBS "$FLUIDSYNTH_LIBS -lfluidsynth -ldsound -lwinmm"
- ;;
- *)
- append_var LIBS "$FLUIDSYNTH_LIBS -lfluidsynth"
- ;;
- esac
+if test "$_fluidsynth" = yes; then
+ append_var LIBS "$FLUIDSYNTH_LIBS"
append_var INCLUDES "$FLUIDSYNTH_CFLAGS"
fi
define_in_config_if_yes "$_fluidsynth" 'USE_FLUIDSYNTH'