Re: [Fink-devel] OT: M4 the SDL Framework

2012-08-01 Thread David Lowe
On 2012 Jul 31, at 4:15 PM, TheSin wrote:

 dpkg -S sdl-config
 sdl: /sw/bin/sdl-config
 
 sdl is the dev files for fink installed sdl, I'm not sure what you are trying 
 to build that needs sdl but it likely just does no know about your fink 
 installation.  Check that you have sdl installed, if you do then check 
 whatever you are trying use sdl with to see if configure has an --sdl-prefix 
 type switch to tell it that it's in whatever your fink install is, default /sw

I guess when i titled this as off-topic i didn't make it clear enough 
that this is not a fink issue.  I have no problem building freeciv-sdl in fink, 
as that uses *.dylibs that the configure can easily pick up.  As an experiment, 
i was trying to build an sdl client for freeciv outside of fink.  This is 
failing, as we can't seem to detect or use SDL.framework provided in binary 
format by libSDL.  This is definitely beyond my expertise, and it seems to be 
stumping everyone else as well [Sam Lantinga included].  Sorry for the noise.

sent from Lion

Wash: Man walks down the street in a hat like that, you know he's not afraid 
of anything ... 
--
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
___
Fink-devel mailing list
Fink-devel@lists.sourceforge.net
List archive:
http://news.gmane.org/gmane.os.apple.fink.devel
Subscription management:
https://lists.sourceforge.net/lists/listinfo/fink-devel


Re: [Fink-devel] OT: M4 the SDL Framework

2012-08-01 Thread Daniel Macks
On Wed, 1 Aug 2012 10:33:45 -0700, David Lowe doctorjl...@verizon.net wrote:
On 2012 Jul 31, at 4:15 PM, TheSin wrote:

  dpkg -S sdl-config
  sdl: /sw/bin/sdl-config
   sdl is the dev files for fink installed sdl, I'm not sure what 
 you are trying to build that needs sdl but it likely just does no 
 know about your fink installation.  Check that you have sdl 
 installed, if you do then check whatever you are trying use sdl with 
 to see if configure has an --sdl-prefix type switch to tell it that 
 it's in whatever your fink install is, default /sw

  I guess when i titled this as off-topic i didn't make it clear 
 enough that this is not a fink issue.  I have no problem building 
 freeciv-sdl in fink, as that uses *.dylibs that the configure can 
 easily pick up.  As an experiment, i was trying to build an sdl 
 client for freeciv outside of fink.  This is failing, as we can't 
 seem to detect or use SDL.framework provided in binary format by 
 libSDL.  This is definitely beyond my expertise, and it seems to be 
 stumping everyone else as well [Sam Lantinga included].  Sorry for 
 the noise. 

Given sdl using sdl-config and sdl.pc as the ways to publish flags, 
which is the problem here: those file(s) not being found by [the 
build-system of whatever you are trying to compile against SDL], or 
that build-system not handling them properly, or the flags not being 
correct for accomplishing that compiling? None of these seem to cry out 
for an .m4 solution IMO. 

dan

  --
Daniel Macks
dma...@netspace.org



--
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
___
Fink-devel mailing list
Fink-devel@lists.sourceforge.net
List archive:
http://news.gmane.org/gmane.os.apple.fink.devel
Subscription management:
https://lists.sourceforge.net/lists/listinfo/fink-devel


Re: [Fink-devel] OT: M4 the SDL Framework

2012-08-01 Thread TheSin
again I refer to my response.

since we now know this is a self build.

 check whatever you are trying use sdl with to see if configure has an 
 --sdl-prefix type switch to tell it that it's in whatever your fink install 
 is, default /sw

/sw is not a default place to look for anything so you need to tell configure 
about it some how.  You need to check your configure flags and see if there is 
one you may also need to set CFLAGS and LDFLAGS in order to find things.

This is all stuff that is outside of fink and can not be supported, I'm just 
giving you ideas and places to check, alternatively you could just make this 
into a local fink package and avoid having to tell it about fink ;)
---
TS
http://www.southofheaven.org/
Life begins and ends with chaos, live between the chaos!

