summaryrefslogtreecommitdiffstats
path: root/qt3-tqt3/convert_qt_itself_qt3
diff options
context:
space:
mode:
authorTimothy Pearson <kb9vqf@pearsoncomputing.net>2011-08-24 12:21:55 -0500
committerTimothy Pearson <kb9vqf@pearsoncomputing.net>2011-08-24 12:21:55 -0500
commit7bb4259779332cc76ed4a2d05e1c8bcb1c5ab9d7 (patch)
treeb58a89bd3b7ce598b717df2fae78bdf86a4afb7e /qt3-tqt3/convert_qt_itself_qt3
parent25e53f98b74b3c9a8c5ef57146d8e6d43c9ebde3 (diff)
downloadexperimental-7bb4259779332cc76ed4a2d05e1c8bcb1c5ab9d7.tar.gz
experimental-7bb4259779332cc76ed4a2d05e1c8bcb1c5ab9d7.zip
Add scripts to autogenerate a "real" TQt3 from the Qt3 sources in GIT
Diffstat (limited to 'qt3-tqt3/convert_qt_itself_qt3')
-rwxr-xr-xqt3-tqt3/convert_qt_itself_qt3139
1 files changed, 139 insertions, 0 deletions
diff --git a/qt3-tqt3/convert_qt_itself_qt3 b/qt3-tqt3/convert_qt_itself_qt3
new file mode 100755
index 0000000..8f0b8b6
--- /dev/null
+++ b/qt3-tqt3/convert_qt_itself_qt3
@@ -0,0 +1,139 @@
+#!/bin/bash
+
+#find ./ -type f -iname "*.c*" -exec sed -i 's/Q\([ABCDEFGHIJKLMNOPQRSTUVWXYZ]\)\([_abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ]\)\([_abcdefghijklmnopqrstuvwxyzDE]\)/TQ\1\2\3/g' {} \;
+#find ./ -type f -iname "*.h*" -exec sed -i 's/Q\([ABCDEFGHIJKLMNOPQRSTUVWXYZ]\)\([_abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ]\)\([_abcdefghijklmnopqrstuvwxyzDE]\)/TQ\1\2\3/g' {} \;
+
+find ./ -type f -iname "*.c*" -exec sed -i 's/^Q\([ABCDEFGHIJKLMNOPQRSTUVWXYZ]\)\([_abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ]\)/TQ\1\2/g' {} \;
+find ./ -type f -iname "*.h*" -exec sed -i 's/^Q\([ABCDEFGHIJKLMNOPQRSTUVWXYZ]\)\([_abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ]\)/TQ\1\2/g' {} \;
+
+find ./ -type f -iname "*.c*" -exec sed -i 's/\([^_]\)Q\([ABCDEFGHIJKLMNOPQRSTUVWXYZ]\)\([_abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ]\)/\1TQ\2\3/g' {} \;
+find ./ -type f -iname "*.h*" -exec sed -i 's/\([^_]\)Q\([ABCDEFGHIJKLMNOPQRSTUVWXYZ]\)\([_abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ]\)/\1TQ\2\3/g' {} \;
+
+find ./ -type f -iname "*.c*" -exec sed -i 's/Qt/TQt/g' {} \;
+find ./ -type f -iname "*.h*" -exec sed -i 's/Qt/TQt/g' {} \;
+
+find ./ -type f -iname "*.h*" -exec sed -i 's/TTQ/TQ/g' {} \;
+find ./ -type f -iname "*.h*" -exec sed -i 's/TTQ/TQ/g' {} \;
+find ./ -type f -iname "*.h*" -exec sed -i 's/TTQ/TQ/g' {} \;
+find ./ -type f -iname "*.h*" -exec sed -i 's/TTQ/TQ/g' {} \;
+find ./ -type f -iname "*.c*" -exec sed -i 's/TTQ/TQ/g' {} \;
+find ./ -type f -iname "*.c*" -exec sed -i 's/TTQ/TQ/g' {} \;
+find ./ -type f -iname "*.c*" -exec sed -i 's/TTQ/TQ/g' {} \;
+find ./ -type f -iname "*.c*" -exec sed -i 's/TTQ/TQ/g' {} \;
+
+sed -i 's/^Q\([ABCDEFGHIJKLMNOPQRSTUVWXYZ]\)\([_abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ]\)/TQ\1\2/g' src/moc/moc.l
+sed -i 's/^Q\([ABCDEFGHIJKLMNOPQRSTUVWXYZ]\)\([_abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ]\)/TQ\1\2/g' src/moc/moc.y
+sed -i 's/\([^_]\)Q\([ABCDEFGHIJKLMNOPQRSTUVWXYZ]\)\([_abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ]\)/\1TQ\2\3/g' src/moc/moc.l
+sed -i 's/\([^_]\)Q\([ABCDEFGHIJKLMNOPQRSTUVWXYZ]\)\([_abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ]\)/\1TQ\2\3/g' src/moc/moc.y
+sed -i 's/Qt/TQt/g' src/moc/moc.l
+sed -i 's/Qt/TQt/g' src/moc/moc.y
+sed -i 's/TTQ/TQ/g' src/moc/moc.l
+sed -i 's/TTQ/TQ/g' src/moc/moc.y
+sed -i 's/TTQ/TQ/g' src/moc/moc.l
+sed -i 's/TTQ/TQ/g' src/moc/moc.y
+sed -i 's/TTQ/TQ/g' src/moc/moc.l
+sed -i 's/TTQ/TQ/g' src/moc/moc.y
+sed -i 's/TTQ/TQ/g' src/moc/moc.l
+sed -i 's/TTQ/TQ/g' src/moc/moc.y
+
+if [[ 0 == 1 ]]; then
+
+find ./ -type f -iname "*.c*" -exec sed -i 's/\([^_]\)METHOD\([( ]\)/\1TQT_METHOD\2/g' {} \;
+find ./ -type f -iname "*.h*" -exec sed -i 's/\([^_]\)METHOD\([( ]\)/\1TQT_METHOD\2/g' {} \;
+find ./ -type f -iname "*.c*" -exec sed -i 's/\([^_]\)SLOT\([( ]\)/\1TQT_SLOT\2/g' {} \;
+find ./ -type f -iname "*.h*" -exec sed -i 's/\([^_]\)SLOT\([( ]\)/\1TQT_SLOT\2/g' {} \;
+find ./ -type f -iname "*.c*" -exec sed -i 's/\([^_]\)SIGNAL\([( ]\)/\1TQT_SIGNAL\2/g' {} \;
+find ./ -type f -iname "*.h*" -exec sed -i 's/\([^_]\)SIGNAL\([( ]\)/\1TQT_SIGNAL\2/g' {} \;
+
+find ./ -type f -iname "*.h*" -exec sed -i 's/TQT_TQT_/TQT_/g' {} \;
+find ./ -type f -iname "*.h*" -exec sed -i 's/TQT_TQT_/TQT_/g' {} \;
+find ./ -type f -iname "*.h*" -exec sed -i 's/TQT_TQT_/TQT_/g' {} \;
+find ./ -type f -iname "*.h*" -exec sed -i 's/TQT_TQT_/TQT_/g' {} \;
+find ./ -type f -iname "*.c*" -exec sed -i 's/TQT_TQT_/TQT_/g' {} \;
+find ./ -type f -iname "*.c*" -exec sed -i 's/TQT_TQT_/TQT_/g' {} \;
+find ./ -type f -iname "*.c*" -exec sed -i 's/TQT_TQT_/TQT_/g' {} \;
+find ./ -type f -iname "*.c*" -exec sed -i 's/TQT_TQT_/TQT_/g' {} \;
+
+find ./ -type f -iname "*" -exec sed -i 's/MOC/TQMOC/g' {} \;
+find ./ -type f -iname "*" -exec sed -i 's/TQTQMOC/TQMOC/g' {} \;
+
+find ./ -type f -iname "*" -exec sed -i 's/RGB_MASK/TQRGB_MASK/g' {} \;
+find ./ -type f -iname "*" -exec sed -i 's/TQTQRGB_MASK/TQRGB_MASK/g' {} \;
+
+find ./ -type f -iname "*" -exec sed -i 's/tqslots/Q_SLOTS/g' {} \;
+find ./ -type f -iname "*" -exec sed -i 's/tqsignals/Q_SIGNALS/g' {} \;
+find ./ -type f -iname "*" -exec sed -i 's/Q_SIGNALSlotimp\.h/tqsignalslotimp\.h/g' {} \;
+find ./ -type f -iname "*" -exec sed -i 's/TQ_SLOTS/Q_SLOTS/g' {} \;
+find ./ -type f -iname "*" -exec sed -i 's/TQ_SIGNALS/Q_SIGNALS/g' {} \;
+
+find ./ -type f -iname "*.c*" -exec sed -i 's/Q_/TQ_/g' {} \;
+find ./ -type f -iname "*.h*" -exec sed -i 's/Q_/TQ_/g' {} \;
+
+# Certain Things Are Sacred
+cd src/
+
+# Rename headers
+../../convert_qt_itself_qt3_rename
+
+# Move files
+find . -type d -exec ../../convert_qt_itself_qt3_helper "{}" \;
+
+cd ../
+
+cd qmake/
+
+# Rename headers
+../../convert_qt_itself_qt3_rename
+
+cd ../
+
+cd tools/
+
+# Rename headers
+../../convert_qt_itself_qt3_rename
+
+cd ../
+
+cd qmake/
+
+find . -type d -exec ../../convert_qt_itself_qt3_helper "{}" \;
+../../convert_qt_itself_qt3_rename
+
+cd ../
+
+cd include
+ls -l | awk '{print "ln -s", $10, " ", $8, " && rm ", $8}' | sed 's/\(.*\) q\(.*\)\.h/\1 tq\2\.h/g' | sed 's/\(.*\)\/q\(.*\)\.h/\1\/tq\2\.h/g' | sh
+cd ..
+
+for i in {1..50}
+do
+ find ./ -type f -iname "*.pro" -exec sed -i 's/\(.*\)\/q\(.*\)\.c\(.*\)/\1\/tq\2\.c\3/g' {} \;
+ find ./ -type f -iname "*.pro" -exec sed -i 's/\(.*\)\/q\(.*\)\.h\(.*\)/\1\/tq\2\.h\3/g' {} \;
+
+ find ./ -type f -iname "*.pri" -exec sed -i 's/\(.*\)\/q\(.*\)\.c\(.*\)/\1\/tq\2\.c\3/g' {} \;
+ find ./ -type f -iname "*.pri" -exec sed -i 's/\(.*\)\/q\(.*\)\.h\(.*\)/\1\/tq\2\.h\3/g' {} \;
+done
+
+fi
+
+# Back out changes we did not want to make
+find ./ -type f -iname "*" -exec sed -i 's/TQT_/QT_/g' {} \;
+find ./ -type f -iname "*" -exec sed -i 's/TQMAKE/QMAKE/g' {} \;
+find ./ -type f -iname "*" -exec sed -i 's/TQTDIR/QTDIR/g' {} \;
+find ./ -type f -iname "*" -exec sed -i 's/OBLITQUE/OBLIQUE/g' {} \;
+find ./ -type f -iname "*" -exec sed -i 's/ATQUA/AQUA/g' {} \;
+
+find ./ -type f -iname "*" -exec sed -i 's/QUType_Q/QUType_TQ/g' {} \;
+find ./ -type f -iname "*" -exec sed -i 's/\([ (]\)Q\#\#/\1TQ\#\#/g' {} \;
+find ./ -type f -iname "*" -exec sed -i 's/STQL/SQL/g' {} \;
+
+# Apply patches
+patch -p0 < ../tqt3_fixups.diff
+
+exit 0
+
+# Fix up configure
+sed -i 's/qconfig\./tqconfig\./g' configure
+sed -i 's/qmodules\./tqmodules\./g' configure
+#sed -i 's/qtmd5/tqtmd5/g' ./qmake/Makefile.unix
+sed -i 's/\([ =/]\)q/\1tq/g' ./qmake/Makefile.unix