kgtk-qt3
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

mangled.sh 654B

1234567891011121314151617181920212223
  1. #!/bin/bash
  2. # $1 == C++ compiler
  3. # $2 == output name
  4. echo "class QApplication { public: int exec(); }; int QApplication::exec() { return 0; } " \
  5. "class QDialog { public: int exec(); }; int QDialog::exec() { return 0; }" >> "$2.cpp"
  6. $1 -c "$2.cpp" -o "$2.o"
  7. qdialog=`nm "$2.o" | grep QDialog | grep exec | awk '{print $3}'`
  8. qapplication=`nm "$2.o" | grep QApplication | grep exec | awk '{print $3}'`
  9. rm "$2.o" "$2.cpp"
  10. echo "#ifndef __KGTK_MANGLED_H__" > "$2"
  11. echo "#define __KGTK_MANGLED_H__" >> "$2"
  12. echo "#define KQT_QDIALOG_EXEC \"$qdialog\"" >> "$2"
  13. echo "#define KQT_QAPPLICATION_EXEC \"$qapplication\"" >> "$2"
  14. echo "#endif" >> "$2"