On 2012-08-01, at 11:33 AM, David Lowe wrote:

 On 2012 Jul 31, at 4:15 PM, TheSin wrote:
 
 dpkg -S sdl-config
 sdl: /sw/bin/sdl-config
 
 sdl is the dev files for fink installed sdl, I'm not sure what you are 
 trying to build that needs sdl but it likely just does no know about your 
 fink installation.  Check that you have sdl installed, if you do then check 
 whatever you are trying use sdl with to see if configure has an --sdl-prefix 
 type switch to tell it that it's in whatever your fink install is, default 
 /sw
 
   I guess when i titled this as off-topic i didn't make it clear enough 
 that this is not a fink issue.  I have no problem building freeciv-sdl in 
 fink, as that uses *.dylibs that the configure can easily pick up.  As an 
 experiment, i was trying to build an sdl client for freeciv outside of fink.  
 This is failing, as we can't seem to detect or use SDL.framework provided in 
 binary format by libSDL.  This is definitely beyond my expertise, and it 
 seems to be stumping everyone else as well [Sam Lantinga included].  Sorry 
 for the noise.
 
 sent from Lion
 
 Wash: Man walks down the street in a hat like that, you know he's not afraid 
 of anything ... 
 --
 Live Security Virtual Conference
 Exclusive live event will cover all the ways today's security and 
 threat landscape has changed and how IT managers can respond. Discussions 
 will include endpoint security, mobile security and the latest in malware 
 threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
 ___
 Fink-devel mailing list
 Fink-devel@lists.sourceforge.net
 List archive:
 http://news.gmane.org/gmane.os.apple.fink.devel
 Subscription management:
 https://lists.sourceforge.net/lists/listinfo/fink-devel


--
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
___
Fink-devel mailing list
Fink-devel@lists.sourceforge.net
List archive:
http://news.gmane.org/gmane.os.apple.fink.devel
Subscription management:
https://lists.sourceforge.net/lists/listinfo/fink-devel


Re: [Fink-devel] OT: M4 the SDL Framework

2012-08-01 Thread TheSin
I concur 100% this isn't a fault of the software nor is something that can be 
resolved upstream, this is just about build system understanding and knowing 
where things are on your system, since fink does not pollute /usr the typical 
places to search like /usr/bin or /usr/local/bin will not turn up sdl-config, 
you have to tell configure that it's in /sw/bin/ as it has no way of knowing 
that on it's own.
---
TS
http://www.southofheaven.org/
Life begins and ends with chaos, live between the chaos!

On 2012-08-01, at 11:39 AM, Daniel Macks wrote:

 On Wed, 1 Aug 2012 10:33:45 -0700, David Lowe doctorjl...@verizon.net wrote:
 On 2012 Jul 31, at 4:15 PM, TheSin wrote:
 
 dpkg -S sdl-config
 sdl: /sw/bin/sdl-config
 sdl is the dev files for fink installed sdl, I'm not sure what 
 you are trying to build that needs sdl but it likely just does no 
 know about your fink installation.  Check that you have sdl 
 installed, if you do then check whatever you are trying use sdl with 
 to see if configure has an --sdl-prefix type switch to tell it that 
 it's in whatever your fink install is, default /sw
 
 I guess when i titled this as off-topic i didn't make it clear 
 enough that this is not a fink issue.  I have no problem building 
 freeciv-sdl in fink, as that uses *.dylibs that the configure can 
 easily pick up.  As an experiment, i was trying to build an sdl 
 client for freeciv outside of fink.  This is failing, as we can't 
 seem to detect or use SDL.framework provided in binary format by 
 libSDL.  This is definitely beyond my expertise, and it seems to be 
 stumping everyone else as well [Sam Lantinga included].  Sorry for 
 the noise. 
 
 Given sdl using sdl-config and sdl.pc as the ways to publish flags, 
 which is the problem here: those file(s) not being found by [the 
 build-system of whatever you are trying to compile against SDL], or 
 that build-system not handling them properly, or the flags not being 
 correct for accomplishing that compiling? None of these seem to cry out 
 for an .m4 solution IMO. 
 
 dan
 
  --
 Daniel Macks
 dma...@netspace.org
 
 
 
 --
 Live Security Virtual Conference
 Exclusive live event will cover all the ways today's security and 
 threat landscape has changed and how IT managers can respond. Discussions 
 will include endpoint security, mobile security and the latest in malware 
 threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
 ___
 Fink-devel mailing list
 Fink-devel@lists.sourceforge.net
 List archive:
 http://news.gmane.org/gmane.os.apple.fink.devel
 Subscription management:
 https://lists.sourceforge.net/lists/listinfo/fink-devel


