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 - Ported sdl-config
Summary: Ported sdl-config
Status: RESOLVED WONTFIX
Alias: None
Product: SDL
Classification: Unclassified
Component: build (show other bugs)
Version: 1.2.13
Hardware: x86 Windows (XP)
: P2 enhancement
Assignee: Ryan C. Gordon
QA Contact: Sam Lantinga
URL:
Keywords: target-1.2.14
Depends on:
Blocks:
 
Reported: 2008-12-31 02:37 UTC by bauke
Modified: 2009-09-21 03:58 UTC (History)
0 users

See Also:


Attachments
converted sdl-script (1.07 KB, text/plain)
2008-12-31 02:56 UTC, bauke
Details

Note You need to log in before you can comment on or make changes to this bug.
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!