configury update: SDL-1.2
authorOzkan Sezer <sezeroz@gmail.com>
Sun, 14 Oct 2018 14:03:56 +0300
branchSDL-1.2
changeset 909d37b598f128d
parent 908 6b860486ce24
child 911 c9f7b6aba112
configury update:
- if we use PKG_CONFIG to detect a foo lib and it fails and then if we
manually check the lib and succeed, FOO_LIBS would remain undefined:
manually set it in that case. this was the case for libmodplug where
final linkage used to fail.
- use the OTHER_LIBS argument of AC_CHECK_LIB in vorbis detection, and
restore LIBS too.
- always restore CFLAGS and LIBS in libmikmod detection.
- remove the mysterious LIBMIKMOD_MUSIC define from libmikmod detection.
configure
configure.in
     1.1 --- a/configure	Sat Oct 13 23:02:04 2018 +0300
     1.2 +++ b/configure	Sun Oct 14 14:03:56 2018 +0300
     1.3 @@ -12743,6 +12743,8 @@
     1.4      libmikmod_min=1
     1.5      libmikmod_rev=10
     1.6      libmikmod_ver="$libmikmod_maj.$libmikmod_min.$libmikmod_rev"
     1.7 +    CFLAGS_SAVED="$CFLAGS"
     1.8 +    LIBS_SAVED="$LIBS"
     1.9      # Extract the first word of "libmikmod-config", so it can be a program name with args.
    1.10  set dummy libmikmod-config; ac_word=$2
    1.11  { $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
    1.12 @@ -12785,9 +12787,7 @@
    1.13  
    1.14  
    1.15      if test "$LIBMIKMOD_CONFIG" != "no" ; then
    1.16 -        CFLAGS_SAVED="$CFLAGS"
    1.17 -        LIBS_SAVED="$LIBS"
    1.18 -        CFLAGS="$CFLAGS -DLIBMIKMOD_MUSIC `$LIBMIKMOD_CONFIG --cflags`"
    1.19 +        CFLAGS="$CFLAGS `$LIBMIKMOD_CONFIG --cflags`"
    1.20          LIBS="$LIBS `$LIBMIKMOD_CONFIG --libs`"
    1.21          have_libmikmod=yes
    1.22          { $as_echo "$as_me:$LINENO: checking for libmikmod - version >= $libmikmod_ver" >&5
    1.23 @@ -12847,7 +12847,7 @@
    1.24  sed 's/^/| /' conftest.$ac_ext >&5
    1.25  
    1.26  ( exit $ac_status )
    1.27 -have_libmikmod=no; CFLAGS="$CFLAGS_SAVED"; LIBS="$LIBS_SAVED"
    1.28 +have_libmikmod=no
    1.29  fi
    1.30  rm -rf conftest.dSYM
    1.31  rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
    1.32 @@ -12883,6 +12883,8 @@
    1.33          { $as_echo "$as_me:$LINENO: WARNING: *** Unable to find MikMod library (http://mikmod.raphnet.net/)" >&5
    1.34  $as_echo "$as_me: WARNING: *** Unable to find MikMod library (http://mikmod.raphnet.net/)" >&2;}
    1.35      fi
    1.36 +    LIBS="$LIBS_SAVED"
    1.37 +    CFLAGS="$CFLAGS_SAVED"
    1.38  fi
    1.39  
    1.40  # Check whether --enable-music-mod-modplug was given.
    1.41 @@ -13152,7 +13154,7 @@
    1.42  { $as_echo "$as_me:$LINENO: result: $ac_cv_lib_modplug_ModPlug_Load" >&5
    1.43  $as_echo "$ac_cv_lib_modplug_ModPlug_Load" >&6; }
    1.44  if test "x$ac_cv_lib_modplug_ModPlug_Load" = x""yes; then
    1.45 -  have_libmodplug_lib=yes
    1.46 +  have_libmodplug_lib=yes;MODPLUG_LIBS="-lmodplug"
    1.47  fi
    1.48  
    1.49  
    1.50 @@ -13355,7 +13357,7 @@
    1.51  { $as_echo "$as_me:$LINENO: result: $ac_cv_lib_modplug_ModPlug_Load" >&5
    1.52  $as_echo "$ac_cv_lib_modplug_ModPlug_Load" >&6; }
    1.53  if test "x$ac_cv_lib_modplug_ModPlug_Load" = x""yes; then
    1.54 -  have_libmodplug_lib=yes
    1.55 +  have_libmodplug_lib=yes;MODPLUG_LIBS="-lmodplug"
    1.56  fi
    1.57  
    1.58  
    1.59 @@ -13710,6 +13712,7 @@
    1.60  fi
    1.61  
    1.62  if test x$enable_music_ogg = xyes; then
    1.63 +    LIBS_SAVED="$LIBS"
    1.64      if test x$enable_music_ogg_tremor = xyes; then
    1.65          if test "${ac_cv_header_tremor_ivorbisfile_h+set}" = set; then
    1.66    { $as_echo "$as_me:$LINENO: checking for tremor/ivorbisfile.h" >&5
    1.67 @@ -13843,13 +13846,13 @@
    1.68  fi
    1.69  
    1.70  
    1.71 -        { $as_echo "$as_me:$LINENO: checking for ov_open_callbacks in -lvorbisidec -logg" >&5
    1.72 -$as_echo_n "checking for ov_open_callbacks in -lvorbisidec -logg... " >&6; }
    1.73 -if test "${ac_cv_lib_vorbisidec__logg_ov_open_callbacks+set}" = set; then
    1.74 +        { $as_echo "$as_me:$LINENO: checking for ov_open_callbacks in -lvorbisidec" >&5
    1.75 +$as_echo_n "checking for ov_open_callbacks in -lvorbisidec... " >&6; }
    1.76 +if test "${ac_cv_lib_vorbisidec_ov_open_callbacks+set}" = set; then
    1.77    $as_echo_n "(cached) " >&6
    1.78  else
    1.79    ac_check_lib_save_LIBS=$LIBS
    1.80 -LIBS="-lvorbisidec -logg  $LIBS"
    1.81 +LIBS="-lvorbisidec -logg $LIBS"
    1.82  cat >conftest.$ac_ext <<_ACEOF
    1.83  /* confdefs.h.  */
    1.84  _ACEOF
    1.85 @@ -13893,12 +13896,12 @@
    1.86  	 test "$cross_compiling" = yes ||
    1.87  	 $as_test_x conftest$ac_exeext
    1.88         }; then
    1.89 -  ac_cv_lib_vorbisidec__logg_ov_open_callbacks=yes
    1.90 -else
    1.91 -  $as_echo "$as_me: failed program was:" >&5
    1.92 -sed 's/^/| /' conftest.$ac_ext >&5
    1.93 -
    1.94 -	ac_cv_lib_vorbisidec__logg_ov_open_callbacks=no
    1.95 +  ac_cv_lib_vorbisidec_ov_open_callbacks=yes
    1.96 +else
    1.97 +  $as_echo "$as_me: failed program was:" >&5
    1.98 +sed 's/^/| /' conftest.$ac_ext >&5
    1.99 +
   1.100 +	ac_cv_lib_vorbisidec_ov_open_callbacks=no
   1.101  fi
   1.102  
   1.103  rm -rf conftest.dSYM
   1.104 @@ -13906,9 +13909,9 @@
   1.105        conftest$ac_exeext conftest.$ac_ext
   1.106  LIBS=$ac_check_lib_save_LIBS
   1.107  fi
   1.108 -{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_vorbisidec__logg_ov_open_callbacks" >&5
   1.109 -$as_echo "$ac_cv_lib_vorbisidec__logg_ov_open_callbacks" >&6; }
   1.110 -if test "x$ac_cv_lib_vorbisidec__logg_ov_open_callbacks" = x""yes; then
   1.111 +{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_vorbisidec_ov_open_callbacks" >&5
   1.112 +$as_echo "$ac_cv_lib_vorbisidec_ov_open_callbacks" >&6; }
   1.113 +if test "x$ac_cv_lib_vorbisidec_ov_open_callbacks" = x""yes; then
   1.114    have_tremor_lib=yes
   1.115  fi
   1.116  
   1.117 @@ -14074,13 +14077,13 @@
   1.118  fi
   1.119  
   1.120  
   1.121 -        { $as_echo "$as_me:$LINENO: checking for ov_open_callbacks in -lvorbisfile -lvorbis -logg -lm" >&5
   1.122 -$as_echo_n "checking for ov_open_callbacks in -lvorbisfile -lvorbis -logg -lm... " >&6; }
   1.123 -if test "${ac_cv_lib_vorbisfile__lvorbis__logg__lm_ov_open_callbacks+set}" = set; then
   1.124 +        { $as_echo "$as_me:$LINENO: checking for ov_open_callbacks in -lvorbisfile" >&5
   1.125 +$as_echo_n "checking for ov_open_callbacks in -lvorbisfile... " >&6; }
   1.126 +if test "${ac_cv_lib_vorbisfile_ov_open_callbacks+set}" = set; then
   1.127    $as_echo_n "(cached) " >&6
   1.128  else
   1.129    ac_check_lib_save_LIBS=$LIBS
   1.130 -LIBS="-lvorbisfile -lvorbis -logg -lm  $LIBS"
   1.131 +LIBS="-lvorbisfile -lvorbis -logg -lm $LIBS"
   1.132  cat >conftest.$ac_ext <<_ACEOF
   1.133  /* confdefs.h.  */
   1.134  _ACEOF
   1.135 @@ -14124,12 +14127,12 @@
   1.136  	 test "$cross_compiling" = yes ||
   1.137  	 $as_test_x conftest$ac_exeext
   1.138         }; then
   1.139 -  ac_cv_lib_vorbisfile__lvorbis__logg__lm_ov_open_callbacks=yes
   1.140 -else
   1.141 -  $as_echo "$as_me: failed program was:" >&5
   1.142 -sed 's/^/| /' conftest.$ac_ext >&5
   1.143 -
   1.144 -	ac_cv_lib_vorbisfile__lvorbis__logg__lm_ov_open_callbacks=no
   1.145 +  ac_cv_lib_vorbisfile_ov_open_callbacks=yes
   1.146 +else
   1.147 +  $as_echo "$as_me: failed program was:" >&5
   1.148 +sed 's/^/| /' conftest.$ac_ext >&5
   1.149 +
   1.150 +	ac_cv_lib_vorbisfile_ov_open_callbacks=no
   1.151  fi
   1.152  
   1.153  rm -rf conftest.dSYM
   1.154 @@ -14137,9 +14140,9 @@
   1.155        conftest$ac_exeext conftest.$ac_ext
   1.156  LIBS=$ac_check_lib_save_LIBS
   1.157  fi
   1.158 -{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_vorbisfile__lvorbis__logg__lm_ov_open_callbacks" >&5
   1.159 -$as_echo "$ac_cv_lib_vorbisfile__lvorbis__logg__lm_ov_open_callbacks" >&6; }
   1.160 -if test "x$ac_cv_lib_vorbisfile__lvorbis__logg__lm_ov_open_callbacks" = x""yes; then
   1.161 +{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_vorbisfile_ov_open_callbacks" >&5
   1.162 +$as_echo "$ac_cv_lib_vorbisfile_ov_open_callbacks" >&6; }
   1.163 +if test "x$ac_cv_lib_vorbisfile_ov_open_callbacks" = x""yes; then
   1.164    have_ogg_lib=yes
   1.165  fi
   1.166  
   1.167 @@ -14173,6 +14176,7 @@
   1.168  $as_echo "$as_me: WARNING: Ogg Vorbis support disabled" >&2;}
   1.169          fi
   1.170      fi
   1.171 +    LIBS="$LIBS_SAVED"
   1.172  fi
   1.173  
   1.174  libflac_ver=8
     2.1 --- a/configure.in	Sat Oct 13 23:02:04 2018 +0300
     2.2 +++ b/configure.in	Sun Oct 14 14:03:56 2018 +0300
     2.3 @@ -250,11 +250,11 @@
     2.4      libmikmod_min=1
     2.5      libmikmod_rev=10
     2.6      libmikmod_ver="$libmikmod_maj.$libmikmod_min.$libmikmod_rev"
     2.7 +    CFLAGS_SAVED="$CFLAGS"
     2.8 +    LIBS_SAVED="$LIBS"
     2.9      AC_PATH_PROG(LIBMIKMOD_CONFIG, libmikmod-config, no, [$PATH])
    2.10      if test "$LIBMIKMOD_CONFIG" != "no" ; then
    2.11 -        CFLAGS_SAVED="$CFLAGS"
    2.12 -        LIBS_SAVED="$LIBS"
    2.13 -        CFLAGS="$CFLAGS -DLIBMIKMOD_MUSIC `$LIBMIKMOD_CONFIG --cflags`"
    2.14 +        CFLAGS="$CFLAGS `$LIBMIKMOD_CONFIG --cflags`"
    2.15          LIBS="$LIBS `$LIBMIKMOD_CONFIG --libs`"
    2.16          have_libmikmod=yes
    2.17          AC_MSG_CHECKING([for libmikmod - version >= $libmikmod_ver])
    2.18 @@ -273,8 +273,7 @@
    2.19  printf("no\n*** libmikmod is older than %d.%d.%d, not using.\n",maj,min,rev);
    2.20  return 1;
    2.21  }
    2.22 -], [], have_libmikmod=no; CFLAGS="$CFLAGS_SAVED"; LIBS="$LIBS_SAVED",
    2.23 -        [echo $ac_n "cross compiling; assumed OK... $ac_c"])
    2.24 +], [], [have_libmikmod=no], [echo $ac_n "cross compiling; assumed OK... $ac_c"])
    2.25      fi
    2.26  
    2.27      if test x$have_libmikmod = xyes; then
    2.28 @@ -303,6 +302,8 @@
    2.29      else
    2.30          AC_MSG_WARN([*** Unable to find MikMod library (http://mikmod.raphnet.net/)])
    2.31      fi
    2.32 +    LIBS="$LIBS_SAVED"
    2.33 +    CFLAGS="$CFLAGS_SAVED"
    2.34  fi
    2.35  
    2.36  AC_ARG_ENABLE([music-mod-modplug],
    2.37 @@ -314,7 +315,7 @@
    2.38              have_libmodplug_lib=yes
    2.39          ], [dnl
    2.40              AC_CHECK_HEADER([libmodplug/modplug.h], [have_libmodplug_hdr=yes])
    2.41 -            AC_CHECK_LIB([modplug], [ModPlug_Load], [have_libmodplug_lib=yes])
    2.42 +            AC_CHECK_LIB([modplug], [ModPlug_Load], [have_libmodplug_lib=yes;MODPLUG_LIBS="-lmodplug"])
    2.43          ])
    2.44  
    2.45      if test x$have_libmodplug_hdr = xyes -a x$have_libmodplug_lib = xyes; then
    2.46 @@ -423,9 +424,10 @@
    2.47  AC_HELP_STRING([--enable-music-ogg-shared], [dynamically load Ogg Vorbis support [[default=yes]]]),
    2.48                [], [enable_music_ogg_shared=yes])
    2.49  if test x$enable_music_ogg = xyes; then
    2.50 +    LIBS_SAVED="$LIBS"
    2.51      if test x$enable_music_ogg_tremor = xyes; then
    2.52          AC_CHECK_HEADER([tremor/ivorbisfile.h], [have_tremor_hdr=yes])
    2.53 -        AC_CHECK_LIB([vorbisidec -logg], [ov_open_callbacks], [have_tremor_lib=yes])
    2.54 +        AC_CHECK_LIB([vorbisidec], [ov_open_callbacks], [have_tremor_lib=yes], [], [-logg])
    2.55          if test x$have_tremor_hdr = xyes -a x$have_tremor_lib = xyes; then
    2.56              case "$host" in
    2.57                  *-*-darwin*)
    2.58 @@ -455,7 +457,7 @@
    2.59          fi
    2.60      else
    2.61          AC_CHECK_HEADER([vorbis/vorbisfile.h], [have_ogg_hdr=yes])
    2.62 -        AC_CHECK_LIB([vorbisfile -lvorbis -logg -lm], [ov_open_callbacks], [have_ogg_lib=yes])
    2.63 +        AC_CHECK_LIB([vorbisfile], [ov_open_callbacks], [have_ogg_lib=yes], [], [-lvorbis -logg -lm])
    2.64          if test x$have_ogg_hdr = xyes -a x$have_ogg_lib = xyes; then
    2.65              case "$host" in
    2.66                  *-*-darwin*)
    2.67 @@ -484,6 +486,7 @@
    2.68              AC_MSG_WARN([Ogg Vorbis support disabled])
    2.69          fi
    2.70      fi
    2.71 +    LIBS="$LIBS_SAVED"
    2.72  fi
    2.73  
    2.74  libflac_ver=8