--
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
___
Fink-devel mailing list
Fink-devel@lists.sourceforge.net
List archive:
http://news.gmane.org/gmane.os.apple.fink.devel
Subscription management:
https://lists.sourceforge.net/lists/listinfo/fink-devel


Re: [Fink-devel] OT: M4 the SDL Framework

2012-08-01 Thread Hanspeter Niederstrasser
On 8/1/2012 1:39 PM, Daniel Macks wrote:
 On Wed, 1 Aug 2012 10:33:45 -0700, David Lowe doctorjl...@verizon.net wrote:
 On 2012 Jul 31, at 4:15 PM, TheSin wrote:

 dpkg -S sdl-config
 sdl: /sw/bin/sdl-config
 sdl is the dev files for fink installed sdl, I'm not sure what
 you are trying to build that needs sdl but it likely just does no
 know about your fink installation.  Check that you have sdl
 installed, if you do then check whatever you are trying use sdl with
 to see if configure has an --sdl-prefix type switch to tell it that
 it's in whatever your fink install is, default /sw

   I guess when i titled this as off-topic i didn't make it clear
 enough that this is not a fink issue.  I have no problem building
 freeciv-sdl in fink, as that uses *.dylibs that the configure can
 easily pick up.  As an experiment, i was trying to build an sdl
 client for freeciv outside of fink.  This is failing, as we can't
 seem to detect or use SDL.framework provided in binary format by
 libSDL.  This is definitely beyond my expertise, and it seems to be
 stumping everyone else as well [Sam Lantinga included].  Sorry for
 the noise.

 Given sdl using sdl-config and sdl.pc as the ways to publish flags,
 which is the problem here: those file(s) not being found by [the
 build-system of whatever you are trying to compile against SDL], or
 that build-system not handling them properly, or the flags not being
 correct for accomplishing that compiling? None of these seem to cry out
 for an .m4 solution IMO.

The official SDL.framework doesn't have sdl-config or sdl.pc, and so 
m4/sdl.m4 that 3rd party programs would use will not work with an 
SDL.framework install because there are no flags to be published by 
pkg/sdl-config.

For sdl.m4 to correctly identify an SDL.framework install, it would need 
to 1) check for the existence of the SDL binary (usually 
/Library/Frameworks/SDL.framework/SDL), 2) compile a test program to 
make sure the framework works, and 3) not get confused if a system has 
both the framework and the 'unixy' installs coexisting.

In order for freeciv-sdl to find the SDL.framework, the sdl.m4 it uses 
needs to be modified to know about frameworks, or the freeciv configure 
script itself needs to be modified to have the option to know about 
frameworks (valknut had --with-osx-framework=DIR to find QT4 frameworks 
vs the default library file layout).

There are existing libraries that have similar issues (find Framework 
location, use that layout to determine -I and -L flags).  Perhaps some 
.m4 file in the pkg autoconf-archive can be used to look for a similar 
situation.

Hanspeter


--
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
___
Fink-devel mailing list
Fink-devel@lists.sourceforge.net
List archive:
http://news.gmane.org/gmane.os.apple.fink.devel
Subscription management:
https://lists.sourceforge.net/lists/listinfo/fink-devel


Re: [Fink-devel] OT: M4 the SDL Framework

2012-08-01 Thread David Lowe
On 2012 Aug 1, at 10:39 AM, Daniel Macks wrote:

 Given sdl using sdl-config and sdl.pc as the ways to publish flags, 
 which is the problem here: those file(s) not being found by [the 
 build-system of whatever you are trying to compile against SDL], or 
 that build-system not handling them properly, or the flags not being 
 correct for accomplishing that compiling? None of these seem to cry out 
 for an .m4 solution IMO. 

As Mr. Neiderstrasser already pointed out, the initial difficulty is 
that there is no config or pc component in the framework.  The reason for 
considering M4 is simply that it already exists.  If i am able to provide a 
patch to SDL upstream then all projects that configure with AM_PATH_SDL would 
benefit from the added capability.

