We are currently migrating Bugzilla to GitHub issues.
Any changes made to the bug tracker now will be lost, so please do not post new bugs or make changes to them.
When we're done, all bug URLs will redirect to their equivalent location on the new bug tracker.

Bug 658

Summary: Ported sdl-config
Product: SDL Reporter: bauke <bcmpinc>
Component: buildAssignee: Ryan C. Gordon <icculus>
Status: RESOLVED WONTFIX QA Contact: Sam Lantinga <slouken>
Severity: enhancement    
Priority: P2 Keywords: target-1.2.14
Version: 1.2.13   
Hardware: x86   
OS: Windows (XP)   
Attachments: converted sdl-script

Description bauke 2008-12-31 02:37:04 UTC
The sdl-config sh-script doesn't work that well under windows. Would it be an idea to include a cmd-script?

If created a port of the script. Here's the source:

@echo off
set VAR=before
if "!VAR!" == "before" (
    set VAR=after
    if not "!VAR!" == "after" (
		cmd /V:ON /C %0 %1 %2 %3 %4 %5 %6 %7 %8 %9
		exit /B
	)
)

set prefix=c:/mingw/bin
set exec_prefix=%prefix%
set exec_prefix_set=no

set usage=Usage: sdl-config [--prefix[=DIR]] [--exec-prefix[=DIR]] [--version] [--cflags] [--libs] [--static-libs]

if "%1"=="" (
    echo !usage! 1>&2
	exit /B
)

set L=%1,%2,%3,%4,%5,%6,%7,%8,%9
for %%f in (!L!) do (
  set G=%%f
  set Q=!G:~0,9!
  if "!Q!"=="--prefix=" (
	set prefix=!G:~9!
	if !exec_prefix_set!==no (
	  set exec_prefix=!G:~9!
	)
  )
  set Q=!F:~0,14!
  if "!Q!"=="--exec-prefix=" (
	set exec_prefix_set==yes
    set exec_prefix=!G:~14!
  )
  if "!G!"=="--prefix" (
    echo !prefix!
  )
  if "!G!"=="--exec-prefix" (
    echo !exec_prefix!
  )
  if "!G!"=="--version" (
    echo 1.2.13
  )
  if "!G!"=="--cflags" (
    echo -I!prefix!/include/SDL -D_GNU_SOURCE=1 -Dmain=SDL_main
  )
  if "!G!"=="--libs" (
    echo -L!exec_prefix!/lib  -lmingw32 -lSDLmain -lSDL  -mwindows
  )
  if "!G!"=="--static-libs" (
    echo -L!exec_prefix!/lib  -lmingw32 -lSDLmain -lSDL  -mwindows
  )
)
Comment 1 bauke 2008-12-31 02:56:25 UTC
Created attachment 286 [details]
converted sdl-script

The previous script didn't work correctly. This one is supposed to do so.
Comment 2 Ryan C. Gordon 2009-09-13 16:33:30 UTC
Tagging this bug with "target-1.2.14" so we can try to resolve it for SDL 1.2.14.

Please note that we may choose to resolve it as WONTFIX. This tag is largely so we have a comprehensive wishlist of bugs to examine for 1.2.14 (and so we can close bugs that we'll never fix, rather than have them live forever in Bugzilla).

--ryan.
Comment 3 Sam Lantinga 2009-09-21 03:58:13 UTC
Thanks for the script!  I won't include it because it won't work for people using MSys or Cygwin32, but I'm sure someone can use it!