Pass LDFLAGS to the build system
authorSam Lantinga <slouken@libsdl.org>
Mon, 20 Feb 2006 20:08:29 +0000
changeset 1393cd3362657144
parent 1392 4a203b442650
child 1394 e57f8d1344b6
Pass LDFLAGS to the build system
Makefile.in
configure.in
     1.1 --- a/Makefile.in	Mon Feb 20 13:00:59 2006 +0000
     1.2 +++ b/Makefile.in	Mon Feb 20 20:08:29 2006 +0000
     1.3 @@ -21,7 +21,7 @@
     1.4  CC      = @CC@
     1.5  INCLUDE = @INCLUDE@
     1.6  CFLAGS  = @BUILD_CFLAGS@
     1.7 -LDFLAGS = @BUILD_LIBS@
     1.8 +LDFLAGS = @BUILD_LDFLAGS@
     1.9  LIBTOOL = @LIBTOOL@
    1.10  INSTALL = @INSTALL@
    1.11  NASM	= @NASM@ @NASMFLAGS@
     2.1 --- a/configure.in	Mon Feb 20 13:00:59 2006 +0000
     2.2 +++ b/configure.in	Mon Feb 20 20:08:29 2006 +0000
     2.3 @@ -59,14 +59,14 @@
     2.4          # We build SDL on cygwin without the UNIX emulation layer
     2.5          CFLAGS="$CFLAGS -I/usr/include/mingw -DWIN32 -Uunix -mno-cygwin"
     2.6          BUILD_CFLAGS="$CFLAGS \$(INCLUDE)"
     2.7 -        BUILD_LIBS="-mno-cygwin"
     2.8 +        BUILD_LDFLAGS="$LDFLAGS -mno-cygwin"
     2.9          SDL_CFLAGS="-I/usr/include/mingw -DWIN32 -Uunix -mno-cygwin"
    2.10          SDL_LIBS="-lSDL -mno-cygwin"
    2.11          ;;
    2.12      *)
    2.13          CFLAGS="$CFLAGS -D_GNU_SOURCE=1"
    2.14          BUILD_CFLAGS="$CFLAGS \$(INCLUDE)"
    2.15 -        BUILD_LIBS=""
    2.16 +        BUILD_LDFLAGS="$LDFLAGS"
    2.17          SDL_CFLAGS=""
    2.18          SDL_LIBS="-lSDL"
    2.19          ;;
    2.20 @@ -118,7 +118,7 @@
    2.21      fi
    2.22      AC_CHECK_FUNCS(malloc calloc realloc free getenv putenv unsetenv qsort abs bcopy memset memcpy memmove strlen strlcpy strlcat strdup _strrev _strupr _strlwr strchr strrchr strstr itoa _ltoa _uitoa _ultoa strtol _i64toa _ui64toa strtoll atoi atof strcmp strncmp stricmp strcasecmp sscanf snprintf vsnprintf sigaction setjmp nanosleep)
    2.23  
    2.24 -    AC_CHECK_LIB(m, pow, [BUILD_LIBS="$BUILD_LIBS -lm"])
    2.25 +    AC_CHECK_LIB(m, pow, [BUILD_LDFLAGS="$BUILD_LDFLAGS -lm"])
    2.26  fi
    2.27  
    2.28  if test x$have_inttypes != xyes; then
    2.29 @@ -284,7 +284,7 @@
    2.30              # OpenBSD needs linking with ossaudio emulation library
    2.31              case "$target" in
    2.32                  *-*-openbsd*|*-*-netbsd*)
    2.33 -                    BUILD_LIBS="$BUILD_LIBS -lossaudio";;
    2.34 +                    BUILD_LDFLAGS="$BUILD_LDFLAGS -lossaudio";;
    2.35              esac
    2.36          fi
    2.37      fi
    2.38 @@ -330,7 +330,7 @@
    2.39                 test x$enable_alsa_shared = xyes && test x$alsa_lib != x; then
    2.40                  AC_DEFINE_UNQUOTED(SDL_AUDIO_DRIVER_ALSA_DYNAMIC, "$alsa_lib")
    2.41              else
    2.42 -                BUILD_LIBS="$BUILD_LIBS $ALSA_LIBS"
    2.43 +                BUILD_LDFLAGS="$BUILD_LDFLAGS $ALSA_LIBS"
    2.44              fi
    2.45              have_audio=yes
    2.46          fi
    2.47 @@ -392,7 +392,7 @@
    2.48          if test x$have_dmedia = xyes; then
    2.49              AC_DEFINE(SDL_AUDIO_DRIVER_DMEDIA)
    2.50              SOURCES="$SOURCES $srcdir/src/audio/dmedia/*.c"
    2.51 -            BUILD_LIBS="$BUILD_LIBS -laudio"
    2.52 +            BUILD_LDFLAGS="$BUILD_LDFLAGS -laudio"
    2.53              have_audio=yes
    2.54          fi
    2.55      fi
    2.56 @@ -424,7 +424,7 @@
    2.57              AC_DEFINE(SDL_AUDIO_DRIVER_ESD)
    2.58              SOURCES="$SOURCES $srcdir/src/audio/esd/*.c"
    2.59              BUILD_CFLAGS="$BUILD_CFLAGS $ESD_CFLAGS"
    2.60 -            BUILD_LIBS="$BUILD_LIBS $ESD_LIBS"
    2.61 +            BUILD_LDFLAGS="$BUILD_LDFLAGS $ESD_LIBS"
    2.62              have_audio=yes
    2.63          fi
    2.64      fi
    2.65 @@ -474,7 +474,7 @@
    2.66                  AC_DEFINE(SDL_AUDIO_DRIVER_ARTS)
    2.67                  SOURCES="$SOURCES $srcdir/src/audio/arts/*.c"
    2.68                  BUILD_CFLAGS="$BUILD_CFLAGS $ARTS_CFLAGS"
    2.69 -                BUILD_LIBS="$BUILD_LIBS $ARTS_LIBS"
    2.70 +                BUILD_LDFLAGS="$BUILD_LDFLAGS $ARTS_LIBS"
    2.71                  have_audio=yes
    2.72              fi
    2.73          fi
    2.74 @@ -507,7 +507,7 @@
    2.75              AC_DEFINE(SDL_AUDIO_DRIVER_NAS)
    2.76              SOURCES="$SOURCES $srcdir/src/audio/nas/*.c"
    2.77              BUILD_CFLAGS="$BUILD_CFLAGS $NAS_CFLAGS"
    2.78 -            BUILD_LIBS="$BUILD_LIBS $NAS_LIBS"
    2.79 +            BUILD_LDFLAGS="$BUILD_LDFLAGS $NAS_LIBS"
    2.80              have_audio=yes
    2.81          fi
    2.82      fi
    2.83 @@ -713,7 +713,7 @@
    2.84  
    2.85          AC_DEFINE(SDL_VIDEO_DRIVER_NANOX)
    2.86          SOURCES="$SOURCES $srcdir/src/video/nanox/*.c"
    2.87 -        BUILD_LIBS="$BUILD_LIBS -lnano-X"
    2.88 +        BUILD_LDFLAGS="$BUILD_LDFLAGS -lnano-X"
    2.89          have_video=yes
    2.90      fi
    2.91  }
    2.92 @@ -776,7 +776,7 @@
    2.93              AC_DEFINE(SDL_VIDEO_DRIVER_X11)
    2.94              SOURCES="$SOURCES $srcdir/src/video/x11/*.c"
    2.95              BUILD_CFLAGS="$BUILD_CFLAGS $X_CFLAGS"
    2.96 -            BUILD_LIBS="$BUILD_LIBS $X_LIBS"
    2.97 +            BUILD_LDFLAGS="$BUILD_LDFLAGS $X_LIBS"
    2.98              have_video=yes
    2.99  
   2.100              AC_ARG_ENABLE(dga,
   2.101 @@ -853,7 +853,7 @@
   2.102          if test x$video_photon = xyes; then
   2.103              AC_DEFINE(SDL_VIDEO_DRIVER_PHOTON)
   2.104              SOURCES="$SOURCES $srcdir/src/video/photon/*.c"
   2.105 -            BUILD_LIBS="$BUILD_LIBS -lph"
   2.106 +            BUILD_LDFLAGS="$BUILD_LDFLAGS -lph"
   2.107              have_video=yes
   2.108  
   2.109              CheckOpenGLQNX
   2.110 @@ -983,7 +983,7 @@
   2.111              AC_DEFINE(SDL_VIDEO_DRIVER_DIRECTFB)
   2.112              SOURCES="$SOURCES $srcdir/src/video/directfb/*.c"
   2.113              BUILD_CFLAGS="$BUILD_CFLAGS $DIRECTFB_CFLAGS"
   2.114 -            BUILD_LIBS="$BUILD_LIBS $DIRECTFB_LIBS"
   2.115 +            BUILD_LDFLAGS="$BUILD_LDFLAGS $DIRECTFB_LIBS"
   2.116              have_video=yes
   2.117          fi
   2.118      fi
   2.119 @@ -1034,7 +1034,7 @@
   2.120          if test x$video_ggi = xyes; then
   2.121              AC_DEFINE(SDL_VIDEO_DRIVER_GGI)
   2.122              SOURCES="$SOURCES $srcdir/src/video/ggi/*.c"
   2.123 -            BUILD_LIBS="$BUILD_LIBS -lggi -lgii -lgg"
   2.124 +            BUILD_LDFLAGS="$BUILD_LDFLAGS -lggi -lgii -lgg"
   2.125              have_video=yes
   2.126          fi
   2.127      fi
   2.128 @@ -1064,7 +1064,7 @@
   2.129          if test x$video_svga = xyes; then
   2.130              AC_DEFINE(SDL_VIDEO_DRIVER_SVGALIB)
   2.131              SOURCES="$SOURCES $srcdir/src/video/svga/*.c"
   2.132 -            BUILD_LIBS="$BUILD_LIBS -lvga"
   2.133 +            BUILD_LDFLAGS="$BUILD_LDFLAGS -lvga"
   2.134              have_video=yes
   2.135          fi
   2.136      fi
   2.137 @@ -1094,7 +1094,7 @@
   2.138          if test x$video_vgl = xyes; then
   2.139              AC_DEFINE(SDL_VIDEO_DRIVER_VGL)
   2.140              SOURCES="$SOURCES $srcdir/src/video/vgl/*.c"
   2.141 -            BUILD_LIBS="$BUILD_LIBS -lvgl"
   2.142 +            BUILD_LDFLAGS="$BUILD_LDFLAGS -lvgl"
   2.143              have_video=yes
   2.144          fi
   2.145      fi
   2.146 @@ -1145,7 +1145,7 @@
   2.147          if test x$video_aalib = xyes; then
   2.148              AC_DEFINE(SDL_VIDEO_DRIVER_AALIB)
   2.149              SOURCES="$SOURCES $srcdir/src/video/aalib/*.c"
   2.150 -            BUILD_LIBS="$BUILD_LIBS -laa"
   2.151 +            BUILD_LDFLAGS="$BUILD_LDFLAGS -laa"
   2.152              have_video=yes
   2.153          fi
   2.154      fi
   2.155 @@ -1244,7 +1244,7 @@
   2.156              video_gem=yes
   2.157              AC_DEFINE(SDL_VIDEO_DRIVER_GEM)
   2.158              SOURCES="$SOURCES $srcdir/src/video/gem/*.c"
   2.159 -            BUILD_LIBS="$BUILD_LIBS -lgem"
   2.160 +            BUILD_LDFLAGS="$BUILD_LDFLAGS -lgem"
   2.161              have_video=yes
   2.162          fi
   2.163      fi
   2.164 @@ -1304,7 +1304,7 @@
   2.165          AC_MSG_RESULT($video_opengl)
   2.166          if test x$video_opengl = xyes; then
   2.167              AC_DEFINE(SDL_VIDEO_OPENGL)
   2.168 -            BUILD_LIBS="$BUILD_LIBS -lGL"
   2.169 +            BUILD_LDFLAGS="$BUILD_LDFLAGS -lGL"
   2.170          fi
   2.171      fi
   2.172  }
   2.173 @@ -1323,7 +1323,7 @@
   2.174  {
   2.175      if test x$enable_video = xyes -a x$enable_video_opengl = xyes; then
   2.176          AC_DEFINE(SDL_VIDEO_OPENGL)
   2.177 -        BUILD_LIBS="$BUILD_LIBS -lGL"
   2.178 +        BUILD_LDFLAGS="$BUILD_LDFLAGS -lGL"
   2.179      fi
   2.180  }
   2.181  
   2.182 @@ -1334,9 +1334,9 @@
   2.183          AC_DEFINE(SDL_VIDEO_OPENGL)
   2.184          case "$target" in
   2.185              *-*-darwin*)
   2.186 -                BUILD_LIBS="$BUILD_LIBS -framework OpenGL"
   2.187 +                BUILD_LDFLAGS="$BUILD_LDFLAGS -framework OpenGL"
   2.188                  # The following is probably not available in Darwin:
   2.189 -                BUILD_LIBS="$BUILD_LIBS -framework AGL"
   2.190 +                BUILD_LDFLAGS="$BUILD_LDFLAGS -framework AGL"
   2.191          esac
   2.192      fi
   2.193  }
   2.194 @@ -1363,7 +1363,7 @@
   2.195          AC_DEFINE(SDL_VIDEO_OPENGL)
   2.196          AC_DEFINE(SDL_VIDEO_OPENGL_OSMESA)
   2.197          BUILD_CFLAGS="$BUILD_CFLAGS $OSMESA_CFLAGS"
   2.198 -        BUILD_LIBS="$BUILD_LIBS $OSMESA_LIBS"
   2.199 +        BUILD_LDFLAGS="$BUILD_LDFLAGS $OSMESA_LIBS"
   2.200  
   2.201          AC_ARG_ENABLE(osmesa-shared,
   2.202  AC_HELP_STRING([--enable-osmesa-shared], [dynamically load OSMesa OpenGL support [default=yes]]),
   2.203 @@ -1421,7 +1421,7 @@
   2.204          AC_MSG_RESULT($enable_input_tslib)
   2.205          if test x$enable_input_tslib = xyes; then
   2.206              AC_DEFINE(SDL_INPUT_TSLIB)
   2.207 -            BUILD_LIBS="$BUILD_LIBS -lts"
   2.208 +            BUILD_LDFLAGS="$BUILD_LDFLAGS -lts"
   2.209          fi
   2.210      fi
   2.211  }
   2.212 @@ -1551,7 +1551,7 @@
   2.213          if test x$use_pthreads = xyes; then
   2.214              AC_DEFINE(SDL_THREAD_PTHREAD)
   2.215              BUILD_CFLAGS="$BUILD_CFLAGS $pthread_cflags"
   2.216 -            BUILD_LIBS="$BUILD_LIBS $pthread_lib"
   2.217 +            BUILD_LDFLAGS="$BUILD_LDFLAGS $pthread_lib"
   2.218              SDL_CFLAGS="$SDL_CFLAGS $pthread_cflags"
   2.219              SDL_LIBS="$SDL_LIBS $pthread_lib"
   2.220  
   2.221 @@ -1696,9 +1696,9 @@
   2.222          AC_MSG_RESULT($have_dlopen)
   2.223  
   2.224          if test x$have_dlopen = xyes; then
   2.225 -            AC_CHECK_LIB(c, dlopen, BUILD_LIBS="$BUILD_LIBS",
   2.226 -               AC_CHECK_LIB(dl, dlopen, BUILD_LIBS="$BUILD_LIBS -ldl",
   2.227 -                  AC_CHECK_LIB(ltdl, dlopen, BUILD_LIBS="$BUILD_LIBS -lltdl")))
   2.228 +            AC_CHECK_LIB(c, dlopen, BUILD_LDFLAGS="$BUILD_LDFLAGS",
   2.229 +               AC_CHECK_LIB(dl, dlopen, BUILD_LDFLAGS="$BUILD_LDFLAGS -ldl",
   2.230 +                  AC_CHECK_LIB(ltdl, dlopen, BUILD_LDFLAGS="$BUILD_LDFLAGS -lltdl")))
   2.231              AC_CHECK_LIB(dl, dlvsym, have_dlvsym=yes)
   2.232              if test x$have_dlvsym = xyes; then
   2.233                  AC_DEFINE(HAVE_DLVSYM)
   2.234 @@ -1722,7 +1722,7 @@
   2.235          if test x$have_ldg_hdr = xyes -a x$have_ldg_lib = xyes; then
   2.236              AC_DEFINE(SDL_LOADSO_LDG)
   2.237              SOURCES="$SOURCES $srcdir/src/loadso/mint/*.c"
   2.238 -            BUILD_LIBS="$BUILD_LIBS -lldg -lgem"
   2.239 +            BUILD_LDFLAGS="$BUILD_LDFLAGS -lldg -lgem"
   2.240              have_loadso=yes
   2.241          fi
   2.242      fi
   2.243 @@ -1826,7 +1826,7 @@
   2.244              AC_DEFINE(SDL_JOYSTICK_USBHID)
   2.245              SOURCES="$SOURCES $srcdir/src/joystick/bsd/*.c"
   2.246              BUILD_CFLAGS="$BUILD_CFLAGS $USB_CFLAGS"
   2.247 -            BUILD_LIBS="$BUILD_LIBS $USB_LIBS"
   2.248 +            BUILD_LDFLAGS="$BUILD_LDFLAGS $USB_LIBS"
   2.249              have_joystick=yes
   2.250          fi
   2.251          CFLAGS="$save_CFLAGS"
   2.252 @@ -1843,7 +1843,7 @@
   2.253          AC_CHECK_LIB(rt, clock_gettime, have_clock_gettime=yes)
   2.254          if test x$have_clock_gettime = xyes; then
   2.255              AC_DEFINE(HAVE_CLOCK_GETTIME)
   2.256 -            BUILD_LIBS="$BUILD_LIBS -lrt"
   2.257 +            BUILD_LDFLAGS="$BUILD_LDFLAGS -lrt"
   2.258          fi
   2.259      fi
   2.260  }
   2.261 @@ -1948,7 +1948,7 @@
   2.262              osf)
   2.263                  AC_DEFINE(SDL_AUDIO_DRIVER_MMEAUDIO)
   2.264                  SOURCES="$SOURCES $srcdir/src/audio/mme/*.c"
   2.265 -                BUILD_LIBS="$BUILD_LIBS -lmme"
   2.266 +                BUILD_LDFLAGS="$BUILD_LDFLAGS -lmme"
   2.267                  have_audio=yes
   2.268              ;;
   2.269            esac
   2.270 @@ -2035,7 +2035,7 @@
   2.271          if test x$enable_audio = xyes; then
   2.272              AC_DEFINE(SDL_AUDIO_DRIVER_QNXNTO)
   2.273              SOURCES="$SOURCES $srcdir/src/audio/nto/*.c"
   2.274 -            BUILD_LIBS="$BUILD_LIBS -lasound"
   2.275 +            BUILD_LDFLAGS="$BUILD_LDFLAGS -lasound"
   2.276              have_audio=yes
   2.277          fi
   2.278          # Set up files for the cdrom library
   2.279 @@ -2112,9 +2112,9 @@
   2.280              have_loadso=yes
   2.281          fi
   2.282          # Set up the system libraries we need
   2.283 -        BUILD_LIBS="$BUILD_LIBS -luser32 -lgdi32 -lwinmm"
   2.284 +        BUILD_LDFLAGS="$BUILD_LDFLAGS -luser32 -lgdi32 -lwinmm"
   2.285          if test x$have_directx = xyes; then
   2.286 -            BUILD_LIBS="$BUILD_LIBS -ldxguid"
   2.287 +            BUILD_LDFLAGS="$BUILD_LDFLAGS -ldxguid"
   2.288          fi
   2.289          # The Win32 platform requires special setup
   2.290          SDL_CFLAGS="$SDL_CFLAGS -Dmain=SDL_main"
   2.291 @@ -2168,7 +2168,7 @@
   2.292          fi
   2.293          # The BeOS platform requires special setup.
   2.294          SOURCES="$srcdir/src/main/beos/*.cc $SOURCES"
   2.295 -        BUILD_LIBS="$BUILD_LIBS -lroot -lbe -lmedia -lgame -ldevice -ltextencoding"
   2.296 +        BUILD_LDFLAGS="$BUILD_LDFLAGS -lroot -lbe -lmedia -lgame -ldevice -ltextencoding"
   2.297          ;;
   2.298      *-*-darwin* )
   2.299          # This could be either full "Mac OS X", or plain "Darwin" which is
   2.300 @@ -2197,7 +2197,7 @@
   2.301          if test x$enable_joystick = xyes; then
   2.302              AC_DEFINE(SDL_JOYSTICK_IOKIT)
   2.303              SOURCES="$SOURCES $srcdir/src/joystick/darwin/*.c"
   2.304 -            BUILD_LIBS="$BUILD_LIBS -framework IOKit"
   2.305 +            BUILD_LDFLAGS="$BUILD_LDFLAGS -framework IOKit"
   2.306              have_joystick=yes
   2.307          fi
   2.308          # Set up files for the cdrom library
   2.309 @@ -2223,16 +2223,16 @@
   2.310          BUILD_CFLAGS="$BUILD_CFLAGS -fpascal-strings -DMACOSX"
   2.311          SDL_LIBS="-lSDLmain $SDL_LIBS"
   2.312          if test x$enable_video_cocoa = xyes; then
   2.313 -            BUILD_LIBS="$BUILD_LIBS -framework Cocoa"
   2.314 +            BUILD_LDFLAGS="$BUILD_LDFLAGS -framework Cocoa"
   2.315          fi
   2.316          if test x$enable_video_carbon = xyes -o x$enable_video_cocoa = xyes; then
   2.317              # The Cocoa backend still needs Carbon, and the YUV code QuickTime
   2.318 -            BUILD_LIBS="$BUILD_LIBS -framework QuickTime -framework ApplicationServices"
   2.319 -            BUILD_LIBS="$BUILD_LIBS -framework Carbon"
   2.320 +            BUILD_LDFLAGS="$BUILD_LDFLAGS -framework QuickTime -framework ApplicationServices"
   2.321 +            BUILD_LDFLAGS="$BUILD_LDFLAGS -framework Carbon"
   2.322          fi
   2.323          # If either the audio or CD driver is used, add the AudioUnit framework
   2.324          if test x$enable_audio = xyes -o x$enable_cdrom = xyes; then
   2.325 -            BUILD_LIBS="$BUILD_LIBS -framework AudioToolbox -framework AudioUnit"
   2.326 +            BUILD_LDFLAGS="$BUILD_LDFLAGS -framework AudioToolbox -framework AudioUnit"
   2.327          fi
   2.328          ;;
   2.329      *-*-mint*)
   2.330 @@ -2303,7 +2303,7 @@
   2.331              have_timers=yes
   2.332          fi
   2.333          # The RISC OS platform requires special setup.
   2.334 -        BUILD_LIBS="$BUILD_LIBS -ljpeg -ltiff -lpng -lz"
   2.335 +        BUILD_LDFLAGS="$BUILD_LDFLAGS -ljpeg -ltiff -lpng -lz"
   2.336          ;;
   2.337      *)
   2.338          AC_MSG_ERROR([
   2.339 @@ -2433,7 +2433,7 @@
   2.340  AC_SUBST(SOURCES)
   2.341  AC_SUBST(OBJECTS)
   2.342  AC_SUBST(BUILD_CFLAGS)
   2.343 -AC_SUBST(BUILD_LIBS)
   2.344 +AC_SUBST(BUILD_LDFLAGS)
   2.345  
   2.346  AC_OUTPUT([
   2.347      Makefile sdl-config SDL.spec SDL.qpg