On 2012 Aug 1, at 11:01 AM, Hanspeter Niederstrasser wrote:

 For sdl.m4 to correctly identify an SDL.framework install, it would need 
 to 1) check for the existence of the SDL binary (usually 
 /Library/Frameworks/SDL.framework/SDL), 2) compile a test program to 
 make sure the framework works, and 3) not get confused if a system has 
 both the framework and the 'unixy' installs coexisting.

Ooh.  #3 hadn't even occurred to me, thanks for pointing that out.  If 
the library is present in both formats, then i suppose the .dylib should take 
precedence over the framework.  I will also check valknut and autoconf-archive 
for any breadcrumbs.

sent from Lion

Mal: You're welcome on my boat. God ain't.
--
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
___
Fink-devel mailing list
Fink-devel@lists.sourceforge.net
List archive:
http://news.gmane.org/gmane.os.apple.fink.devel
Subscription management:
https://lists.sourceforge.net/lists/listinfo/fink-devel


[Fink-devel] OT: M4 the SDL Framework

2012-07-31 Thread David Lowe
I raised an issue with the libSDL project that their provided automake 
macro is incapable of detecting and configuring their provided runtime 
framework.  Sam Lantinga responded with: I typically build and install SDL on 
Mac OS X using the unix style configure/install which works fine.  Can you 
submit a patch for sdl.m4 which does the right thing for you?  I'm attaching 
the file for you.  I don't speak M4 and have only rudimentary understanding of 
frameworks.  However, it does seem like the macro is searching for a file 
called 'sdl-config' and i don't see such a file inside the SDL framework.  At 
this point i'm not sure if:

1) 'sdl-config' is in the framework but hidden.
2) The framework needs to be built differently to include 'sdl-config'.
3) The macro needs to test for some other file inside the framework.

