configury: libmodplug detection updates/fixes from default 2.0 branch. SDL-1.2
authorOzkan Sezer <sezeroz@gmail.com>
Sat, 13 Oct 2018 22:20:22 +0300
branchSDL-1.2
changeset 907f4c576887ec3
parent 905 a31a903d1f72
child 908 6b860486ce24
configury: libmodplug detection updates/fixes from default 2.0 branch.
configure
configure.in
music_modplug.h
     1.1 --- a/configure	Sat Oct 13 17:20:02 2018 +0300
     1.2 +++ b/configure	Sat Oct 13 22:20:22 2018 +0300
     1.3 @@ -11963,7 +11963,6 @@
     1.4      fi
     1.5  }
     1.6  
     1.7 -
     1.8  find_lib()
     1.9  {
    1.10      gcc_bin_path=`$CC -print-search-dirs 2>/dev/null | fgrep programs: | sed 's/[^=]*=\(.*\)/\1/' | sed 's/:/ /g'`
    1.11 @@ -12786,7 +12785,6 @@
    1.12  
    1.13  
    1.14      if test "$LIBMIKMOD_CONFIG" != "no" ; then
    1.15 -
    1.16          CFLAGS_SAVED="$CFLAGS"
    1.17          LIBS_SAVED="$LIBS"
    1.18          CFLAGS="$CFLAGS -DLIBMIKMOD_MUSIC `$LIBMIKMOD_CONFIG --cflags`"
    1.19 @@ -12954,66 +12952,432 @@
    1.20  	# Put the nasty error message in config.log where it belongs
    1.21  	echo "$MODPLUG_PKG_ERRORS" >&5
    1.22  
    1.23 -	{ { $as_echo "$as_me:$LINENO: error: Package requirements (libmodplug >= 0.8.7) were not met:
    1.24 -
    1.25 -$MODPLUG_PKG_ERRORS
    1.26 -
    1.27 -Consider adjusting the PKG_CONFIG_PATH environment variable if you
    1.28 -installed software in a non-standard prefix.
    1.29 -
    1.30 -Alternatively, you may set the environment variables MODPLUG_CFLAGS
    1.31 -and MODPLUG_LIBS to avoid the need to call pkg-config.
    1.32 -See the pkg-config man page for more details.
    1.33 -" >&5
    1.34 -$as_echo "$as_me: error: Package requirements (libmodplug >= 0.8.7) were not met:
    1.35 -
    1.36 -$MODPLUG_PKG_ERRORS
    1.37 -
    1.38 -Consider adjusting the PKG_CONFIG_PATH environment variable if you
    1.39 -installed software in a non-standard prefix.
    1.40 -
    1.41 -Alternatively, you may set the environment variables MODPLUG_CFLAGS
    1.42 -and MODPLUG_LIBS to avoid the need to call pkg-config.
    1.43 -See the pkg-config man page for more details.
    1.44 -" >&2;}
    1.45 -   { (exit 1); exit 1; }; }
    1.46 +	{ $as_echo "$as_me:$LINENO: result: no" >&5
    1.47 +$as_echo "no" >&6; }
    1.48 +                            if test "${ac_cv_header_libmodplug_modplug_h+set}" = set; then
    1.49 +  { $as_echo "$as_me:$LINENO: checking for libmodplug/modplug.h" >&5
    1.50 +$as_echo_n "checking for libmodplug/modplug.h... " >&6; }
    1.51 +if test "${ac_cv_header_libmodplug_modplug_h+set}" = set; then
    1.52 +  $as_echo_n "(cached) " >&6
    1.53 +fi
    1.54 +{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_libmodplug_modplug_h" >&5
    1.55 +$as_echo "$ac_cv_header_libmodplug_modplug_h" >&6; }
    1.56 +else
    1.57 +  # Is the header compilable?
    1.58 +{ $as_echo "$as_me:$LINENO: checking libmodplug/modplug.h usability" >&5
    1.59 +$as_echo_n "checking libmodplug/modplug.h usability... " >&6; }
    1.60 +cat >conftest.$ac_ext <<_ACEOF
    1.61 +/* confdefs.h.  */
    1.62 +_ACEOF
    1.63 +cat confdefs.h >>conftest.$ac_ext
    1.64 +cat >>conftest.$ac_ext <<_ACEOF
    1.65 +/* end confdefs.h.  */
    1.66 +$ac_includes_default
    1.67 +#include <libmodplug/modplug.h>
    1.68 +_ACEOF
    1.69 +rm -f conftest.$ac_objext
    1.70 +if { (ac_try="$ac_compile"
    1.71 +case "(($ac_try" in
    1.72 +  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
    1.73 +  *) ac_try_echo=$ac_try;;
    1.74 +esac
    1.75 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
    1.76 +$as_echo "$ac_try_echo") >&5
    1.77 +  (eval "$ac_compile") 2>conftest.er1
    1.78 +  ac_status=$?
    1.79 +  grep -v '^ *+' conftest.er1 >conftest.err
    1.80 +  rm -f conftest.er1
    1.81 +  cat conftest.err >&5
    1.82 +  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
    1.83 +  (exit $ac_status); } && {
    1.84 +	 test -z "$ac_c_werror_flag" ||
    1.85 +	 test ! -s conftest.err
    1.86 +       } && test -s conftest.$ac_objext; then
    1.87 +  ac_header_compiler=yes
    1.88 +else
    1.89 +  $as_echo "$as_me: failed program was:" >&5
    1.90 +sed 's/^/| /' conftest.$ac_ext >&5
    1.91 +
    1.92 +	ac_header_compiler=no
    1.93 +fi
    1.94 +
    1.95 +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
    1.96 +{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
    1.97 +$as_echo "$ac_header_compiler" >&6; }
    1.98 +
    1.99 +# Is the header present?
   1.100 +{ $as_echo "$as_me:$LINENO: checking libmodplug/modplug.h presence" >&5
   1.101 +$as_echo_n "checking libmodplug/modplug.h presence... " >&6; }
   1.102 +cat >conftest.$ac_ext <<_ACEOF
   1.103 +/* confdefs.h.  */
   1.104 +_ACEOF
   1.105 +cat confdefs.h >>conftest.$ac_ext
   1.106 +cat >>conftest.$ac_ext <<_ACEOF
   1.107 +/* end confdefs.h.  */
   1.108 +#include <libmodplug/modplug.h>
   1.109 +_ACEOF
   1.110 +if { (ac_try="$ac_cpp conftest.$ac_ext"
   1.111 +case "(($ac_try" in
   1.112 +  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   1.113 +  *) ac_try_echo=$ac_try;;
   1.114 +esac
   1.115 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
   1.116 +$as_echo "$ac_try_echo") >&5
   1.117 +  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
   1.118 +  ac_status=$?
   1.119 +  grep -v '^ *+' conftest.er1 >conftest.err
   1.120 +  rm -f conftest.er1
   1.121 +  cat conftest.err >&5
   1.122 +  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   1.123 +  (exit $ac_status); } >/dev/null && {
   1.124 +	 test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
   1.125 +	 test ! -s conftest.err
   1.126 +       }; then
   1.127 +  ac_header_preproc=yes
   1.128 +else
   1.129 +  $as_echo "$as_me: failed program was:" >&5
   1.130 +sed 's/^/| /' conftest.$ac_ext >&5
   1.131 +
   1.132 +  ac_header_preproc=no
   1.133 +fi
   1.134 +
   1.135 +rm -f conftest.err conftest.$ac_ext
   1.136 +{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
   1.137 +$as_echo "$ac_header_preproc" >&6; }
   1.138 +
   1.139 +# So?  What about this header?
   1.140 +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
   1.141 +  yes:no: )
   1.142 +    { $as_echo "$as_me:$LINENO: WARNING: libmodplug/modplug.h: accepted by the compiler, rejected by the preprocessor!" >&5
   1.143 +$as_echo "$as_me: WARNING: libmodplug/modplug.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
   1.144 +    { $as_echo "$as_me:$LINENO: WARNING: libmodplug/modplug.h: proceeding with the compiler's result" >&5
   1.145 +$as_echo "$as_me: WARNING: libmodplug/modplug.h: proceeding with the compiler's result" >&2;}
   1.146 +    ac_header_preproc=yes
   1.147 +    ;;
   1.148 +  no:yes:* )
   1.149 +    { $as_echo "$as_me:$LINENO: WARNING: libmodplug/modplug.h: present but cannot be compiled" >&5
   1.150 +$as_echo "$as_me: WARNING: libmodplug/modplug.h: present but cannot be compiled" >&2;}
   1.151 +    { $as_echo "$as_me:$LINENO: WARNING: libmodplug/modplug.h:     check for missing prerequisite headers?" >&5
   1.152 +$as_echo "$as_me: WARNING: libmodplug/modplug.h:     check for missing prerequisite headers?" >&2;}
   1.153 +    { $as_echo "$as_me:$LINENO: WARNING: libmodplug/modplug.h: see the Autoconf documentation" >&5
   1.154 +$as_echo "$as_me: WARNING: libmodplug/modplug.h: see the Autoconf documentation" >&2;}
   1.155 +    { $as_echo "$as_me:$LINENO: WARNING: libmodplug/modplug.h:     section \"Present But Cannot Be Compiled\"" >&5
   1.156 +$as_echo "$as_me: WARNING: libmodplug/modplug.h:     section \"Present But Cannot Be Compiled\"" >&2;}
   1.157 +    { $as_echo "$as_me:$LINENO: WARNING: libmodplug/modplug.h: proceeding with the preprocessor's result" >&5
   1.158 +$as_echo "$as_me: WARNING: libmodplug/modplug.h: proceeding with the preprocessor's result" >&2;}
   1.159 +    { $as_echo "$as_me:$LINENO: WARNING: libmodplug/modplug.h: in the future, the compiler will take precedence" >&5
   1.160 +$as_echo "$as_me: WARNING: libmodplug/modplug.h: in the future, the compiler will take precedence" >&2;}
   1.161 +
   1.162 +    ;;
   1.163 +esac
   1.164 +{ $as_echo "$as_me:$LINENO: checking for libmodplug/modplug.h" >&5
   1.165 +$as_echo_n "checking for libmodplug/modplug.h... " >&6; }
   1.166 +if test "${ac_cv_header_libmodplug_modplug_h+set}" = set; then
   1.167 +  $as_echo_n "(cached) " >&6
   1.168 +else
   1.169 +  ac_cv_header_libmodplug_modplug_h=$ac_header_preproc
   1.170 +fi
   1.171 +{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_libmodplug_modplug_h" >&5
   1.172 +$as_echo "$ac_cv_header_libmodplug_modplug_h" >&6; }
   1.173 +
   1.174 +fi
   1.175 +if test "x$ac_cv_header_libmodplug_modplug_h" = x""yes; then
   1.176 +  have_libmodplug_hdr=yes
   1.177 +fi
   1.178 +
   1.179 +
   1.180 +            { $as_echo "$as_me:$LINENO: checking for ModPlug_Load in -lmodplug" >&5
   1.181 +$as_echo_n "checking for ModPlug_Load in -lmodplug... " >&6; }
   1.182 +if test "${ac_cv_lib_modplug_ModPlug_Load+set}" = set; then
   1.183 +  $as_echo_n "(cached) " >&6
   1.184 +else
   1.185 +  ac_check_lib_save_LIBS=$LIBS
   1.186 +LIBS="-lmodplug  $LIBS"
   1.187 +cat >conftest.$ac_ext <<_ACEOF
   1.188 +/* confdefs.h.  */
   1.189 +_ACEOF
   1.190 +cat confdefs.h >>conftest.$ac_ext
   1.191 +cat >>conftest.$ac_ext <<_ACEOF
   1.192 +/* end confdefs.h.  */
   1.193 +
   1.194 +/* Override any GCC internal prototype to avoid an error.
   1.195 +   Use char because int might match the return type of a GCC
   1.196 +   builtin and then its argument prototype would still apply.  */
   1.197 +#ifdef __cplusplus
   1.198 +extern "C"
   1.199 +#endif
   1.200 +char ModPlug_Load ();
   1.201 +int
   1.202 +main ()
   1.203 +{
   1.204 +return ModPlug_Load ();
   1.205 +  ;
   1.206 +  return 0;
   1.207 +}
   1.208 +_ACEOF
   1.209 +rm -f conftest.$ac_objext conftest$ac_exeext
   1.210 +if { (ac_try="$ac_link"
   1.211 +case "(($ac_try" in
   1.212 +  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   1.213 +  *) ac_try_echo=$ac_try;;
   1.214 +esac
   1.215 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
   1.216 +$as_echo "$ac_try_echo") >&5
   1.217 +  (eval "$ac_link") 2>conftest.er1
   1.218 +  ac_status=$?
   1.219 +  grep -v '^ *+' conftest.er1 >conftest.err
   1.220 +  rm -f conftest.er1
   1.221 +  cat conftest.err >&5
   1.222 +  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   1.223 +  (exit $ac_status); } && {
   1.224 +	 test -z "$ac_c_werror_flag" ||
   1.225 +	 test ! -s conftest.err
   1.226 +       } && test -s conftest$ac_exeext && {
   1.227 +	 test "$cross_compiling" = yes ||
   1.228 +	 $as_test_x conftest$ac_exeext
   1.229 +       }; then
   1.230 +  ac_cv_lib_modplug_ModPlug_Load=yes
   1.231 +else
   1.232 +  $as_echo "$as_me: failed program was:" >&5
   1.233 +sed 's/^/| /' conftest.$ac_ext >&5
   1.234 +
   1.235 +	ac_cv_lib_modplug_ModPlug_Load=no
   1.236 +fi
   1.237 +
   1.238 +rm -rf conftest.dSYM
   1.239 +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
   1.240 +      conftest$ac_exeext conftest.$ac_ext
   1.241 +LIBS=$ac_check_lib_save_LIBS
   1.242 +fi
   1.243 +{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_modplug_ModPlug_Load" >&5
   1.244 +$as_echo "$ac_cv_lib_modplug_ModPlug_Load" >&6; }
   1.245 +if test "x$ac_cv_lib_modplug_ModPlug_Load" = x""yes; then
   1.246 +  have_libmodplug_lib=yes
   1.247 +fi
   1.248 +
   1.249 +
   1.250  elif test $pkg_failed = untried; then
   1.251 -	{ { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
   1.252 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
   1.253 -{ { $as_echo "$as_me:$LINENO: error: The pkg-config script could not be found or is too old.  Make sure it
   1.254 -is in your PATH or set the PKG_CONFIG environment variable to the full
   1.255 -path to pkg-config.
   1.256 -
   1.257 -Alternatively, you may set the environment variables MODPLUG_CFLAGS
   1.258 -and MODPLUG_LIBS to avoid the need to call pkg-config.
   1.259 -See the pkg-config man page for more details.
   1.260 -
   1.261 -To get pkg-config, see <http://pkg-config.freedesktop.org/>.
   1.262 -See \`config.log' for more details." >&5
   1.263 -$as_echo "$as_me: error: The pkg-config script could not be found or is too old.  Make sure it
   1.264 -is in your PATH or set the PKG_CONFIG environment variable to the full
   1.265 -path to pkg-config.
   1.266 -
   1.267 -Alternatively, you may set the environment variables MODPLUG_CFLAGS
   1.268 -and MODPLUG_LIBS to avoid the need to call pkg-config.
   1.269 -See the pkg-config man page for more details.
   1.270 -
   1.271 -To get pkg-config, see <http://pkg-config.freedesktop.org/>.
   1.272 -See \`config.log' for more details." >&2;}
   1.273 -   { (exit 1); exit 1; }; }; }
   1.274 +	            if test "${ac_cv_header_libmodplug_modplug_h+set}" = set; then
   1.275 +  { $as_echo "$as_me:$LINENO: checking for libmodplug/modplug.h" >&5
   1.276 +$as_echo_n "checking for libmodplug/modplug.h... " >&6; }
   1.277 +if test "${ac_cv_header_libmodplug_modplug_h+set}" = set; then
   1.278 +  $as_echo_n "(cached) " >&6
   1.279 +fi
   1.280 +{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_libmodplug_modplug_h" >&5
   1.281 +$as_echo "$ac_cv_header_libmodplug_modplug_h" >&6; }
   1.282 +else
   1.283 +  # Is the header compilable?
   1.284 +{ $as_echo "$as_me:$LINENO: checking libmodplug/modplug.h usability" >&5
   1.285 +$as_echo_n "checking libmodplug/modplug.h usability... " >&6; }
   1.286 +cat >conftest.$ac_ext <<_ACEOF
   1.287 +/* confdefs.h.  */
   1.288 +_ACEOF
   1.289 +cat confdefs.h >>conftest.$ac_ext
   1.290 +cat >>conftest.$ac_ext <<_ACEOF
   1.291 +/* end confdefs.h.  */
   1.292 +$ac_includes_default
   1.293 +#include <libmodplug/modplug.h>
   1.294 +_ACEOF
   1.295 +rm -f conftest.$ac_objext
   1.296 +if { (ac_try="$ac_compile"
   1.297 +case "(($ac_try" in
   1.298 +  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   1.299 +  *) ac_try_echo=$ac_try;;
   1.300 +esac
   1.301 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
   1.302 +$as_echo "$ac_try_echo") >&5
   1.303 +  (eval "$ac_compile") 2>conftest.er1
   1.304 +  ac_status=$?
   1.305 +  grep -v '^ *+' conftest.er1 >conftest.err
   1.306 +  rm -f conftest.er1
   1.307 +  cat conftest.err >&5
   1.308 +  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   1.309 +  (exit $ac_status); } && {
   1.310 +	 test -z "$ac_c_werror_flag" ||
   1.311 +	 test ! -s conftest.err
   1.312 +       } && test -s conftest.$ac_objext; then
   1.313 +  ac_header_compiler=yes
   1.314 +else
   1.315 +  $as_echo "$as_me: failed program was:" >&5
   1.316 +sed 's/^/| /' conftest.$ac_ext >&5
   1.317 +
   1.318 +	ac_header_compiler=no
   1.319 +fi
   1.320 +
   1.321 +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
   1.322 +{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
   1.323 +$as_echo "$ac_header_compiler" >&6; }
   1.324 +
   1.325 +# Is the header present?
   1.326 +{ $as_echo "$as_me:$LINENO: checking libmodplug/modplug.h presence" >&5
   1.327 +$as_echo_n "checking libmodplug/modplug.h presence... " >&6; }
   1.328 +cat >conftest.$ac_ext <<_ACEOF
   1.329 +/* confdefs.h.  */
   1.330 +_ACEOF
   1.331 +cat confdefs.h >>conftest.$ac_ext
   1.332 +cat >>conftest.$ac_ext <<_ACEOF
   1.333 +/* end confdefs.h.  */
   1.334 +#include <libmodplug/modplug.h>
   1.335 +_ACEOF
   1.336 +if { (ac_try="$ac_cpp conftest.$ac_ext"
   1.337 +case "(($ac_try" in
   1.338 +  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   1.339 +  *) ac_try_echo=$ac_try;;
   1.340 +esac
   1.341 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
   1.342 +$as_echo "$ac_try_echo") >&5
   1.343 +  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
   1.344 +  ac_status=$?
   1.345 +  grep -v '^ *+' conftest.er1 >conftest.err
   1.346 +  rm -f conftest.er1
   1.347 +  cat conftest.err >&5
   1.348 +  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   1.349 +  (exit $ac_status); } >/dev/null && {
   1.350 +	 test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
   1.351 +	 test ! -s conftest.err
   1.352 +       }; then
   1.353 +  ac_header_preproc=yes
   1.354 +else
   1.355 +  $as_echo "$as_me: failed program was:" >&5
   1.356 +sed 's/^/| /' conftest.$ac_ext >&5
   1.357 +
   1.358 +  ac_header_preproc=no
   1.359 +fi
   1.360 +
   1.361 +rm -f conftest.err conftest.$ac_ext
   1.362 +{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
   1.363 +$as_echo "$ac_header_preproc" >&6; }
   1.364 +
   1.365 +# So?  What about this header?
   1.366 +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
   1.367 +  yes:no: )
   1.368 +    { $as_echo "$as_me:$LINENO: WARNING: libmodplug/modplug.h: accepted by the compiler, rejected by the preprocessor!" >&5
   1.369 +$as_echo "$as_me: WARNING: libmodplug/modplug.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
   1.370 +    { $as_echo "$as_me:$LINENO: WARNING: libmodplug/modplug.h: proceeding with the compiler's result" >&5
   1.371 +$as_echo "$as_me: WARNING: libmodplug/modplug.h: proceeding with the compiler's result" >&2;}
   1.372 +    ac_header_preproc=yes
   1.373 +    ;;
   1.374 +  no:yes:* )
   1.375 +    { $as_echo "$as_me:$LINENO: WARNING: libmodplug/modplug.h: present but cannot be compiled" >&5
   1.376 +$as_echo "$as_me: WARNING: libmodplug/modplug.h: present but cannot be compiled" >&2;}
   1.377 +    { $as_echo "$as_me:$LINENO: WARNING: libmodplug/modplug.h:     check for missing prerequisite headers?" >&5
   1.378 +$as_echo "$as_me: WARNING: libmodplug/modplug.h:     check for missing prerequisite headers?" >&2;}
   1.379 +    { $as_echo "$as_me:$LINENO: WARNING: libmodplug/modplug.h: see the Autoconf documentation" >&5
   1.380 +$as_echo "$as_me: WARNING: libmodplug/modplug.h: see the Autoconf documentation" >&2;}
   1.381 +    { $as_echo "$as_me:$LINENO: WARNING: libmodplug/modplug.h:     section \"Present But Cannot Be Compiled\"" >&5
   1.382 +$as_echo "$as_me: WARNING: libmodplug/modplug.h:     section \"Present But Cannot Be Compiled\"" >&2;}
   1.383 +    { $as_echo "$as_me:$LINENO: WARNING: libmodplug/modplug.h: proceeding with the preprocessor's result" >&5
   1.384 +$as_echo "$as_me: WARNING: libmodplug/modplug.h: proceeding with the preprocessor's result" >&2;}
   1.385 +    { $as_echo "$as_me:$LINENO: WARNING: libmodplug/modplug.h: in the future, the compiler will take precedence" >&5
   1.386 +$as_echo "$as_me: WARNING: libmodplug/modplug.h: in the future, the compiler will take precedence" >&2;}
   1.387 +
   1.388 +    ;;
   1.389 +esac
   1.390 +{ $as_echo "$as_me:$LINENO: checking for libmodplug/modplug.h" >&5
   1.391 +$as_echo_n "checking for libmodplug/modplug.h... " >&6; }
   1.392 +if test "${ac_cv_header_libmodplug_modplug_h+set}" = set; then
   1.393 +  $as_echo_n "(cached) " >&6
   1.394 +else
   1.395 +  ac_cv_header_libmodplug_modplug_h=$ac_header_preproc
   1.396 +fi
   1.397 +{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_libmodplug_modplug_h" >&5
   1.398 +$as_echo "$ac_cv_header_libmodplug_modplug_h" >&6; }
   1.399 +
   1.400 +fi
   1.401 +if test "x$ac_cv_header_libmodplug_modplug_h" = x""yes; then
   1.402 +  have_libmodplug_hdr=yes
   1.403 +fi
   1.404 +
   1.405 +
   1.406 +            { $as_echo "$as_me:$LINENO: checking for ModPlug_Load in -lmodplug" >&5
   1.407 +$as_echo_n "checking for ModPlug_Load in -lmodplug... " >&6; }
   1.408 +if test "${ac_cv_lib_modplug_ModPlug_Load+set}" = set; then
   1.409 +  $as_echo_n "(cached) " >&6
   1.410 +else
   1.411 +  ac_check_lib_save_LIBS=$LIBS
   1.412 +LIBS="-lmodplug  $LIBS"
   1.413 +cat >conftest.$ac_ext <<_ACEOF
   1.414 +/* confdefs.h.  */
   1.415 +_ACEOF
   1.416 +cat confdefs.h >>conftest.$ac_ext
   1.417 +cat >>conftest.$ac_ext <<_ACEOF
   1.418 +/* end confdefs.h.  */
   1.419 +
   1.420 +/* Override any GCC internal prototype to avoid an error.
   1.421 +   Use char because int might match the return type of a GCC
   1.422 +   builtin and then its argument prototype would still apply.  */
   1.423 +#ifdef __cplusplus
   1.424 +extern "C"
   1.425 +#endif
   1.426 +char ModPlug_Load ();
   1.427 +int
   1.428 +main ()
   1.429 +{
   1.430 +return ModPlug_Load ();
   1.431 +  ;
   1.432 +  return 0;
   1.433 +}
   1.434 +_ACEOF
   1.435 +rm -f conftest.$ac_objext conftest$ac_exeext
   1.436 +if { (ac_try="$ac_link"
   1.437 +case "(($ac_try" in
   1.438 +  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   1.439 +  *) ac_try_echo=$ac_try;;
   1.440 +esac
   1.441 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
   1.442 +$as_echo "$ac_try_echo") >&5
   1.443 +  (eval "$ac_link") 2>conftest.er1
   1.444 +  ac_status=$?
   1.445 +  grep -v '^ *+' conftest.er1 >conftest.err
   1.446 +  rm -f conftest.er1
   1.447 +  cat conftest.err >&5
   1.448 +  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   1.449 +  (exit $ac_status); } && {
   1.450 +	 test -z "$ac_c_werror_flag" ||
   1.451 +	 test ! -s conftest.err
   1.452 +       } && test -s conftest$ac_exeext && {
   1.453 +	 test "$cross_compiling" = yes ||
   1.454 +	 $as_test_x conftest$ac_exeext
   1.455 +       }; then
   1.456 +  ac_cv_lib_modplug_ModPlug_Load=yes
   1.457 +else
   1.458 +  $as_echo "$as_me: failed program was:" >&5
   1.459 +sed 's/^/| /' conftest.$ac_ext >&5
   1.460 +
   1.461 +	ac_cv_lib_modplug_ModPlug_Load=no
   1.462 +fi
   1.463 +
   1.464 +rm -rf conftest.dSYM
   1.465 +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
   1.466 +      conftest$ac_exeext conftest.$ac_ext
   1.467 +LIBS=$ac_check_lib_save_LIBS
   1.468 +fi
   1.469 +{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_modplug_ModPlug_Load" >&5
   1.470 +$as_echo "$ac_cv_lib_modplug_ModPlug_Load" >&6; }
   1.471 +if test "x$ac_cv_lib_modplug_ModPlug_Load" = x""yes; then
   1.472 +  have_libmodplug_lib=yes
   1.473 +fi
   1.474 +
   1.475 +
   1.476  else
   1.477  	MODPLUG_CFLAGS=$pkg_cv_MODPLUG_CFLAGS
   1.478  	MODPLUG_LIBS=$pkg_cv_MODPLUG_LIBS
   1.479          { $as_echo "$as_me:$LINENO: result: yes" >&5
   1.480  $as_echo "yes" >&6; }
   1.481 -	:
   1.482 -fi
   1.483 -	EXTRA_CFLAGS="$EXTRA_CFLAGS -DMODPLUG_MUSIC  $MODPLUG_CFLAGS"
   1.484 -	EXTRA_LDFLAGS="$EXTRA_LDFLAGS $MODPLUG_LIBS"
   1.485 -    have_libmodplug=yes
   1.486 -    SOURCES="$SOURCES $srcdir/music_modplug.c"
   1.487 -else
   1.488 -	have_libmodplug=no
   1.489 +	            have_libmodplug_hdr=yes
   1.490 +            have_libmodplug_lib=yes
   1.491 +
   1.492 +fi
   1.493 +
   1.494 +    if test x$have_libmodplug_hdr = xyes -a x$have_libmodplug_lib = xyes; then
   1.495 +        have_libmodplug=yes
   1.496 +        SOURCES="$SOURCES $srcdir/music_modplug.c"
   1.497 +        EXTRA_CFLAGS="$EXTRA_CFLAGS -DMODPLUG_MUSIC $MODPLUG_CFLAGS"
   1.498 +        EXTRA_LDFLAGS="$EXTRA_LDFLAGS $MODPLUG_LIBS"
   1.499 +    else
   1.500 +        { $as_echo "$as_me:$LINENO: WARNING: *** Unable to find ModPlug library (http://modplug-xmms.sourceforge.net/)" >&5
   1.501 +$as_echo "$as_me: WARNING: *** Unable to find ModPlug library (http://modplug-xmms.sourceforge.net/)" >&2;}
   1.502 +    fi
   1.503  fi
   1.504  
   1.505  if test x$have_libmikmod != xyes -a x$have_libmodplug != xyes ; then
     2.1 --- a/configure.in	Sat Oct 13 17:20:02 2018 +0300
     2.2 +++ b/configure.in	Sat Oct 13 22:20:22 2018 +0300
     2.3 @@ -110,7 +110,7 @@
     2.4          DEPENDENCY_TRACKING_OPTIONS="-MMD -MT \$@"
     2.5      fi
     2.6  fi
     2.7 -    
     2.8 +
     2.9  case "$host" in
    2.10      *mingw32ce*)
    2.11          #VERSION_SOURCES="$srcdir/version.rc"
    2.12 @@ -174,7 +174,6 @@
    2.13      fi
    2.14  }
    2.15  
    2.16 -
    2.17  dnl Function to find a library in the compiler search path
    2.18  find_lib()
    2.19  {
    2.20 @@ -253,7 +252,6 @@
    2.21      libmikmod_ver="$libmikmod_maj.$libmikmod_min.$libmikmod_rev"
    2.22      AC_PATH_PROG(LIBMIKMOD_CONFIG, libmikmod-config, no, [$PATH])
    2.23      if test "$LIBMIKMOD_CONFIG" != "no" ; then
    2.24 -        
    2.25          CFLAGS_SAVED="$CFLAGS"
    2.26          LIBS_SAVED="$LIBS"
    2.27          CFLAGS="$CFLAGS -DLIBMIKMOD_MUSIC `$LIBMIKMOD_CONFIG --cflags`"
    2.28 @@ -311,18 +309,22 @@
    2.29  AC_HELP_STRING([--enable-music-mod-modplug], [enable MOD music via modplug [[default=no]]]),
    2.30                [], [enable_music_mod_modplug=no])
    2.31  if test x$enable_music_mod_modplug = xyes; then
    2.32 -	PKG_CHECK_MODULES([MODPLUG], [libmodplug >= 0.8.7])
    2.33 -	EXTRA_CFLAGS="$EXTRA_CFLAGS -DMODPLUG_MUSIC  $MODPLUG_CFLAGS"
    2.34 -	EXTRA_LDFLAGS="$EXTRA_LDFLAGS $MODPLUG_LIBS"
    2.35 -dnl	AC_TRY_COMPILE([
    2.36 -dnl     #include "modplug.h"
    2.37 -dnl    ],[
    2.38 -dnl    ],[
    2.39 -    have_libmodplug=yes
    2.40 -    SOURCES="$SOURCES $srcdir/music_modplug.c"
    2.41 -dnl    ])
    2.42 -else
    2.43 -	have_libmodplug=no
    2.44 +    PKG_CHECK_MODULES([MODPLUG], [libmodplug >= 0.8.7], [dnl
    2.45 +            have_libmodplug_hdr=yes
    2.46 +            have_libmodplug_lib=yes
    2.47 +        ], [dnl
    2.48 +            AC_CHECK_HEADER([libmodplug/modplug.h], [have_libmodplug_hdr=yes])
    2.49 +            AC_CHECK_LIB([modplug], [ModPlug_Load], [have_libmodplug_lib=yes])
    2.50 +        ])
    2.51 +
    2.52 +    if test x$have_libmodplug_hdr = xyes -a x$have_libmodplug_lib = xyes; then
    2.53 +        have_libmodplug=yes
    2.54 +        SOURCES="$SOURCES $srcdir/music_modplug.c"
    2.55 +        EXTRA_CFLAGS="$EXTRA_CFLAGS -DMODPLUG_MUSIC $MODPLUG_CFLAGS"
    2.56 +        EXTRA_LDFLAGS="$EXTRA_LDFLAGS $MODPLUG_LIBS"
    2.57 +    else
    2.58 +        AC_MSG_WARN([*** Unable to find ModPlug library (http://modplug-xmms.sourceforge.net/)])
    2.59 +    fi
    2.60  fi
    2.61  
    2.62  if test x$have_libmikmod != xyes -a x$have_libmodplug != xyes ; then
     3.1 --- a/music_modplug.h	Sat Oct 13 17:20:02 2018 +0300
     3.2 +++ b/music_modplug.h	Sat Oct 13 22:20:22 2018 +0300
     3.3 @@ -1,6 +1,10 @@
     3.4  #ifdef MODPLUG_MUSIC
     3.5  
     3.6 -#include "modplug.h"
     3.7 +#ifdef MODPLUG_HEADER
     3.8 +#include MODPLUG_HEADER
     3.9 +#else
    3.10 +#include <libmodplug/modplug.h>
    3.11 +#endif
    3.12  #include "SDL_rwops.h"
    3.13  #include "SDL_audio.h"
    3.14  #include "SDL_mixer.h"