sdl2.m4
changeset 7492 98de3e4f1c36
parent 7251 8c5e575a1315
equal deleted inserted replaced
7490:fc864efbc1a6 7492:98de3e4f1c36
    29            [sdl_pc=no])
    29            [sdl_pc=no])
    30   else
    30   else
    31     sdl_pc=no
    31     sdl_pc=no
    32     if test x$sdl_exec_prefix != x ; then
    32     if test x$sdl_exec_prefix != x ; then
    33       sdl_config_args="$sdl_config_args --exec-prefix=$sdl_exec_prefix"
    33       sdl_config_args="$sdl_config_args --exec-prefix=$sdl_exec_prefix"
    34       if test x${SDL_CONFIG+set} != xset ; then
    34       if test x${SDL2_CONFIG+set} != xset ; then
    35         SDL_CONFIG=$sdl_exec_prefix/bin/sdl2-config
    35         SDL2_CONFIG=$sdl_exec_prefix/bin/sdl2-config
    36       fi
    36       fi
    37     fi
    37     fi
    38     if test x$sdl_prefix != x ; then
    38     if test x$sdl_prefix != x ; then
    39       sdl_config_args="$sdl_config_args --prefix=$sdl_prefix"
    39       sdl_config_args="$sdl_config_args --prefix=$sdl_prefix"
    40       if test x${SDL_CONFIG+set} != xset ; then
    40       if test x${SDL2_CONFIG+set} != xset ; then
    41         SDL_CONFIG=$sdl_prefix/bin/sdl2-config
    41         SDL2_CONFIG=$sdl_prefix/bin/sdl2-config
    42       fi
    42       fi
    43     fi
    43     fi
    44   fi
    44   fi
    45 
    45 
    46   if test "x$sdl_pc" = xyes ; then
    46   if test "x$sdl_pc" = xyes ; then
    47     no_sdl=""
    47     no_sdl=""
    48     SDL_CONFIG="pkg-config sdl2"
    48     SDL2_CONFIG="pkg-config sdl2"
    49   else
    49   else
    50     as_save_PATH="$PATH"
    50     as_save_PATH="$PATH"
    51     if test "x$prefix" != xNONE && test "$cross_compiling" != yes; then
    51     if test "x$prefix" != xNONE && test "$cross_compiling" != yes; then
    52       PATH="$prefix/bin:$prefix/usr/bin:$PATH"
    52       PATH="$prefix/bin:$prefix/usr/bin:$PATH"
    53     fi
    53     fi
    54     AC_PATH_PROG(SDL_CONFIG, sdl2-config, no, [$PATH])
    54     AC_PATH_PROG(SDL2_CONFIG, sdl2-config, no, [$PATH])
    55     PATH="$as_save_PATH"
    55     PATH="$as_save_PATH"
    56     AC_MSG_CHECKING(for SDL - version >= $min_sdl_version)
    56     AC_MSG_CHECKING(for SDL - version >= $min_sdl_version)
    57     no_sdl=""
    57     no_sdl=""
    58 
    58 
    59     if test "$SDL_CONFIG" = "no" ; then
    59     if test "$SDL2_CONFIG" = "no" ; then
    60       no_sdl=yes
    60       no_sdl=yes
    61     else
    61     else
    62       SDL_CFLAGS=`$SDL_CONFIG $sdl_config_args --cflags`
    62       SDL_CFLAGS=`$SDL2_CONFIG $sdl_config_args --cflags`
    63       SDL_LIBS=`$SDL_CONFIG $sdl_config_args --libs`
    63       SDL_LIBS=`$SDL2_CONFIG $sdl_config_args --libs`
    64 
    64 
    65       sdl_major_version=`$SDL_CONFIG $sdl_config_args --version | \
    65       sdl_major_version=`$SDL2_CONFIG $sdl_config_args --version | \
    66              sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
    66              sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
    67       sdl_minor_version=`$SDL_CONFIG $sdl_config_args --version | \
    67       sdl_minor_version=`$SDL2_CONFIG $sdl_config_args --version | \
    68              sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
    68              sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
    69       sdl_micro_version=`$SDL_CONFIG $sdl_config_args --version | \
    69       sdl_micro_version=`$SDL2_CONFIG $sdl_config_args --version | \
    70              sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
    70              sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
    71       if test "x$enable_sdltest" = "xyes" ; then
    71       if test "x$enable_sdltest" = "xyes" ; then
    72         ac_save_CFLAGS="$CFLAGS"
    72         ac_save_CFLAGS="$CFLAGS"
    73         ac_save_CXXFLAGS="$CXXFLAGS"
    73         ac_save_CXXFLAGS="$CXXFLAGS"
    74         ac_save_LIBS="$LIBS"
    74         ac_save_LIBS="$LIBS"
   128   else
   128   else
   129     {
   129     {
   130       printf("\n*** 'sdl2-config --version' returned %d.%d.%d, but the minimum version\n", $sdl_major_version, $sdl_minor_version, $sdl_micro_version);
   130       printf("\n*** 'sdl2-config --version' returned %d.%d.%d, but the minimum version\n", $sdl_major_version, $sdl_minor_version, $sdl_micro_version);
   131       printf("*** of SDL required is %d.%d.%d. If sdl2-config is correct, then it is\n", major, minor, micro);
   131       printf("*** of SDL required is %d.%d.%d. If sdl2-config is correct, then it is\n", major, minor, micro);
   132       printf("*** best to upgrade to the required version.\n");
   132       printf("*** best to upgrade to the required version.\n");
   133       printf("*** If sdl2-config was wrong, set the environment variable SDL_CONFIG\n");
   133       printf("*** If sdl2-config was wrong, set the environment variable SDL2_CONFIG\n");
   134       printf("*** to point to the correct copy of sdl2-config, and remove the file\n");
   134       printf("*** to point to the correct copy of sdl2-config, and remove the file\n");
   135       printf("*** config.cache before re-running configure\n");
   135       printf("*** config.cache before re-running configure\n");
   136       return 1;
   136       return 1;
   137     }
   137     }
   138 }
   138 }
   150     fi
   150     fi
   151   fi
   151   fi
   152   if test "x$no_sdl" = x ; then
   152   if test "x$no_sdl" = x ; then
   153      ifelse([$2], , :, [$2])
   153      ifelse([$2], , :, [$2])
   154   else
   154   else
   155      if test "$SDL_CONFIG" = "no" ; then
   155      if test "$SDL2_CONFIG" = "no" ; then
   156        echo "*** The sdl2-config script installed by SDL could not be found"
   156        echo "*** The sdl2-config script installed by SDL could not be found"
   157        echo "*** If SDL was installed in PREFIX, make sure PREFIX/bin is in"
   157        echo "*** If SDL was installed in PREFIX, make sure PREFIX/bin is in"
   158        echo "*** your path, or set the SDL_CONFIG environment variable to the"
   158        echo "*** your path, or set the SDL2_CONFIG environment variable to the"
   159        echo "*** full path to sdl2-config."
   159        echo "*** full path to sdl2-config."
   160      else
   160      else
   161        if test -f conf.sdltest ; then
   161        if test -f conf.sdltest ; then
   162         :
   162         :
   163        else
   163        else
   184           echo "*** If you have an old version installed, it is best to remove it, although"
   184           echo "*** If you have an old version installed, it is best to remove it, although"
   185           echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH"],
   185           echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH"],
   186         [ echo "*** The test program failed to compile or link. See the file config.log for the"
   186         [ echo "*** The test program failed to compile or link. See the file config.log for the"
   187           echo "*** exact error that occured. This usually means SDL was incorrectly installed"
   187           echo "*** exact error that occured. This usually means SDL was incorrectly installed"
   188           echo "*** or that you have moved SDL since it was installed. In the latter case, you"
   188           echo "*** or that you have moved SDL since it was installed. In the latter case, you"
   189           echo "*** may want to edit the sdl2-config script: $SDL_CONFIG" ])
   189           echo "*** may want to edit the sdl2-config script: $SDL2_CONFIG" ])
   190           CFLAGS="$ac_save_CFLAGS"
   190           CFLAGS="$ac_save_CFLAGS"
   191           CXXFLAGS="$ac_save_CXXFLAGS"
   191           CXXFLAGS="$ac_save_CXXFLAGS"
   192           LIBS="$ac_save_LIBS"
   192           LIBS="$ac_save_LIBS"
   193        fi
   193        fi
   194      fi
   194      fi