Add scripts to autogenerate a "real" TQt3 from the Qt3 sources in GIT

pull/1/head
Timothy Pearson 13 years ago
parent 25e53f98b7
commit 7bb4259779

@ -0,0 +1,2 @@
Run create_tqt3_from_qt3 within this directory to create a version of Qt3 that uses TQ* objects
This is somewhat experimental so please be careful!

@ -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

@ -0,0 +1,5 @@
#!/bin/bash
cd $1
ls -d * | sed 's/^q\(.*\)\.h\(.*\)$/mv "&" "tq\1\.h\2"/' | grep mv | sh
ls -d * | sed 's/^q\(.*\)\.c\(.*\)$/mv "&" "tq\1\.c\2"/' | grep mv | sh

@ -0,0 +1,13 @@
#!/bin/bash
find ./ -type f -iname "*.c*" -exec sed -i 's/\(["<]\)q\(.*\)\.h\([">]\)/\1tq\2\.h\3/g' {} \;
find ./ -type f -iname "*.h*" -exec sed -i 's/\(["<]\)q\(.*\)\.h\([">]\)/\1tq\2\.h\3/g' {} \;
find ./ -type f -iname "*.c*" -exec sed -i 's/\/q\(.*\)\.h\([">]\)/\/tq\1\.h\2/g' {} \;
find ./ -type f -iname "*.h*" -exec sed -i 's/\/q\(.*\)\.h\([">]\)/\/tq\1\.h\2/g' {} \;
find ./ -type f -iname "*.c*" -exec sed -i 's/\(["<]\)q\(.*\)\.moc\([">]\)/\1tq\2\.moc\3/g' {} \;
find ./ -type f -iname "*.h*" -exec sed -i 's/\(["<]\)q\(.*\)\.moc\([">]\)/\1tq\2\.moc\3/g' {} \;
find ./ -type f -iname "*.c*" -exec sed -i 's/\(["<]\)q\(.*\)\.cpp\([">]\)/\1tq\2\.cpp\3/g' {} \;
find ./ -type f -iname "*.h*" -exec sed -i 's/\(["<]\)q\(.*\)\.cpp\([">]\)/\1tq\2\.cpp\3/g' {} \;

@ -0,0 +1,5 @@
#!/bin/bash
cp -Rp ../../main/dependencies/qt3/ tqt3
cd tqt3
../convert_qt_itself_qt3

@ -0,0 +1,28 @@
diff -ur src/moc/moc.y src/moc/moc.y
--- src/moc/moc.y 2011-08-23 02:50:57.000000000 -0500
+++ src/moc/moc.y 2011-08-24 01:46:17.000000000 -0500
@@ -3422,8 +3422,8 @@
else if ( type == "Q_ULLONG" )
fprintf( out, "v->asULongLong()" );
else if ( isVariantType( type ) ) {
- if ( type[0] == 'Q' )
- type = type.mid(1);
+ if (( type[0] == 'T' ) && ( type[1] == 'Q' ))
+ type = type.mid(2);
else
type[0] = toupper( type[0] );
fprintf( out, "v->as%s()", type.data() );
diff -ur src/moc/moc_yacc.cpp src/moc/moc_yacc.cpp
--- src/moc/moc_yacc.cpp 2011-08-23 02:03:46.000000000 -0500
+++ src/moc/moc_yacc.cpp 2011-08-24 01:46:45.000000000 -0500
@@ -3462,8 +3462,8 @@
else if ( type == "Q_ULLONG" )
fprintf( out, "v->asULongLong()" );
else if ( isVariantType( type ) ) {
- if ( type[0] == 'Q' )
- type = type.mid(1);
+ if (( type[0] == 'T' ) && ( type[1] == 'Q' ))
+ type = type.mid(2);
else
type[0] = toupper( type[0] );
fprintf( out, "v->as%s()", type.data() );
Loading…
Cancel
Save