From 9466b3042bc7314915a15f499bd0b087f569654d Mon Sep 17 00:00:00 2001 From: deva Date: Thu, 24 Mar 2005 12:14:44 +0000 Subject: Initial revision --- tools/CPUMaker | 27 +++++++++++++++++++++++++ tools/MIaVAdd | 64 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ tools/MocList | 11 ++++++++++ tools/MocMaker | 3 +++ 4 files changed, 105 insertions(+) create mode 100755 tools/CPUMaker create mode 100755 tools/MIaVAdd create mode 100755 tools/MocList create mode 100755 tools/MocMaker (limited to 'tools') diff --git a/tools/CPUMaker b/tools/CPUMaker new file mode 100755 index 0000000..d62ff23 --- /dev/null +++ b/tools/CPUMaker @@ -0,0 +1,27 @@ +#!/bin/sh + +FLAG="${FLAG} -ansi -Wall -O2 -finline-functions" + +case "$(cat /proc/cpuinfo | egrep '^model name'|cut -d ':' -f 2|cut -c 2-)" in + 'Intel(R) Pentium(R) M processor 1300MHz') + FLAG="${FLAG} -march=pentium3 -fomit-frame-pointer -ffast-math" + ;; + *) + ;; +esac + +for flag in $(cat /proc/cpuinfo | egrep '^flags'|cut -d ':' -f 2|cut -c 2-); do + case $flag in + mmx) + FLAG="${FLAG} -mmmx" + ;; + sse) + FLAG="${FLAG} -msse" + ;; + sse2) + FLAG="${FLAG} -msse2" + ;; + esac +done + +echo 'GCC_FLAGS = $(QTGCC_FLAGS)' $FLAG diff --git a/tools/MIaVAdd b/tools/MIaVAdd new file mode 100755 index 0000000..8a5ca1a --- /dev/null +++ b/tools/MIaVAdd @@ -0,0 +1,64 @@ +# -*- mode: shell-script; sh-shell: bash; sh-indentation: 2 -*- + +function allfile() { + echo "/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */" > $1; + echo "/***************************************************************************" >> $1; + echo " * $1" >> $1; + echo " *" >> $1 ; + echo " * `date`" >> $1; + echo " * Copyright 2005 Bent Bisballe" >> $1; + echo " * deva@aasimon.org" >> $1; + echo " ****************************************************************************/" >> $1; + echo "" >> $1; + echo "/*" >> $1; + echo " * This program is free software; you can redistribute it and/or modify" >> $1; + echo " * it under the terms of the GNU General Public License as published by" >> $1; + echo " * the Free Software Foundation; either version 2 of the License, or" >> $1; + echo " * (at your option) any later version." >> $1; + echo " *" >> $1; + echo " * This program is distributed in the hope that it will be useful," >> $1; + echo " * but WITHOUT ANY WARRANTY; without even the implied warranty of" >> $1; + echo " * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the" >> $1; + echo " * GNU Library General Public License for more details." >> $1; + echo " *" >> $1; + echo " * You should have received a copy of the GNU General Public License" >> $1; + echo " * along with this program; if not, write to the Free Software" >> $1; + echo " * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA." >> $1; + echo " */" >> $1; + echo "" >> $1; +} + +function ccfile() { + local hf=`echo -n $1 | cut -d'.' -f1`.h; + hfile $hf; + + allfile $1; + echo -n '#include "' >> $1; + echo -n $hf >> $1; + echo '"' >> $1; + echo '' >> $1; +} + +function hfile() { + allfile $1; + local hn=`echo $1 | tr 'a-z.' 'A-Z_'` + echo -n "#ifndef __MIAV_" >> $1; + echo -n "$hn" >> $1; + echo "__" >> $1; + echo -n "#define __MIAV_" >> $1; + echo -n "$hn" >> $1; + echo "__" >> $1; + echo -n "#endif/*__MIAV_" >> $1; + echo -n "$hn" >> $1; + echo "__*/" >> $1; +} + +if [ "$#" = "1" ]; then +if [ "CC" = `echo $1 | cut -d'.' -f2 | tr 'a-z' 'A-Z'` ]; then + ccfile $1; +fi; +if [ "H" = `echo $1 | cut -d'.' -f2 | tr 'a-z' 'A-Z'` ]; then + hfile $1; +fi; +else echo "Usage: $0 filename"; +fi; diff --git a/tools/MocList b/tools/MocList new file mode 100755 index 0000000..b69f49f --- /dev/null +++ b/tools/MocList @@ -0,0 +1,11 @@ +# -*- mode: shell-script; sh-shell: bash; sh-indentation: 2 -*- +if grep "#define USE_GUI" ../config.h > /dev/null ; then + if [ "$1" = "cc" ]; then + grep "Q_OBJECT" *.h | cut -d: -f1 | sed -e 's/^//g;s/\.h/\.moc.cc/g'| xargs echo; + elif [ "$1" = "o" ]; then + grep "Q_OBJECT" *.h | cut -d: -f1 | sed -e 's/^//g;s/\.h/\.moc.o/g'| xargs echo; + elif [ "$1" = "h" ]; then + grep "Q_OBJECT" *.h | cut -d: -f1 | cut -d'/' -f3 | xargs echo; + fi +fi + diff --git a/tools/MocMaker b/tools/MocMaker new file mode 100755 index 0000000..da34900 --- /dev/null +++ b/tools/MocMaker @@ -0,0 +1,3 @@ +# -*- mode: shell-script; sh-shell: bash; sh-indentation: 2 -*- +echo -ne "\n" +for file in `grep "Q_OBJECT" *.h | cut -d: -f1 | cut -d'/' -f3 | xargs echo`; do echo -e "moc_${file%.h}.cpp: $file\n\t@\${MOC} $file -o moc_${file%.h}.cpp\n"; done -- cgit v1.2.3