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 408 - sdl-config gets runtime libdir undefined for runtime linker.
Summary: sdl-config gets runtime libdir undefined for runtime linker.
Status: RESOLVED FIXED
Alias: None
Product: SDL
Classification: Unclassified
Component: build (show other bugs)
Version: HG 1.2
Hardware: x86 Solaris
: P2 major
Assignee: Ryan C. Gordon
QA Contact: Sam Lantinga
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-03-04 08:34 UTC by Ben Taylor
Modified: 2007-04-04 03:51 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ben Taylor 2007-03-04 08:34:34 UTC
Solaris 10/U3 X86, building libSDL-1.2 SVN.

sdl-config is created with runtime linker directory that has
no definition.  IE, starting line 46 of the generated sdl-config:

    --libs)
      echo -L${exec_prefix}/lib -R${libdir} -lSDL  -lpthread -lposix4
      ;;
    --static-libs)
#    --libs|--static-libs)
      echo -L${exec_prefix}/lib -R${libdir} -lSDL  -lpthread -lposix4


libdir is not defined by sdl-config, and therefore generates an error
for other programs which run sdl-config --libs or sdl-config --static-libs.
This patch fixes the usage of libdir to match the ${exec_prefix}/lib.

Do I also need to submit a patch for configure since configure.in 
generates configure?

--- configure.in.ORIG   2007-03-04 11:31:09.937988000 -0500
+++ configure.in        2007-03-04 11:31:13.597902000 -0500
@@ -2621,10 +2621,10 @@

 if test "x$enable_rpath" = "xyes"; then
   if test $ARCH = bsdi -o $ARCH = freebsd -o $ARCH = irix -o $ARCH = linux -o $ARCH = netbsd; then
-    SDL_RLD_FLAGS="-Wl,-rpath,\${libdir}"
+    SDL_RLD_FLAGS="-Wl,-rpath,\${exec_prefix}/lib"
   fi
   if test $ARCH = solaris; then
-    SDL_RLD_FLAGS="-R\${libdir}"
+    SDL_RLD_FLAGS="-R\${exec_prefix}/lib"
   fi
 else
   SDL_RLD_FLAGS=""
@@ -2639,7 +2639,7 @@
       SDL_LIBS="$SDL_LIBS -Wl,-framework,Carbon"
     fi
     # Evil hack to allow static linking on Mac OS X
-    SDL_STATIC_LIBS="\${libdir}/libSDLmain.a \${libdir}/libSDL.a $EXTRA_LDFLAGS"
+    SDL_STATIC_LIBS="\${exec_prefix}/lib/libSDLmain.a \${exec_prefix}/lib/libSDL.a $EXTRA_LDFLAGS"
     ;;
   *)
     SDL_STATIC_LIBS="$SDL_LIBS"
Comment 1 Ryan C. Gordon 2007-03-04 12:01:52 UTC
Reopening bug until patch is evaluated.

--ryan.

Comment 2 Mike Frysinger 2007-03-19 20:13:53 UTC
you cant assume ${prefix}/lib is correct ... there's a reason we have ${libdir} in the first place

you either want to change sdl-config.in like so:
 exec_prefix_set=no
+libdir=@libdir@

or you want to change configure.in like so:
-    SDL_RLD_FLAGS="-Wl,-rpath,\${libdir}"
+    SDL_RLD_FLAGS="-Wl,-rpath,${libdir}"
Comment 3 Ben Taylor 2007-03-19 20:30:41 UTC
(In reply to comment #2)
> you cant assume ${prefix}/lib is correct ... there's a reason we have ${libdir}
> in the first place
> 
> you either want to change sdl-config.in like so:
>  exec_prefix_set=no
> +libdir=@libdir@
> 
> or you want to change configure.in like so:
> -    SDL_RLD_FLAGS="-Wl,-rpath,\${libdir}"
> +    SDL_RLD_FLAGS="-Wl,-rpath,${libdir}"
> 

fixing sdl-config.in makes more sense to me, but I also wonder why
there's a -L${prefix}/lib and -R${libdir}.  Shouldn't it either be
-L${libdir} -R${libdir} or -L${prefix}/lib -R${prefix}/lib to
maintain a little bit of consistency.

Comment 4 Ryan C. Gordon 2007-04-04 03:51:25 UTC
I believe svn revision #3003 (1.2 branch) and #3004 (1.3 branch)--which were applied for a similar complaint on the mailing list--fixes this issue, so I'm resolving this bug. If that turns out not to be the case, please reopen it.

Thanks,
--ryan.