Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: b1b4d0686e
Fetching contributors…

Octocat-spinner-32-eaf2f5

Cannot retrieve contributors at this time

file 69 lines (59 sloc) 2.085 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68
#!/bin/bash
############################################################
# #
# optimize.lunar - Lunar general optimization code #
# #
############################################################
# #
# Copyright 2006 by Auke Kok under GPLv2 #
# #
############################################################


bad_flags()
{
debug_msg "bad_flags ($@)"
verbose_msg "bad_flags \"$@\""

# maintain some degree of backward compatibility here
if [[ "$1" == "ALL" ]]; then
unset CFLAGS CXXFLAGS CPPFLAGS LDFLAGS
elif [[ "$1" == "compiler" ]]; then
unset CFLAGS CXXFLAGS CPPFLAGS
elif [[ "$1" == "linker" ]]; then
unset LDFLAGS
else
for BAD_FLAG in "$@" ; do
CFLAGS=$(echo $CFLAGS | sed "s/$BAD_FLAG//")
CXXFLAGS=$(echo $CXXFLAGS | sed "s/$BAD_FLAG//")
CPPFLAGS=$(echo $CPPFLAGS | sed "s/$BAD_FLAG//")
LDFLAGS=$(echo $LDFLAGS | sed "s/$BAD_FLAG//")
done
fi
}


optimize_menu()
{(
export IFS=$'\t\n'
while true; do
if [ -z "$(plugin_call OPTIMIZE_MENU)" ]; then
$DIALOG --msgbox "There are no configurable compontents. Please update your moonbase!" 6 60
return
fi
PLUGIN=`$DIALOG --cancel-label "Close" --default-item "$PLUGIN" --menu "Select a component for which to configure optimizations" 0 0 0 $(plugin_call OPTIMIZE_MENU)`
if [ $? != 0 ]; then
return
fi

plugin_call OPTIMIZE_MENU $PLUGIN
done
)}


# because we pretty much need to know our $BUILD string
# everywhere this code is separate and guides all other
# parts of lunar where related things are done. Here we
# autodetect the most important part but leave it open
# to the user to override it

# PLATFORM - translated uname -m / arch
PLATFORM=$(uname -m | sed 's/i[3456]86/x86/')
# BUILD -
case $PLATFORM in
x86|x86_64)
BUILD=$(uname -m)-pc-linux-gnu ;;
*)
BUILD=$(uname -m | sed 's/.*/\L&/g')-linux-gnu ;;
esac
Something went wrong with that request. Please try again.