remove test/aclocal.m4
authorOzkan Sezer <sezeroz@gmail.com>
Sat, 03 Aug 2019 12:49:50 +0300
changeset 12990b7e03b88e36b
parent 12984 774ceeac9335
child 12991 6179a871076a
remove test/aclocal.m4
.hgignore
test/aclocal.m4
     1.1 --- a/.hgignore	Fri Aug 02 18:14:31 2019 -0700
     1.2 +++ b/.hgignore	Sat Aug 03 12:49:50 2019 +0300
     1.3 @@ -59,6 +59,8 @@
     1.4  android-project/local.properties
     1.5  
     1.6  sdl.pc
     1.7 +
     1.8 +test/aclocal.m4
     1.9  test/autom4te*
    1.10  test/config.cache
    1.11  test/config.log
     2.1 --- a/test/aclocal.m4	Fri Aug 02 18:14:31 2019 -0700
     2.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     2.3 @@ -1,359 +0,0 @@
     2.4 -# Configure paths for SDL
     2.5 -# Sam Lantinga 9/21/99
     2.6 -# stolen from Manish Singh
     2.7 -# stolen back from Frank Belew
     2.8 -# stolen from Manish Singh
     2.9 -# Shamelessly stolen from Owen Taylor
    2.10 -
    2.11 -# serial 1
    2.12 -
    2.13 -dnl AM_PATH_SDL([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]])
    2.14 -dnl Test for SDL, and define SDL_CFLAGS and SDL_LIBS
    2.15 -dnl
    2.16 -AC_DEFUN([AM_PATH_SDL2],
    2.17 -[dnl 
    2.18 -dnl Get the cflags and libraries from the sdl2-config script
    2.19 -dnl
    2.20 -AC_ARG_WITH(sdl-prefix,[  --with-sdl-prefix=PFX   Prefix where SDL is installed (optional)],
    2.21 -            sdl_prefix="$withval", sdl_prefix="")
    2.22 -AC_ARG_WITH(sdl-exec-prefix,[  --with-sdl-exec-prefix=PFX Exec prefix where SDL is installed (optional)],
    2.23 -            sdl_exec_prefix="$withval", sdl_exec_prefix="")
    2.24 -AC_ARG_ENABLE(sdltest, [  --disable-sdltest       Do not try to compile and run a test SDL program],
    2.25 -		    , enable_sdltest=yes)
    2.26 -
    2.27 -  min_sdl_version=ifelse([$1], ,0.9.0,$1)
    2.28 -
    2.29 -  if test "x$sdl_prefix$sdl_exec_prefix" = x ; then
    2.30 -    PKG_CHECK_MODULES([SDL], [sdl2 >= $min_sdl_version],
    2.31 -           [sdl_pc=yes],
    2.32 -           [sdl_pc=no])
    2.33 -  else
    2.34 -    sdl_pc=no
    2.35 -    if test x$sdl_exec_prefix != x ; then
    2.36 -      sdl_config_args="$sdl_config_args --exec-prefix=$sdl_exec_prefix"
    2.37 -      if test x${SDL_CONFIG+set} != xset ; then
    2.38 -        SDL_CONFIG=$sdl_exec_prefix/bin/sdl2-config
    2.39 -      fi
    2.40 -    fi
    2.41 -    if test x$sdl_prefix != x ; then
    2.42 -      sdl_config_args="$sdl_config_args --prefix=$sdl_prefix"
    2.43 -      if test x${SDL_CONFIG+set} != xset ; then
    2.44 -        SDL_CONFIG=$sdl_prefix/bin/sdl2-config
    2.45 -      fi
    2.46 -    fi
    2.47 -  fi
    2.48 -
    2.49 -  if test "x$sdl_pc" = xyes ; then
    2.50 -    no_sdl=""
    2.51 -    SDL_CONFIG="pkg-config sdl2"
    2.52 -  else
    2.53 -    as_save_PATH="$PATH"
    2.54 -    if test "x$prefix" != xNONE && test "$cross_compiling" != yes; then
    2.55 -      PATH="$prefix/bin:$prefix/usr/bin:$PATH"
    2.56 -    fi
    2.57 -    AC_PATH_PROG(SDL_CONFIG, sdl2-config, no, [$PATH])
    2.58 -    PATH="$as_save_PATH"
    2.59 -    AC_MSG_CHECKING(for SDL - version >= $min_sdl_version)
    2.60 -    no_sdl=""
    2.61 -
    2.62 -    if test "$SDL_CONFIG" = "no" ; then
    2.63 -      no_sdl=yes
    2.64 -    else
    2.65 -      SDL_CFLAGS=`$SDL_CONFIG $sdl_config_args --cflags`
    2.66 -      SDL_LIBS=`$SDL_CONFIG $sdl_config_args --libs`
    2.67 -
    2.68 -      sdl_major_version=`$SDL_CONFIG $sdl_config_args --version | \
    2.69 -             sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
    2.70 -      sdl_minor_version=`$SDL_CONFIG $sdl_config_args --version | \
    2.71 -             sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
    2.72 -      sdl_micro_version=`$SDL_CONFIG $sdl_config_args --version | \
    2.73 -             sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
    2.74 -      if test "x$enable_sdltest" = "xyes" ; then
    2.75 -        ac_save_CFLAGS="$CFLAGS"
    2.76 -        ac_save_CXXFLAGS="$CXXFLAGS"
    2.77 -        ac_save_LIBS="$LIBS"
    2.78 -        CFLAGS="$CFLAGS $SDL_CFLAGS"
    2.79 -        CXXFLAGS="$CXXFLAGS $SDL_CFLAGS"
    2.80 -        LIBS="$LIBS $SDL_LIBS"
    2.81 -dnl
    2.82 -dnl Now check if the installed SDL is sufficiently new. (Also sanity
    2.83 -dnl checks the results of sdl2-config to some extent
    2.84 -dnl
    2.85 -      rm -f conf.sdltest
    2.86 -      AC_TRY_RUN([
    2.87 -#include <stdio.h>
    2.88 -#include <stdlib.h>
    2.89 -#include <string.h>
    2.90 -#include "SDL.h"
    2.91 -
    2.92 -char*
    2.93 -my_strdup (char *str)
    2.94 -{
    2.95 -  char *new_str;
    2.96 -  
    2.97 -  if (str)
    2.98 -    {
    2.99 -      new_str = (char *)malloc ((strlen (str) + 1) * sizeof(char));
   2.100 -      strcpy (new_str, str);
   2.101 -    }
   2.102 -  else
   2.103 -    new_str = NULL;
   2.104 -  
   2.105 -  return new_str;
   2.106 -}
   2.107 -
   2.108 -int main (int argc, char *argv[])
   2.109 -{
   2.110 -  int major, minor, micro;
   2.111 -  char *tmp_version;
   2.112 -
   2.113 -  /* This hangs on some systems (?)
   2.114 -  system ("touch conf.sdltest");
   2.115 -  */
   2.116 -  { FILE *fp = fopen("conf.sdltest", "a"); if ( fp ) fclose(fp); }
   2.117 -
   2.118 -  /* HP/UX 9 (%@#!) writes to sscanf strings */
   2.119 -  tmp_version = my_strdup("$min_sdl_version");
   2.120 -  if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, &micro) != 3) {
   2.121 -     printf("%s, bad version string\n", "$min_sdl_version");
   2.122 -     exit(1);
   2.123 -   }
   2.124 -
   2.125 -   if (($sdl_major_version > major) ||
   2.126 -      (($sdl_major_version == major) && ($sdl_minor_version > minor)) ||
   2.127 -      (($sdl_major_version == major) && ($sdl_minor_version == minor) && ($sdl_micro_version >= micro)))
   2.128 -    {
   2.129 -      return 0;
   2.130 -    }
   2.131 -  else
   2.132 -    {
   2.133 -      printf("\n*** 'sdl2-config --version' returned %d.%d.%d, but the minimum version\n", $sdl_major_version, $sdl_minor_version, $sdl_micro_version);
   2.134 -      printf("*** of SDL required is %d.%d.%d. If sdl2-config is correct, then it is\n", major, minor, micro);
   2.135 -      printf("*** best to upgrade to the required version.\n");
   2.136 -      printf("*** If sdl2-config was wrong, set the environment variable SDL_CONFIG\n");
   2.137 -      printf("*** to point to the correct copy of sdl2-config, and remove the file\n");
   2.138 -      printf("*** config.cache before re-running configure\n");
   2.139 -      return 1;
   2.140 -    }
   2.141 -}
   2.142 -
   2.143 -],, no_sdl=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
   2.144 -        CFLAGS="$ac_save_CFLAGS"
   2.145 -        CXXFLAGS="$ac_save_CXXFLAGS"
   2.146 -        LIBS="$ac_save_LIBS"
   2.147 -      fi
   2.148 -    fi
   2.149 -    if test "x$no_sdl" = x ; then
   2.150 -      AC_MSG_RESULT(yes)
   2.151 -    else
   2.152 -      AC_MSG_RESULT(no)
   2.153 -    fi
   2.154 -  fi
   2.155 -  if test "x$no_sdl" = x ; then
   2.156 -     ifelse([$2], , :, [$2])
   2.157 -  else
   2.158 -     if test "$SDL_CONFIG" = "no" ; then
   2.159 -       echo "*** The sdl2-config script installed by SDL could not be found"
   2.160 -       echo "*** If SDL was installed in PREFIX, make sure PREFIX/bin is in"
   2.161 -       echo "*** your path, or set the SDL_CONFIG environment variable to the"
   2.162 -       echo "*** full path to sdl2-config."
   2.163 -     else
   2.164 -       if test -f conf.sdltest ; then
   2.165 -        :
   2.166 -       else
   2.167 -          echo "*** Could not run SDL test program, checking why..."
   2.168 -          CFLAGS="$CFLAGS $SDL_CFLAGS"
   2.169 -          CXXFLAGS="$CXXFLAGS $SDL_CFLAGS"
   2.170 -          LIBS="$LIBS $SDL_LIBS"
   2.171 -          AC_TRY_LINK([
   2.172 -#include <stdio.h>
   2.173 -#include "SDL.h"
   2.174 -
   2.175 -int main(int argc, char *argv[])
   2.176 -{ return 0; }
   2.177 -#undef  main
   2.178 -#define main K_and_R_C_main
   2.179 -],      [ return 0; ],
   2.180 -        [ echo "*** The test program compiled, but did not run. This usually means"
   2.181 -          echo "*** that the run-time linker is not finding SDL or finding the wrong"
   2.182 -          echo "*** version of SDL. If it is not finding SDL, you'll need to set your"
   2.183 -          echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point"
   2.184 -          echo "*** to the installed location  Also, make sure you have run ldconfig if that"
   2.185 -          echo "*** is required on your system"
   2.186 -	  echo "***"
   2.187 -          echo "*** If you have an old version installed, it is best to remove it, although"
   2.188 -          echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH"],
   2.189 -        [ echo "*** The test program failed to compile or link. See the file config.log for the"
   2.190 -          echo "*** exact error that occured. This usually means SDL was incorrectly installed"
   2.191 -          echo "*** or that you have moved SDL since it was installed. In the latter case, you"
   2.192 -          echo "*** may want to edit the sdl2-config script: $SDL_CONFIG" ])
   2.193 -          CFLAGS="$ac_save_CFLAGS"
   2.194 -          CXXFLAGS="$ac_save_CXXFLAGS"
   2.195 -          LIBS="$ac_save_LIBS"
   2.196 -       fi
   2.197 -     fi
   2.198 -     SDL_CFLAGS=""
   2.199 -     SDL_LIBS=""
   2.200 -     ifelse([$3], , :, [$3])
   2.201 -  fi
   2.202 -  AC_SUBST(SDL_CFLAGS)
   2.203 -  AC_SUBST(SDL_LIBS)
   2.204 -  rm -f conf.sdltest
   2.205 -])
   2.206 -# pkg.m4 - Macros to locate and utilise pkg-config.            -*- Autoconf -*-
   2.207 -# serial 1 (pkg-config-0.24)
   2.208 -# 
   2.209 -# Copyright © 2004 Scott James Remnant <scott@netsplit.com>.
   2.210 -#
   2.211 -# This program is free software; you can redistribute it and/or modify
   2.212 -# it under the terms of the GNU General Public License as published by
   2.213 -# the Free Software Foundation; either version 2 of the License, or
   2.214 -# (at your option) any later version.
   2.215 -#
   2.216 -# This program is distributed in the hope that it will be useful, but
   2.217 -# WITHOUT ANY WARRANTY; without even the implied warranty of
   2.218 -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   2.219 -# General Public License for more details.
   2.220 -#
   2.221 -# You should have received a copy of the GNU General Public License
   2.222 -# along with this program; if not, write to the Free Software
   2.223 -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
   2.224 -#
   2.225 -# As a special exception to the GNU General Public License, if you
   2.226 -# distribute this file as part of a program that contains a
   2.227 -# configuration script generated by Autoconf, you may include it under
   2.228 -# the same distribution terms that you use for the rest of that program.
   2.229 -
   2.230 -# PKG_PROG_PKG_CONFIG([MIN-VERSION])
   2.231 -# ----------------------------------
   2.232 -AC_DEFUN([PKG_PROG_PKG_CONFIG],
   2.233 -[m4_pattern_forbid([^_?PKG_[A-Z_]+$])
   2.234 -m4_pattern_allow([^PKG_CONFIG(_PATH)?$])
   2.235 -AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])
   2.236 -AC_ARG_VAR([PKG_CONFIG_PATH], [directories to add to pkg-config's search path])
   2.237 -AC_ARG_VAR([PKG_CONFIG_LIBDIR], [path overriding pkg-config's built-in search path])
   2.238 -
   2.239 -if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
   2.240 -	AC_PATH_TOOL([PKG_CONFIG], [pkg-config])
   2.241 -fi
   2.242 -if test -n "$PKG_CONFIG"; then
   2.243 -	_pkg_min_version=m4_default([$1], [0.9.0])
   2.244 -	AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version])
   2.245 -	if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
   2.246 -		AC_MSG_RESULT([yes])
   2.247 -	else
   2.248 -		AC_MSG_RESULT([no])
   2.249 -		PKG_CONFIG=""
   2.250 -	fi
   2.251 -fi[]dnl
   2.252 -])# PKG_PROG_PKG_CONFIG
   2.253 -
   2.254 -# PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
   2.255 -#
   2.256 -# Check to see whether a particular set of modules exists.  Similar
   2.257 -# to PKG_CHECK_MODULES(), but does not set variables or print errors.
   2.258 -#
   2.259 -# Please remember that m4 expands AC_REQUIRE([PKG_PROG_PKG_CONFIG])
   2.260 -# only at the first occurence in configure.ac, so if the first place
   2.261 -# it's called might be skipped (such as if it is within an "if", you
   2.262 -# have to call PKG_CHECK_EXISTS manually
   2.263 -# --------------------------------------------------------------
   2.264 -AC_DEFUN([PKG_CHECK_EXISTS],
   2.265 -[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
   2.266 -if test -n "$PKG_CONFIG" && \
   2.267 -    AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then
   2.268 -  m4_default([$2], [:])
   2.269 -m4_ifvaln([$3], [else
   2.270 -  $3])dnl
   2.271 -fi])
   2.272 -
   2.273 -# _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES])
   2.274 -# ---------------------------------------------
   2.275 -m4_define([_PKG_CONFIG],
   2.276 -[if test -n "$$1"; then
   2.277 -    pkg_cv_[]$1="$$1"
   2.278 - elif test -n "$PKG_CONFIG"; then
   2.279 -    PKG_CHECK_EXISTS([$3],
   2.280 -                     [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`],
   2.281 -		     [pkg_failed=yes])
   2.282 - else
   2.283 -    pkg_failed=untried
   2.284 -fi[]dnl
   2.285 -])# _PKG_CONFIG
   2.286 -
   2.287 -# _PKG_SHORT_ERRORS_SUPPORTED
   2.288 -# -----------------------------
   2.289 -AC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED],
   2.290 -[AC_REQUIRE([PKG_PROG_PKG_CONFIG])
   2.291 -if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
   2.292 -        _pkg_short_errors_supported=yes
   2.293 -else
   2.294 -        _pkg_short_errors_supported=no
   2.295 -fi[]dnl
   2.296 -])# _PKG_SHORT_ERRORS_SUPPORTED
   2.297 -
   2.298 -
   2.299 -# PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
   2.300 -# [ACTION-IF-NOT-FOUND])
   2.301 -#
   2.302 -#
   2.303 -# Note that if there is a possibility the first call to
   2.304 -# PKG_CHECK_MODULES might not happen, you should be sure to include an
   2.305 -# explicit call to PKG_PROG_PKG_CONFIG in your configure.ac
   2.306 -#
   2.307 -#
   2.308 -# --------------------------------------------------------------
   2.309 -AC_DEFUN([PKG_CHECK_MODULES],
   2.310 -[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
   2.311 -AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl
   2.312 -AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl
   2.313 -
   2.314 -pkg_failed=no
   2.315 -AC_MSG_CHECKING([for $1])
   2.316 -
   2.317 -_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2])
   2.318 -_PKG_CONFIG([$1][_LIBS], [libs], [$2])
   2.319 -
   2.320 -m4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS
   2.321 -and $1[]_LIBS to avoid the need to call pkg-config.
   2.322 -See the pkg-config man page for more details.])
   2.323 -
   2.324 -if test $pkg_failed = yes; then
   2.325 -   	AC_MSG_RESULT([no])
   2.326 -        _PKG_SHORT_ERRORS_SUPPORTED
   2.327 -        if test $_pkg_short_errors_supported = yes; then
   2.328 -	        $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "$2" 2>&1`
   2.329 -        else 
   2.330 -	        $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors "$2" 2>&1`
   2.331 -        fi
   2.332 -	# Put the nasty error message in config.log where it belongs
   2.333 -	echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD
   2.334 -
   2.335 -	m4_default([$4], [AC_MSG_ERROR(
   2.336 -[Package requirements ($2) were not met:
   2.337 -
   2.338 -$$1_PKG_ERRORS
   2.339 -
   2.340 -Consider adjusting the PKG_CONFIG_PATH environment variable if you
   2.341 -installed software in a non-standard prefix.
   2.342 -
   2.343 -_PKG_TEXT])dnl
   2.344 -        ])
   2.345 -elif test $pkg_failed = untried; then
   2.346 -     	AC_MSG_RESULT([no])
   2.347 -	m4_default([$4], [AC_MSG_FAILURE(
   2.348 -[The pkg-config script could not be found or is too old.  Make sure it
   2.349 -is in your PATH or set the PKG_CONFIG environment variable to the full
   2.350 -path to pkg-config.
   2.351 -
   2.352 -_PKG_TEXT
   2.353 -
   2.354 -To get pkg-config, see <http://pkg-config.freedesktop.org/>.])dnl
   2.355 -        ])
   2.356 -else
   2.357 -	$1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
   2.358 -	$1[]_LIBS=$pkg_cv_[]$1[]_LIBS
   2.359 -        AC_MSG_RESULT([yes])
   2.360 -	$3
   2.361 -fi[]dnl
   2.362 -])# PKG_CHECK_MODULES