Here is the M4 file:

 # Configure paths for SDL
 # Sam Lantinga 9/21/99
 # stolen from Manish Singh
 # stolen back from Frank Belew
 # stolen from Manish Singh
 # Shamelessly stolen from Owen Taylor
 
 # serial 1
 
 dnl AM_PATH_SDL([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]])
 dnl Test for SDL, and define SDL_CFLAGS and SDL_LIBS
 dnl
 AC_DEFUN([AM_PATH_SDL2],
 [dnl 
 dnl Get the cflags and libraries from the sdl2-config script
 dnl
 AC_ARG_WITH(sdl-prefix,[  --with-sdl-prefix=PFX   Prefix where SDL is 
 installed (optional)],
 sdl_prefix=$withval, sdl_prefix=)
 AC_ARG_WITH(sdl-exec-prefix,[  --with-sdl-exec-prefix=PFX Exec prefix where 
 SDL is installed (optional)],
 sdl_exec_prefix=$withval, sdl_exec_prefix=)
 AC_ARG_ENABLE(sdltest, [  --disable-sdltest   Do not try to compile and 
 run a test SDL program],
   , enable_sdltest=yes)
 
   min_sdl_version=ifelse([$1], ,0.9.0,$1)
 
   if test x$sdl_prefix$sdl_exec_prefix = x ; then
 PKG_CHECK_MODULES([SDL], [sdl2 = $min_sdl_version],
[sdl_pc=yes],
[sdl_pc=no])
   else
 sdl_pc=no
 if test x$sdl_exec_prefix != x ; then
   sdl_config_args=$sdl_config_args --exec-prefix=$sdl_exec_prefix
   if test x${SDL_CONFIG+set} != xset ; then
 SDL_CONFIG=$sdl_exec_prefix/bin/sdl2-config
   fi
 fi
 if test x$sdl_prefix != x ; then
   sdl_config_args=$sdl_config_args --prefix=$sdl_prefix
   if test x${SDL_CONFIG+set} != xset ; then
 SDL_CONFIG=$sdl_prefix/bin/sdl2-config
   fi
 fi
   fi
 
   if test x$sdl_pc = xyes ; then
 no_sdl=
 SDL_CONFIG=pkg-config sdl2
   else
 as_save_PATH=$PATH
 if test x$prefix != xNONE  test $cross_compiling != yes; then
   PATH=$prefix/bin:$prefix/usr/bin:$PATH
 fi
 AC_PATH_PROG(SDL_CONFIG, sdl2-config, no, [$PATH])
 PATH=$as_save_PATH
 AC_MSG_CHECKING(for SDL - version = $min_sdl_version)
 no_sdl=
 
 if test $SDL_CONFIG = no ; then
   no_sdl=yes
 else
   SDL_CFLAGS=`$SDL_CONFIG $sdl_config_args --cflags`
   SDL_LIBS=`$SDL_CONFIG $sdl_config_args --libs`
 
   sdl_major_version=`$SDL_CONFIG $sdl_config_args --version | \
  sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
   sdl_minor_version=`$SDL_CONFIG $sdl_config_args --version | \
  sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
   sdl_micro_version=`$SDL_CONFIG $sdl_config_args --version | \
  sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
   if test x$enable_sdltest = xyes ; then
 ac_save_CFLAGS=$CFLAGS
 ac_save_CXXFLAGS=$CXXFLAGS
 ac_save_LIBS=$LIBS
 CFLAGS=$CFLAGS $SDL_CFLAGS
 CXXFLAGS=$CXXFLAGS $SDL_CFLAGS
 LIBS=$LIBS $SDL_LIBS
 dnl
 dnl Now check if the installed SDL is sufficiently new. (Also sanity
 dnl checks the results of sdl2-config to some extent
 dnl
   rm -f conf.sdltest
   AC_TRY_RUN([
 #include stdio.h
 #include stdlib.h
 #include string.h
 #include SDL.h
 
 char*
 my_strdup (char *str)
 {
   char *new_str;
   
   if (str)
 {
   new_str = (char *)malloc ((strlen (str) + 1) * sizeof(char));
   strcpy (new_str, str);
 }
   else
 new_str = NULL;
   
   return new_str;
 }
 
 int main (int argc, char *argv[])
 {
   int major, minor, micro;
   char *tmp_version;
 
   /* This hangs on some systems (?)
   system (touch conf.sdltest);
   */
   { FILE *fp = fopen(conf.sdltest, a); if ( fp ) fclose(fp); }
 
   /* HP/UX 9 (%@#!) writes to sscanf strings */
   tmp_version = my_strdup($min_sdl_version);
   if (sscanf(tmp_version, %d.%d.%d, major, minor, micro) != 3) {
  printf(%s, bad version string\n, $min_sdl_version);
  exit(1);
}
 
if (($sdl_major_version  major) ||
   (($sdl_major_version == major)  ($sdl_minor_version  minor)) ||
   (($sdl_major_version == major)  ($sdl_minor_version == minor)  
 ($sdl_micro_version = micro)))
 {
   return 0;
 }
   else
 {
   printf(\n*** 'sdl2-config --version' returned %d.%d.%d, but the 
 minimum version\n, $sdl_major_version, 

Re: [Fink-devel] OT: M4 the SDL Framework

2012-07-31 Thread TheSin
dpkg -S sdl-config
sdl: /sw/bin/sdl-config

sdl is the dev files for fink installed sdl, I'm not sure what you are trying 
to build that needs sdl but it likely just does no know about your fink 
installation.  Check that you have sdl installed, if you do then check whatever 
you are trying use sdl with to see if configure has an --sdl-prefix type switch 
to tell it that it's in whatever your fink install is, default /sw
---
TS
http://www.southofheaven.org/
Life begins and ends with chaos, live between the chaos!

On 2012-07-31, at 5:05 PM, David Lowe wrote:

   I raised an issue with the libSDL project that their provided automake 
 macro is incapable of detecting and configuring their provided runtime 
 framework.  Sam Lantinga responded with: I typically build and install SDL 
 on Mac OS X using the unix style configure/install which works fine.  Can you 
 submit a patch for sdl.m4 which does the right thing for you?  I'm attaching 
 the file for you.  I don't speak M4 and have only rudimentary understanding 
 of frameworks.  However, it does seem like the macro is searching for a file 
 called 'sdl-config' and i don't see such a file inside the SDL framework.  At 
 this point i'm not sure if:
 
 1) 'sdl-config' is in the framework but hidden.
 2) The framework needs to be built differently to include 'sdl-config'.
 3) The macro needs to test for some other file inside the framework.
 
   Here is the M4 file:
 
 # Configure paths for SDL
 # Sam Lantinga 9/21/99
 # stolen from Manish Singh
 # stolen back from Frank Belew
 # stolen from Manish Singh
 # Shamelessly stolen from Owen Taylor
 
 # serial 1
 
 dnl AM_PATH_SDL([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]])
 dnl Test for SDL, and define SDL_CFLAGS and SDL_LIBS
 dnl
 AC_DEFUN([AM_PATH_SDL2],
 [dnl 
 dnl Get the cflags and libraries from the sdl2-config script
 dnl
 AC_ARG_WITH(sdl-prefix,[  --with-sdl-prefix=PFX   Prefix where SDL is 
 installed (optional)],
sdl_prefix=$withval, sdl_prefix=)
 AC_ARG_WITH(sdl-exec-prefix,[  --with-sdl-exec-prefix=PFX Exec prefix where 
 SDL is installed (optional)],
sdl_exec_prefix=$withval, sdl_exec_prefix=)
 AC_ARG_ENABLE(sdltest, [  --disable-sdltest   Do not try to compile and 
 run a test SDL program],
  , enable_sdltest=yes)
 
  min_sdl_version=ifelse([$1], ,0.9.0,$1)
 
  if test x$sdl_prefix$sdl_exec_prefix = x ; then
PKG_CHECK_MODULES([SDL], [sdl2 = $min_sdl_version],
   [sdl_pc=yes],
   [sdl_pc=no])
  else
sdl_pc=no
if test x$sdl_exec_prefix != x ; then
  sdl_config_args=$sdl_config_args --exec-prefix=$sdl_exec_prefix
  if test x${SDL_CONFIG+set} != xset ; then
SDL_CONFIG=$sdl_exec_prefix/bin/sdl2-config
  fi
fi
if test x$sdl_prefix != x ; then
  sdl_config_args=$sdl_config_args --prefix=$sdl_prefix
  if test x${SDL_CONFIG+set} != xset ; then
SDL_CONFIG=$sdl_prefix/bin/sdl2-config
  fi
fi
  fi
 
  if test x$sdl_pc = xyes ; then
no_sdl=
SDL_CONFIG=pkg-config sdl2
  else
as_save_PATH=$PATH
if test x$prefix != xNONE  test $cross_compiling != yes; then
  PATH=$prefix/bin:$prefix/usr/bin:$PATH
fi
AC_PATH_PROG(SDL_CONFIG, sdl2-config, no, [$PATH])
PATH=$as_save_PATH
AC_MSG_CHECKING(for SDL - version = $min_sdl_version)
no_sdl=
 
if test $SDL_CONFIG = no ; then
  no_sdl=yes
else
  SDL_CFLAGS=`$SDL_CONFIG $sdl_config_args --cflags`
  SDL_LIBS=`$SDL_CONFIG $sdl_config_args --libs`
 
  sdl_major_version=`$SDL_CONFIG $sdl_config_args --version | \
 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
  sdl_minor_version=`$SDL_CONFIG $sdl_config_args --version | \
 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
  sdl_micro_version=`$SDL_CONFIG $sdl_config_args --version | \
 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
  if test x$enable_sdltest = xyes ; then
ac_save_CFLAGS=$CFLAGS
ac_save_CXXFLAGS=$CXXFLAGS
ac_save_LIBS=$LIBS
CFLAGS=$CFLAGS $SDL_CFLAGS
CXXFLAGS=$CXXFLAGS $SDL_CFLAGS
LIBS=$LIBS $SDL_LIBS
 dnl
 dnl Now check if the installed SDL is sufficiently new. (Also sanity
 dnl checks the results of sdl2-config to some extent
 dnl
  rm -f conf.sdltest
  AC_TRY_RUN([
 #include stdio.h
 #include stdlib.h
 #include string.h
 #include SDL.h
 
 char*
 my_strdup (char *str)
 {
  char *new_str;
 
  if (str)
{
  new_str = (char *)malloc ((strlen (str) + 1) * sizeof(char));
  strcpy (new_str, str);
}
  else
new_str = NULL;
 
  return new_str;
 }
 
 int main (int argc, char *argv[])
 {
  int major, minor, micro;
  char *tmp_version;
 
  /* This hangs on some systems (?)
  system (touch conf.sdltest);
  */
  { FILE *fp = fopen(conf.sdltest, a); if ( fp ) fclose(fp); }
 
  /* HP/UX 9 (%@#!) writes to sscanf strings */
  tmp_version = my_strdup($min_sdl_version);
  if