[1c379e4] | 1 | #!/bin/bash
|
---|
| 2 |
|
---|
| 3 | ### SDL ###
|
---|
| 4 |
|
---|
| 5 | cd ${SRC}
|
---|
| 6 | LOG=SDL-blfs.log
|
---|
| 7 |
|
---|
| 8 | USE_DIRECTFB=Y
|
---|
| 9 | USE_LIBCACA=Y
|
---|
| 10 |
|
---|
| 11 | SELF=`basename ${0}`
|
---|
| 12 | set_buildenv
|
---|
| 13 | set_libdirname
|
---|
| 14 | setup_multiarch
|
---|
| 15 | if [ ! "${libdirname}" = "lib" ]; then
|
---|
| 16 | extra_conf="--libdir=/usr/${libdirname}"
|
---|
| 17 | fi
|
---|
| 18 |
|
---|
| 19 | unpack_tarball SDL-${SDL_VER}
|
---|
| 20 | cd ${PKGDIR}
|
---|
| 21 |
|
---|
| 22 | apply_patch SDL-1.2.8-gentoo-fixes
|
---|
| 23 |
|
---|
| 24 | if [ "${USE_DIRECTFB}" = "Y" ]; then
|
---|
| 25 | extra_conf="${extra_conf} --enable-video-directfb"
|
---|
| 26 | fi
|
---|
| 27 |
|
---|
| 28 | if [ "${USE_LIBCACA}" = "Y" ]; then
|
---|
| 29 | # Patch from libcaca home page
|
---|
| 30 | apply_patch patch-libsdl1.2-libcaca0.7
|
---|
| 31 | ./autogen.sh || barf
|
---|
| 32 | extra_conf="${extra_conf} --enable-video-caca"
|
---|
| 33 | fi
|
---|
| 34 |
|
---|
| 35 | # Hack configure to produce correct rpath settings
|
---|
| 36 | sed -i "/SDL_RLD_FLAGS=/s@lib@${libdirname}@g" \
|
---|
| 37 | configure
|
---|
| 38 |
|
---|
| 39 | # HACK -
|
---|
| 40 | #echo "====================== H A C K ============================"
|
---|
| 41 | #echo "for some reason -lgcc_s doesn't get brought in when linking"
|
---|
| 42 | #echo "other packages against libSDL (lgcc_s needed by libstdc++)"
|
---|
| 43 | #echo "on amd64... here we hack -lgcc_s to the end of the list of"
|
---|
| 44 | #echo "shared libraries in sdl-config.in (but only on amd64)."
|
---|
| 45 | #echo "Please check whether things are sane on other arches..."
|
---|
| 46 | #echo "====================== H A C K ============================"
|
---|
| 47 | #case ${TGT_ARCH} in
|
---|
| 48 | # x86_64 )
|
---|
| 49 | # sed -i '/^@ENABLE_SHARED_TRUE@/s|@SHARED_SYSTEM_LIBS@|& -lgcc_s|' \
|
---|
| 50 | # sdl-config.in
|
---|
| 51 | # ;;
|
---|
| 52 | #esac
|
---|
| 53 | echo "====================== H A C K ============================"
|
---|
| 54 | echo "for some reason -lgcc_s doesn't get brought in when linking"
|
---|
| 55 | echo "against libstdc++ on amd64 (lgcc_s needed by libstdc++)."
|
---|
| 56 | echo "Here we add -Wl,--as-needed -lgcc_s -Wl,--no-as-needed to"
|
---|
| 57 | echo "LDFLAGS so that it is provided when needed..."
|
---|
| 58 | echo "Please check whether things are sane on other arches..."
|
---|
| 59 | echo "====================== H A C K ============================"
|
---|
| 60 |
|
---|
| 61 | max_log_init SDL ${SDL_VER} "blfs (shared)" ${CONFLOGS} ${LOG}
|
---|
| 62 | CC="${CC-gcc} ${ARCH_CFLAGS}" \
|
---|
| 63 | CXX="${CXX-g++} ${ARCH_CFLAGS}" \
|
---|
| 64 | CFLAGS="-O2 -pipe ${TGT_CFLAGS}" \
|
---|
| 65 | CXXFLAGS="-O2 -pipe ${TGT_CFLAGS}" \
|
---|
| 66 | LDFLAGS="-L/usr/${libdirname} -Wl,--as-needed -lgcc_s -Wl,--no-as-needed" \
|
---|
| 67 | ./configure --prefix=/usr ${extra_conf} \
|
---|
| 68 | --disable-debug --enable-video-aalib \
|
---|
| 69 | >> ${LOGFILE} 2>&1 &&
|
---|
| 70 | echo " o Configure OK" &&
|
---|
| 71 |
|
---|
| 72 | min_log_init ${BUILDLOGS} &&
|
---|
| 73 | make \
|
---|
| 74 | >> ${LOGFILE} 2>&1 &&
|
---|
| 75 | echo " o Build OK" &&
|
---|
| 76 |
|
---|
| 77 | min_log_init ${INSTLOGS} &&
|
---|
| 78 | make install \
|
---|
| 79 | >> ${LOGFILE} 2>&1 &&
|
---|
| 80 | echo " o ALL OK" || barf
|
---|
| 81 |
|
---|
| 82 | if [ "${MULTIARCH}" = "Y" ]; then
|
---|
| 83 | use_wrapper /usr/bin/sdl-config
|
---|
| 84 | fi
|
---|
| 85 |
|
---|