Choose -Os automatically on mipsel.
authorJean-Paul Saman <jpsaman@videolan.org>
Tue, 8 Jun 2004 18:17:15 +0000 (18:17 +0000)
committerJean-Paul Saman <jpsaman@videolan.org>
Tue, 8 Jun 2004 18:17:15 +0000 (18:17 +0000)
configure.ac
vlc.roku

index 079a214..ef3613b 100644 (file)
@@ -709,11 +709,19 @@ if test "${ac_cv_c_pipe}" != "no"; then
 fi
 
 dnl Check for various optimization flags
+AC_CACHE_CHECK([if \$CC accepts -Os],
+    [ac_cv_c_os],
+    [CFLAGS="${CFLAGS_save} -Os"
+     AC_TRY_COMPILE([],,ac_cv_c_os=yes, ac_cv_c_os=no)])
+if test "${ac_cv_c_os}" != "no" -a "${target_cpu}" = "mipsel"; then
+    CFLAGS_OPTIM="${CFLAGS_OPTIM} -Os"
+fi
+
 AC_CACHE_CHECK([if \$CC accepts -O3],
     [ac_cv_c_o3],
     [CFLAGS="${CFLAGS_save} -O3"
      AC_TRY_COMPILE([],,ac_cv_c_o3=yes, ac_cv_c_o3=no)])
-if test "${ac_cv_c_o3}" != "no"; then
+if test "${ac_cv_c_o3}" != "no" -a "${target_cpu}" != "mipsel"; then
     CFLAGS_OPTIM="${CFLAGS_OPTIM} -O3"
 fi
 
@@ -721,17 +729,17 @@ AC_CACHE_CHECK([if \$CC accepts -O2],
     [ac_cv_c_o2],
     [CFLAGS="${CFLAGS_save} -O2"
      AC_TRY_COMPILE([],,ac_cv_c_o2=yes, ac_cv_c_o2=no)])
-if test "${ac_cv_c_o2}" != "no"; then
+if test "${ac_cv_c_o2}" != "no" -a "${target_cpu}" != "mipsel"; then
     if test "${ac_cv_c_o3}" = "no"; then
         CFLAGS_OPTIM="${CFLAGS_OPTIM} -O2"
     fi
     CFLAGS_NOOPTIM="${CFLAGS_NOOPTIM} -O2"
-else
+else 
     AC_CACHE_CHECK([if \$CC accepts -O],
         [ac_cv_c_o],
         [CFLAGS="${CFLAGS_save} -O"
          AC_TRY_COMPILE([],,ac_cv_c_o=yes, ac_cv_c_o=no)])
-    if test "${ac_cv_c_o}" != "no"; then
+    if test "${ac_cv_c_o}" != "no" -a "${target_cpu}" != "mipsel"; then
         if test "${ac_cv_c_o3}" = "no"; then
             CFLAGS_OPTIM="${CFLAGS_OPTIM} -O"
        fi
index 5ad36aa..702ba18 100755 (executable)
--- a/vlc.roku
+++ b/vlc.roku
@@ -1,13 +1,14 @@
 #!/bin/sh
 
 SRC="${HOME}/src"
+ROKU="${HOME}/src/roku-dev"
 
 # do it.
 make distclean
 ./bootstrap
 CC=mipsel-linux-gcc CXX=mipsel-linux-g++ AR=mipsel-linux-ar LD=mipsel-linux-ld RANLIB=mipsel-linux-ranlib STRIP=mipsel-linux-strip \
  ./configure --host=mipsel --enable-release --enable-static --enable-shared --enable-plugins \
-  --prefix=${HOME}/src/roku-dev/usr \
+  --prefix=${ROKU}/usr \
   --disable-sdl \
   --enable-mad \
   --disable-libmpeg2 --with-libmpeg2-tree=${SRC}/mpeg2dec-0.4.0 \
@@ -51,8 +52,9 @@ CC=mipsel-linux-gcc CXX=mipsel-linux-g++ AR=mipsel-linux-ar LD=mipsel-linux-ld R
   --enable-oss --disable-alsa \
   --disable-visual --disable-goom \
   --enable-hd1000a --disable-hd1000v \
-  CFLAGS="-I${HOME}/src/roku-dev/usr/include -I${HOME}/src/roku-dev/usr/local/include/roku" \
+  CFLAGS="-I${ROKU}/usr/include -I${ROKU}/usr/local/include/roku" \
   CXXFLAGS="-I/usr/tools/roku/include" \
-  CPPFLAGS="-I${HOME}/src/roku-dev/usr/local/include" \
-  LDFLAGS="-L/usr/tools/roku/mipsel-linux/lib -L${HOME}/src/roku-dev/lib -L${HOME}/src/roku-dev/usr/local/lib -Wl,-rpath-link -Wl,${HOME}/src/roku-dev/usr/local/lib -lm" && \
-  make
+  CPPFLAGS="-I${ROKU}/usr/local/include" \
+  LDFLAGS="-L/usr/tools/roku/mipsel-linux/lib -L${ROKU}/lib -L${ROKU}/usr/local/lib -Wl,-rpath-link -Wl,${ROKU}/usr/local/lib" && \
+  make &&
+  ${STRIP} -s vlc