From 45505b78efcaf13c9741899b47a471270aeabd97 Mon Sep 17 00:00:00 2001 From: Michele Calgaro Date: Thu, 18 Oct 2018 22:58:56 +0900 Subject: smoke's qt -> tqt renaming. This relates to bug 266. Signed-off-by: Michele Calgaro --- ChangeLog.CVS | 24 +- ChangeLog.CVS.delta | 6 +- Makefile.am | 2 +- Makefile.in | 2 +- PerlTQt/INSTALL | 2 +- configure.in | 2 +- kalyptus/kalyptusCxxToSmoke.pm | 2 +- smoke/tqt/Makefile.am | 2 +- smoke/tqt/Makefile.in | 8 +- smoke/tqt/qt_smoke.h | 9 - smoke/tqt/qtguess.pl.in | 501 ----------------------------------------- smoke/tqt/tqt_smoke.h | 9 + smoke/tqt/tqtguess.pl.in | 501 +++++++++++++++++++++++++++++++++++++++++ 13 files changed, 535 insertions(+), 535 deletions(-) delete mode 100644 smoke/tqt/qt_smoke.h delete mode 100644 smoke/tqt/qtguess.pl.in create mode 100644 smoke/tqt/tqt_smoke.h create mode 100644 smoke/tqt/tqtguess.pl.in diff --git a/ChangeLog.CVS b/ChangeLog.CVS index 14d18d0..5a89c3b 100644 --- a/ChangeLog.CVS +++ b/ChangeLog.CVS @@ -234,7 +234,7 @@ 2003-08-28 02:10 germaingarand - * smoke/qt/generate.pl.in, smoke/qt/qt_smoke.h, kalyptus/kalyptus, + * smoke/qt/generate.pl.in, smoke/qt/tqt_smoke.h, kalyptus/kalyptus, kalyptus/kalyptusCxxToSmoke.pm, kalyptus/kalyptusDataDict.pm, kalyptus/kdocAstUtil.pm: @@ -284,7 +284,7 @@ 2003-08-14 18:44 germaingarand * PerlTQt/Makefile.PL.in, admin/acinclude.m4.in, - smoke/qt/qtguess.pl.in: + smoke/qt/tqtguess.pl.in: - nice patch by Marek Rouchal. Improves Solaris compatibility and static builds. Many thanks to him! @@ -689,7 +689,7 @@ 2003-02-19 13:44 germaingarand * smoke/qt/Makefile.am, smoke/qt/generate.pl.in, - smoke/qt/qtguess.pl.in, kalyptus/kalyptus, + smoke/qt/tqtguess.pl.in, kalyptus/kalyptus, kalyptus/kalyptusCxxToSmoke.pm: getting rid of GNU toolchain dependancy at last :) @@ -985,7 +985,7 @@ 2002-12-16 16:57 germaingarand * configure.in, doc/en/PerlTQt.pod, doc/en/index.html, - smoke/qt/qtguess.pl.in: + smoke/qt/tqtguess.pl.in: typo: treshold <-> threshold (configure option) @@ -1050,10 +1050,10 @@ 2002-12-09 18:09 germaingarand - * Makefile.am, smoke/qt/qtguess.pl.in: + * Makefile.am, smoke/qt/tqtguess.pl.in: - add Makefile.cvs to make dist - - correct qtguess.pl : retry grabbing symbols without __cplusplus if it fails (e.g. for Sun Forte) + - correct tqtguess.pl : retry grabbing symbols without __cplusplus if it fails (e.g. for Sun Forte) 2002-12-09 17:32 germaingarand @@ -1147,7 +1147,7 @@ 2002-12-03 15:20 germaingarand - * smoke/qt/qtguess.pl.in: + * smoke/qt/tqtguess.pl.in: fixed a quotation error -$qtflags =~ s/\$\((.*?)\)/$x{'$1'}/g; @@ -1395,7 +1395,7 @@ 2002-09-13 12:29 germaingarand * kalyptus/kalyptus, kalyptus/kalyptusCxxToSmoke.pm, - smoke/qt/qtguess.pl.in: + smoke/qt/tqtguess.pl.in: TQt 3.1 fixes @@ -1584,8 +1584,8 @@ admin/libtool.m4.in, admin/ylwrap, admin/ChangeLog, admin/old-ltcf-c.sh, smoke/Makefile.am, smoke/README, smoke/smoke.h, smoke/qt/Makefile.am, smoke/qt/generate.pl.in, - smoke/qt/generate_makefile_am.pl, smoke/qt/qt_smoke.h, - smoke/qt/qtguess.pl.in, PerlTQt/MANIFEST, PerlTQt/Makefile.PL.in, + smoke/qt/generate_makefile_am.pl, smoke/qt/tqt_smoke.h, + smoke/qt/tqtguess.pl.in, PerlTQt/MANIFEST, PerlTQt/Makefile.PL.in, PerlTQt/examples/richedit/imageCollection.pm, PerlTQt/examples/richedit/richedit.pl, kalyptus/Ast.pm, kalyptus/README, kalyptus/TODO, kalyptus/Version, kalyptus/Iter.pm, @@ -1617,8 +1617,8 @@ admin/libtool.m4.in, admin/ylwrap, admin/ChangeLog, admin/old-ltcf-c.sh, smoke/Makefile.am, smoke/README, smoke/smoke.h, smoke/qt/Makefile.am, smoke/qt/generate.pl.in, - smoke/qt/generate_makefile_am.pl, smoke/qt/qt_smoke.h, - smoke/qt/qtguess.pl.in, PerlTQt/MANIFEST, PerlTQt/Makefile.PL.in, + smoke/qt/generate_makefile_am.pl, smoke/qt/tqt_smoke.h, + smoke/qt/tqtguess.pl.in, PerlTQt/MANIFEST, PerlTQt/Makefile.PL.in, PerlTQt/examples/richedit/imageCollection.pm, PerlTQt/examples/richedit/richedit.pl, kalyptus/Ast.pm, kalyptus/README, kalyptus/TODO, kalyptus/Version, kalyptus/Iter.pm, diff --git a/ChangeLog.CVS.delta b/ChangeLog.CVS.delta index 655108b..fb19954 100644 --- a/ChangeLog.CVS.delta +++ b/ChangeLog.CVS.delta @@ -234,7 +234,7 @@ 2003-08-28 02:10 germaingarand - * smoke/qt/generate.pl.in, smoke/qt/qt_smoke.h, kalyptus/kalyptus, + * smoke/qt/generate.pl.in, smoke/qt/tqt_smoke.h, kalyptus/kalyptus, kalyptus/kalyptusCxxToSmoke.pm, kalyptus/kalyptusDataDict.pm, kalyptus/kdocAstUtil.pm: @@ -284,7 +284,7 @@ 2003-08-14 18:44 germaingarand * PerlTQt/Makefile.PL.in, admin/acinclude.m4.in, - smoke/qt/qtguess.pl.in: + smoke/qt/tqtguess.pl.in: - nice patch by Marek Rouchal. Improves Solaris compatibility and static builds. Many thanks to him! @@ -689,7 +689,7 @@ 2003-02-19 13:44 germaingarand * smoke/qt/Makefile.am, smoke/qt/generate.pl.in, - smoke/qt/qtguess.pl.in, kalyptus/kalyptus, + smoke/qt/tqtguess.pl.in, kalyptus/kalyptus, kalyptus/kalyptusCxxToSmoke.pm: getting rid of GNU toolchain dependancy at last :) diff --git a/Makefile.am b/Makefile.am index 3c36633..dcd194e 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1,7 +1,7 @@ SUBDIRS = $(TOPSUBDIRS) -EXTRA_DIST = admin AUTHORS COPYING ChangeLog INSTALL README TODO Makefile.cvs test.pl Makefile.PL inst-apps smoke/smoke.h smoke/Makefile.in smoke/Makefile.am smoke/tqt/qtguess.pl.in smoke/tqt/generate.pl.in smoke/tqt/qt_smoke.h smoke/tqt/generate_makefile_am.pl smoke/tqt/Makefile.am smoke/tqt/Makefile.in smoke/tqt/header_list kalyptus/Ast.pm kalyptus/kalyptus kalyptus/kalyptusDataDict.pm kalyptus/kdocParseDoc.pm kalyptus/Version kalyptus/ChangeLog kalyptus/kdocUtil.pm kalyptus/kdocAstUtil.pm kalyptus/README kalyptus/Iter.pm kalyptus/kalyptusCxxToSmoke.pm kalyptus/kdocLib.pm kalyptus/TODO doc/en/index.html doc/en/Makefile doc/en/PerlTQt.pod doc/fr/index.html doc/fr/Makefile doc/fr/PerlTQt.pod doc/css/pod.css doc/images/ex1.png doc/images/ex2.png doc/images/ptqtsh.png +EXTRA_DIST = admin AUTHORS COPYING ChangeLog INSTALL README TODO Makefile.cvs test.pl Makefile.PL inst-apps smoke/smoke.h smoke/Makefile.in smoke/Makefile.am smoke/tqt/tqtguess.pl.in smoke/tqt/generate.pl.in smoke/tqt/tqt_smoke.h smoke/tqt/generate_makefile_am.pl smoke/tqt/Makefile.am smoke/tqt/Makefile.in smoke/tqt/header_list kalyptus/Ast.pm kalyptus/kalyptus kalyptus/kalyptusDataDict.pm kalyptus/kdocParseDoc.pm kalyptus/Version kalyptus/ChangeLog kalyptus/kdocUtil.pm kalyptus/kdocAstUtil.pm kalyptus/README kalyptus/Iter.pm kalyptus/kalyptusCxxToSmoke.pm kalyptus/kdocLib.pm kalyptus/TODO doc/en/index.html doc/en/Makefile doc/en/PerlTQt.pod doc/fr/index.html doc/fr/Makefile doc/fr/PerlTQt.pod doc/css/pod.css doc/images/ex1.png doc/images/ex2.png doc/images/ptqtsh.png # not a GNU package. You can remove this line, if # have all needed files, that a GNU package needs diff --git a/Makefile.in b/Makefile.in index 8c41bcf..f5fe3ab 100644 --- a/Makefile.in +++ b/Makefile.in @@ -196,7 +196,7 @@ x_libraries = @x_libraries@ SUBDIRS = $(TOPSUBDIRS) -EXTRA_DIST = admin AUTHORS COPYING ChangeLog INSTALL README TODO Makefile.cvs test.pl Makefile.PL inst-apps smoke/smoke.h smoke/Makefile.in smoke/Makefile.am smoke/tqt/qtguess.pl.in smoke/tqt/generate.pl.in smoke/tqt/qt_smoke.h smoke/tqt/generate_makefile_am.pl smoke/tqt/Makefile.am smoke/tqt/Makefile.in smoke/tqt/header_list kalyptus/Ast.pm kalyptus/kalyptus kalyptus/kalyptusDataDict.pm kalyptus/kdocParseDoc.pm kalyptus/Version kalyptus/ChangeLog kalyptus/kdocUtil.pm kalyptus/kdocAstUtil.pm kalyptus/README kalyptus/Iter.pm kalyptus/kalyptusCxxToSmoke.pm kalyptus/kdocLib.pm kalyptus/TODO doc/en/index.html doc/en/Makefile doc/en/PerlTQt.pod doc/fr/index.html doc/fr/Makefile doc/fr/PerlTQt.pod doc/css/pod.css doc/images/ex1.png doc/images/ex2.png doc/images/ptqtsh.png +EXTRA_DIST = admin AUTHORS COPYING ChangeLog INSTALL README TODO Makefile.cvs test.pl Makefile.PL inst-apps smoke/smoke.h smoke/Makefile.in smoke/Makefile.am smoke/tqt/tqtguess.pl.in smoke/tqt/generate.pl.in smoke/tqt/tqt_smoke.h smoke/tqt/generate_makefile_am.pl smoke/tqt/Makefile.am smoke/tqt/Makefile.in smoke/tqt/header_list kalyptus/Ast.pm kalyptus/kalyptus kalyptus/kalyptusDataDict.pm kalyptus/kdocParseDoc.pm kalyptus/Version kalyptus/ChangeLog kalyptus/kdocUtil.pm kalyptus/kdocAstUtil.pm kalyptus/README kalyptus/Iter.pm kalyptus/kalyptusCxxToSmoke.pm kalyptus/kdocLib.pm kalyptus/TODO doc/en/index.html doc/en/Makefile doc/en/PerlTQt.pod doc/fr/index.html doc/fr/Makefile doc/fr/PerlTQt.pod doc/css/pod.css doc/images/ex1.png doc/images/ex2.png doc/images/ptqtsh.png # not a GNU package. You can remove this line, if # have all needed files, that a GNU package needs diff --git a/PerlTQt/INSTALL b/PerlTQt/INSTALL index 056a10a..ab2c525 100644 --- a/PerlTQt/INSTALL +++ b/PerlTQt/INSTALL @@ -38,7 +38,7 @@ TQt-3.0.1, so I have to re-generate the files to match my installed version of TQt. Here's how to do it. $ cd smoke/tqt # tdebindings/smoke/tqt/ -$ perl ./qtguess.pl # simple script to find disabled TQt features +$ perl ./tqtguess.pl # simple script to find disabled TQt features $ perl ./generate.pl # calls kalyptus which generates code Now you have the SmokeTQt source-code generated for your personal TQt diff --git a/configure.in b/configure.in index 0aa33d3..a93f3a4 100644 --- a/configure.in +++ b/configure.in @@ -505,7 +505,7 @@ AC_SUBST(qt_test_threshold) if test "$HAVE_SMOKE" = "no" || test "$kde_force_smoke" != "no"; then - AC_CONFIG_FILES(smoke/tqt/qtguess.pl, [cd smoke/tqt && perl qtguess.pl && cd ../..] ) + AC_CONFIG_FILES(smoke/tqt/tqtguess.pl, [cd smoke/tqt && perl tqtguess.pl && cd ../..] ) AC_CONFIG_FILES(smoke/tqt/generate.pl, [cd smoke/tqt && perl generate.pl && cd ../..]) AC_CONFIG_FILES([smoke/Makefile]) AC_CONFIG_FILES([smoke/tqt/Makefile]) diff --git a/kalyptus/kalyptusCxxToSmoke.pm b/kalyptus/kalyptusCxxToSmoke.pm index fa3722d..c3f2ac5 100644 --- a/kalyptus/kalyptusCxxToSmoke.pm +++ b/kalyptus/kalyptusCxxToSmoke.pm @@ -2092,7 +2092,7 @@ sub writeSmokeDataFile($) { print OUT "\n"; print OUT "#include \n\n"; - print OUT "#include \n\n"; + print OUT "#include \n\n"; # gcc optimizes this method like crazy. switch() is godly print OUT "static void *${libname}_cast(void *xptr, Smoke::Index from, Smoke::Index to) {\n"; diff --git a/smoke/tqt/Makefile.am b/smoke/tqt/Makefile.am index 7454a91..df5d151 100644 --- a/smoke/tqt/Makefile.am +++ b/smoke/tqt/Makefile.am @@ -3,7 +3,7 @@ lib_LTLIBRARIES = libsmoketqt.la # set the include path for X, qt and KDE INCLUDES = -I$(srcdir)/.. $(all_includes) -EXTRA_DIST=generate.pl.in qtguess.pl.in qt_smoke.h Makefile.am Makefile.in +EXTRA_DIST=generate.pl.in tqtguess.pl.in tqt_smoke.h Makefile.am Makefile.in # the library search path. libsmoketqt_la_LDFLAGS = -version-info 3:1:2 -no-undefined $(all_libraries) $(GL_CFLAGS) $(KDE_RPATH) diff --git a/smoke/tqt/Makefile.in b/smoke/tqt/Makefile.in index 7e318af..9250157 100644 --- a/smoke/tqt/Makefile.in +++ b/smoke/tqt/Makefile.in @@ -198,7 +198,7 @@ lib_LTLIBRARIES = libsmoketqt.la # set the include path for X, qt and KDE INCLUDES = -I$(srcdir)/.. $(all_includes) -EXTRA_DIST = generate.pl.in qtguess.pl.in qt_smoke.h Makefile.am Makefile.in +EXTRA_DIST = generate.pl.in tqtguess.pl.in tqt_smoke.h Makefile.am Makefile.in # the library search path. #>- libsmoketqt_la_LDFLAGS = -version-info 3:1:2 -no-undefined $(all_libraries) $(GL_CFLAGS) $(KDE_RPATH) @@ -216,7 +216,7 @@ libsmoketqt_la_SOURCES = smokedata.cpp x_1.cpp x_2.cpp x_3.cpp x_4.cpp x_5.cpp x subdir = smoke/tqt mkinstalldirs = $(SHELL) $(top_srcdir)/admin/mkinstalldirs CONFIG_HEADER = $(top_builddir)/config.h -CONFIG_CLEAN_FILES = qtguess.pl generate.pl +CONFIG_CLEAN_FILES = tqtguess.pl generate.pl LTLIBRARIES = $(lib_LTLIBRARIES) libsmoketqt_la_DEPENDENCIES = @@ -289,7 +289,7 @@ CXXLD = $(CXX) CXXLINK = $(LIBTOOL) --mode=link --tag=CXX $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(KDE_CXXFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ DIST_SOURCES = $(libsmoketqt_la_SOURCES) -DIST_COMMON = Makefile.am Makefile.in generate.pl.in qtguess.pl.in +DIST_COMMON = Makefile.am Makefile.in generate.pl.in tqtguess.pl.in SOURCES = $(libsmoketqt_la_SOURCES) #>- all: all-am @@ -307,7 +307,7 @@ $(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) cd $(top_srcdir) && perl admin/am_edit PerlTQt-3.008/smoke/tqt/Makefile.in Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe) -qtguess.pl: $(top_builddir)/config.status qtguess.pl.in +tqtguess.pl: $(top_builddir)/config.status tqtguess.pl.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ generate.pl: $(top_builddir)/config.status generate.pl.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ diff --git a/smoke/tqt/qt_smoke.h b/smoke/tqt/qt_smoke.h deleted file mode 100644 index 3ca29df..0000000 --- a/smoke/tqt/qt_smoke.h +++ /dev/null @@ -1,9 +0,0 @@ -#ifndef TQT_SMOKE_H -#define TQT_SMOKE_H - -// Defined in smokedata.cpp, initialized by init_qt_Smoke(), used by all .cpp files -extern Smoke* qt_Smoke; - -class TQGlobalSpace { }; - -#endif diff --git a/smoke/tqt/qtguess.pl.in b/smoke/tqt/qtguess.pl.in deleted file mode 100644 index 1ebe87b..0000000 --- a/smoke/tqt/qtguess.pl.in +++ /dev/null @@ -1,501 +0,0 @@ -#!/usr/bin/perl - -# qtguess.pl : check how TQt was compiled. Issue a list of all defined TQT_NO_* macros, one per line. -# -# author: germain Garand -# licence: GPL v.2 - -# options: -q: be quieter -# -o file: redirect output to "file". (default: ./qtdefines) -# -t [0..15]: set the testing threshold (see below) -# -f "flags": additional compiler flags/parameters - -use Getopt::Std; - -use vars qw/$opt_f $opt_o $opt_p/; - -getopts('qo:f:t:'); - -# Threshold : -# 0 - test basic TQt types/classes -# 5 - test higher level, non-gui classes -# 8 - test options of the above (ex: TQT_NO_IMAGE_SMOOTHSCALE) -# 10 - test basic widgets -# 12 - test composite widgets -# 13 - test widgets inheriting composite widgets -# 15 - test goodies (default) - -my $default_threshold = @qt_test_threshold@; -my $cc = "@CXX@"; -my $ccflags = $opt_f || "@CXXFLAGS@"; - -my $nspaces = 50; - -my %qtdefs=(); -my %qtundefs=(); - -my $tmp = gettmpfile(); -my $qtinc = '@tqt_includes@'; -my $allinc = '@all_includes@'; -my $alllib = '@all_libraries@'; -my $qtflags ='@LIB_TQT@'; -my %x; -$x{'LIBPNG'} = '@LIBPNG@'; -$x{'LIBJPEG'} = '@LIBJPEG@'; -$x{'LIBSM'} = '@LIBSM@'; -$x{'LIBSOCKET'} = '@LIBSOCKET@'; -$x{'LIBDL'} = '@LIBDL@'; -$x{'LIBRESOLV'} = '@LIBRESOLV@'; -$x{'LIB_X11'} = '@LIB_X11@'; -$x{'X_PRE_LIBS'} = '@X_PRE_LIBS@'; -$x{'LIB_X11'} =~ s/\$\((.*?)\)/$x{$1}/g; - -$qtflags =~ s/\$\((.*?)\)/$x{$1}/g; - - -e "$qtinc/ntqglobal.h" or die "Invalid TQt directory.\n"; - -my $ccmd = "$cc $ccflags $allinc $alllib -o $tmp $tmp.cpp $qtflags"; - -my $threshold = defined($opt_t)?$opt_t : $default_threshold; -$threshold >= 0 or die "invalid testing threshold: $threshold\n"; - -print "Checking how TQt was built... \n"; -print "Threshold is set to $threshold\n" unless $opt_q; - -my($count, $used, $total); -map{ $tests{$_}->[2]>=$threshold ? ($used++, $total++):$total++ } keys %tests; - -print "Number of defines to be tested : $used/$total\n\n" unless $opt_q; -open( TQTDEFS, ">".($opt_o || "ntqtdefines") ) or die "Can't open output file: $!\n"; - -grab_qglobal_symbols(); -preliminary_test(); -perform_all_tests(); - -print +scalar(keys %qtdefs) . " defines found.\n"; - -print TQTDEFS join("\n", keys %qtdefs), "\n"; -close; - -#--------------------------------------------------------------# - -sub gettmpfile -{ - my $tmpdir = $ENV{'TMP'} || "."; - my $tmpname = $$."-qtguess"; - while( -e "$tmpdir/$tmpname" || -e "$tmpdir/${tmpname}.cpp" ) - { - $tmpname .= int (rand * 9); - } - return "$tmpdir/$tmpname"; -} - -#--------------------------------------------------------------# - -sub grab_qglobal_symbols -{ - my $cmd = "$cc -E -D__cplusplus -dM -I$qtinc $qtinc/ntqglobal.h 2>/dev/null"; - my $symbols = `$cmd`; - for(0..1) - { - if( check_exit_status($?) ) - { - while( $symbols =~/^#\s*define\s*(TQT_\S+)/gm ) - { - $qtdefs{$1} = 1; - } - print "Found ". scalar( keys %qtdefs )." predefined symbol".((scalar( keys %qtdefs ) -1)?"s":"")." in qglobal.h\n" unless ($opt_q or !(keys %qtdefs)); - while( $symbols =~/^#\s*define\s*TQT_MODULE_(\S+)/gm ) - { - $qtundefs{"TQT_NO_$1"} = 1; - } - print "Found ". scalar( keys %qtundefs )." undefined symbol".((scalar( keys %qtundefs ) -1)?"s":"")." in qglobal.h\n" unless ($opt_q or !(keys %qtundefs)); - last; - } - elsif(! $_) # first try - { - print "Failed to run $cmd.\nTrying without __cplusplus (might be already defined)\n"; - $cmd = "$cc -E -dM -I$qtinc $qtinc/ntqglobal.h 2>/dev/null"; - $symbols = `$cmd`; - next; - } - } -} - -#--------------------------------------------------------------# - -sub preliminary_test -{ - my $msg = "Trying to compile and link a small program..."; - print $msg, " " x ($nspaces - length($msg) + 8); - open( OUT, ">${tmp}.cpp" ) or die "Failed to open temp file ${tmp}.cpp: $!\n"; - my $simple=q£ - #include - int main( int argc, char **argv ) - { - TQApplication foo( argc, argv ); - return 0; - } - £; - print OUT $simple; - close OUT; - my $out = `$ccmd 2>&1`; - if( !check_exit_status($?) ) - { - die <<"EOF"; - -FAILED : check your configuration. -Failed program was: -$simple -Compiled with: -$ccmd -Compiler output: -$out -EOF - } - else - { - print "OK\n"; - } -} - -#--------------------------------------------------------------# - -sub perform_all_tests -{ - foreach ( sort { $tests{$a}->[2] <=> $tests{$b}->[2]} keys %tests) - { - $tests{$_}->[2] < $threshold and next; - ($qtdefs{$_} || $qtundefs{$_}) and do - { - print "\rSkipping $_ (in ntqglobal.h)".( " " x (($nspaces-16) - length($_)) ).($qtundefs{$_}?"*Undefined*":" [Defined]").($opt_q?"":"\n"); - next - }; - print "\rTesting $_".( " " x ($nspaces - length($_)) ); - open( OUT, ">${tmp}.cpp" ) or die "Failed to open temp file ${tmp}.cpp: $!\n"; - foreach $def(keys %qtdefs) - { - print OUT "#define $def\n"; - } - foreach $inc(split /,\s*/, $tests{$_}->[0]) - { - print OUT "#include <$inc>\n"; - } - print OUT "#include \n"; - print OUT $tests{$_}->[3] if $tests{$_}->[3]; # need to define some classes ? - print OUT qq£ - - int main( int argc, char **argv ) - { - $tests{$_}->[1] - return 0; - } - £; - close OUT; - - my $out = `$ccmd 2>&1`; - - my $ok = check_exit_status($?); - if( !$ok ) - { - $qtdefs{$_} = 1; - } - print +$opt_q ? ++$count."/$used" : ( $ok ? "*Undefined*\n" : " [Defined]\n" ); - } - $opt_q && print "\n"; -} - -#--------------------------------------------------------------# - -sub check_exit_status -{ - my $a = 0xFFFF & shift; - if( !$a ) - { - return 1; - } - elsif( $a == 0xFF00 ) - { - die "\nSystem call failed: $!\n"; - } - elsif( $a > 0x80 ) - { - # non-zero status. - } - else - { - if( $a & 0x80 ) - { - die "\n$cc coredumped with signal ". ($a & ~0x80); - } - die "\n$cc interrupted by signal $a\n"; - } - return 0; -} - -#--------------------------------------------------------------# - -END -{ - unlink $tmp if -e $tmp; - unlink "${tmp}.cpp" if -e "${tmp}.cpp"; -} - -#--------------------------------------------------------------# - -BEGIN { - -# "DEFINE" => ["header-1.h,... header-n.h", "main() code", priority, "Definitions (if needed)"] - -our %tests = ( - "TQT_NO_ACCEL" => ["ntqaccel.h", "TQAccel foo( (TQWidget*)NULL );", 5], - "TQT_NO_ACTION" => ["ntqaction.h", "TQAction foo( (TQObject*)NULL );", 5], - "TQT_NO_ASYNC_IO" => ["ntqasyncio.h", "TQAsyncIO foo();", 5], - "TQT_NO_ASYNC_IMAGE_IO"=> ["ntqasyncimageio.h", "TQImageDecoder foo( (TQImageConsumer*) NULL );", 5], - "TQT_NO_BIG_CODECS" => ["ntqbig5codec.h", "TQBig5Codec foo();", 5], - "TQT_NO_BUTTON" => ["ntqbutton.h", "TQButton foo( (TQWidget*)NULL );", 10], - "TQT_NO_BUTTONGROUP" => ["ntqbuttongroup.h", "TQButtonGroup foo( (TQWidget*)NULL );", 12], - "TQT_NO_CANVAS" => ["ntqcanvas.h", "TQCanvas foo( (TQObject*)NULL );", 10], - "TQT_NO_CHECKBOX" => ["ntqcheckbox.h", "TQCheckBox( (TQWidget*)NULL );", 10], - "TQT_NO_CLIPBOARD" => ["ntqapplication.h, qclipboard.h", q£ - TQApplication foo( argc, argv ); - TQClipboard *baz= foo.clipboard(); - £, 5], - "TQT_NO_COLORDIALOG" => ["ntqcolordialog.h", "TQColorDialog::customCount();", 12], - "TQT_NO_COMBOBOX" => ["ntqcombobox.h", "TQComboBox( (TQWidget*)NULL );", 10], - "TQT_NO_COMPAT" => ["ntqfontmetrics.h", q£ - TQFontMetrics *foo= new TQFontMetrics( TQFont() ); - int bar = foo->width( 'c' ); - £, 0], - "TQT_NO_COMPONENT" => ["ntqapplication.h", q£ - TQApplication foo( argc, argv ); - foo.addLibraryPath( TQString::null ); - £, 5], - "TQT_NO_CURSOR" => ["ntqcursor.h", "TQCursor foo;", 5], - "TQT_NO_DATASTREAM" => ["ntqdatastream.h", "TQDataStream foo;", 5], - "TQT_NO_DATETIMEEDIT" => ["ntqdatetimeedit.h", "TQTimeEdit foo;", 12], - "TQT_NO_DIAL" => ["ntqdial.h", "TQDial foo;", 10], - "TQT_NO_DIALOG" => ["ntqdialog.h", "TQDialog foo;", 12], - "TQT_NO_DIR" => ["ntqdir.h", "TQDir foo;", 5], - "TQT_NO_DNS" => ["ntqdns.h", "TQDns foo;", 5], - "TQT_NO_DOM" => ["ntqdom.h", "TQDomDocumentType foo;", 5], - "TQT_NO_DRAGANDDROP" => ["ntqevent.h", "TQDropEvent foo( TQPoint(1,1) );", 5], - "TQT_NO_DRAWUTIL" => ["ntqdrawutil.h, qcolor.h", "ntqDrawPlainRect( (TQPainter *) NULL, 0, 0, 0, 0, TQColor() );", 10], - "TQT_NO_ERRORMESSAGE" => ["ntqerrormessage.h", "TQErrorMessage foo( (TQWidget*) NULL );", 13], - "TQT_NO_FILEDIALOG" => ["ntqfiledialog.h", "TQFileIconProvider foo;", 13], - - "TQT_NO_FONTDATABASE" => ["ntqfontdatabase.h", "TQFontDatabase foo;", 5], - "TQT_NO_FONTDIALOG" => ["ntqfontdialog.h", "TQFontDialog::getFont( (bool *)NULL );", 12], - "TQT_NO_FRAME" => ["ntqframe.h", "TQFrame foo;", 10], - "TQT_NO_GRID" => ["ntqgrid.h", "TQGrid foo(5);", 12], - "TQT_NO_GRIDVIEW" => ["ntqgridview.h", "TQFoo foo;", 13, q£ - class TQFoo: public TQGridView - { - public: - TQFoo(){}; - ~TQFoo(){}; - void paintCell(TQPainter *, int, int){}; - }; - £], - "TQT_NO_GROUPBOX" => ["ntqgroupbox.h", "TQGroupBox foo;", 12], - "TQT_NO_HBOX" => ["ntqhbox.h", "TQHBox foo;", 12], - "TQT_NO_HBUTTONGROUP" => ["ntqhbuttongroup.h", "TQHButtonGroup foo;", 13], - "TQT_NO_HEADER" => ["ntqheader.h", "TQHeader foo;", 10], - "TQT_NO_HGROUPBOX" => ["ntqhgroupbox.h", "TQHGroupBox foo;", 13], - "TQT_NO_ICONSET" => ["ntqiconset.h", "TQIconSet foo;", 8], - - "TQT_NO_ICONVIEW" => ["ntqiconview.h", "TQIconView foo;", 13], - "TQT_NO_IMAGEFORMATPLUGIN" => ["ntqimageformatplugin.h, qstringlist.h", "TQFoo foo;", 5, q£ - - class TQFoo: public TQImageFormatPlugin - { - public: - TQFoo() {}; - ~TQFoo() {}; - TQStringList keys() const { return TQStringList(); }; - bool installIOHandler( const TQString &format ) { return true; }; - }; - TQ_EXPORT_PLUGIN( TQFoo ) - £], - "TQT_NO_IMAGE_DITHER_TO_1" => ["ntqimage.h", q£ - TQImage *foo = new TQImage; - foo->createAlphaMask(); - £, 8], - "TQT_NO_IMAGE_HEURISTIC_MASK" => ["ntqimage.h", q£ - TQImage *foo = new TQImage; - foo->createHeuristicMask(); - £, 8], - "TQT_NO_IMAGE_MIRROR" => ["ntqimage.h", q£ - TQImage *foo = new TQImage; - foo->mirror(); - £, 8], - "TQT_NO_IMAGE_SMOOTHSCALE" => ["ntqimage.h", q£ - TQImage *foo = new TQImage; - foo->smoothScale( 10, 10); - £, 8], - "TQT_NO_IMAGE_TEXT" => ["ntqimage.h", "TQImageTextKeyLang foo;", 8], - "TQT_NO_IMAGE_TRANSFORMATION" => ["ntqimage.h", q£ - TQImage *foo = new TQImage; - foo->scale( 10, 10); - £, 8], - "TQT_NO_IMAGE_TRUECOLOR" => ["ntqimage.h", q£ - TQImage *foo = new TQImage; - foo->convertDepthWithPalette( 1, (TQRgb*) NULL, 1 ); - £, 8], - "TQT_NO_INPUTDIALOG" => ["ntqinputdialog.h, qstring.h", q£TQInputDialog::getText( TQString::null, TQString::null);£, 13], - "TQT_NO_IMAGEIO" => ["ntqbitmap.h, qstring.h", q£ - TQBitmap foo( TQString::fromLatin1("foobar") ); - £, 5], - "TQT_NO_IMAGEIO_JPEG" => ["ntqjpegio.h", "ntqInitJpegIO();", 8], - "TQT_NO_IMAGEIO_MNG" => ["ntqmngio.h", "ntqInitMngIO();", 8], - "TQT_NO_IMAGEIO_PNG" => ["ntqpngio.h", "ntqInitPngIO();", 8], - "TQT_NO_LABEL" => ["ntqlabel.h", "TQLabel foo( (TQWidget*) NULL );", 10], - "TQT_NO_LAYOUT" => ["ntqlayout.h", "TQFoo foo;", 10, q£ - - class TQFoo: public TQLayout - { - public: - TQFoo() {}; - ~TQFoo() {}; - void addItem( TQLayoutItem * ) { }; - TQSize sizeHint() const { return TQSize(); } - TQLayoutIterator iterator() { return TQLayoutIterator( (TQGLayoutIterator *) NULL ); }; - void setGeometry( const TQRect & ) { }; - }; - £], - "TQT_NO_LCDNUMBER" => ["ntqlcdnumber.h", "TQLCDNumber foo;", 12], - "TQT_NO_LINEEDIT" => ["ntqlineedit.h", "TQLineEdit foo( (TQWidget *) NULL );", 12], - "TQT_NO_LISTBOX" => ["ntqlistbox.h", "TQListBox foo;", 13], - "TQT_NO_LISTVIEW" => ["ntqlistview.h", "TQListView foo;", 13], - "TQT_NO_MAINWINDOW" => ["ntqmainwindow.h", "TQMainWindow foo;", 13], - "TQT_NO_MENUBAR" => ["ntqmenubar.h", "TQMenuBar foo;", 13], - "TQT_NO_MOVIE" => ["ntqmovie.h", "TQMovie foo;", 5], - "TQT_NO_MENUDATA" => ["ntqmenudata.h", "TQMenuData foo;", 9], - "TQT_NO_MESSAGEBOX" => ["ntqmessagebox.h", "TQMessageBox foo;", 13], - "TQT_NO_MIME" => ["ntqmime.h", "TQMimeSourceFactory foo;", 5], - "TQT_NO_MIMECLIPBOARD" => ["ntqapplication.h, qclipboard.h", q£ - TQApplication foo( argc, argv ); - TQClipboard *baz= foo.clipboard(); - baz->data(); - £, 8], - - "TQT_NO_MULTILINEEDIT" => ["ntqmultilineedit.h", "TQMultiLineEdit foo;", 14], - "TQT_NO_NETWORK" => ["ntqnetwork.h", "ntqInitNetworkProtocols();", 5], - "TQT_NO_NETWORKPROTOCOL" => ["ntqnetworkprotocol.h", "TQNetworkProtocol foo;", 8], - "TQT_NO_NETWORKPROTOCOL_FTP" => ["ntqftp.h", "TQFtp foo;", 9], - "TQT_NO_PALETTE" => ["ntqpalette.h", "TQColorGroup foo;", 5], - "TQT_NO_PICTURE" => ["ntqpicture.h", "TQPicture foo;", 5], - "TQT_NO_PIXMAP_TRANSFORMATION" =>["ntqbitmap.h, qwmatrix.h", q£ - TQBitmap *foo= new TQBitmap(); - TQWMatrix bar; - foo->xForm( bar ); - £, 5], - "TQT_NO_POPUPMENU" => ["ntqpopupmenu.h", "TQPopupMenu foo;", 12], - "TQT_NO_PRINTER" => ["ntqprinter.h", "TQPrinter foo;", 5], - "TQT_NO_PRINTDIALOG" => ["ntqprintdialog.h", "TQPrintDialog foo( (TQPrinter*) NULL );", 13], - "TQT_NO_PROCESS" => ["ntqprocess.h", "TQProcess foo;", 5], - "TQT_NO_PROGRESSBAR" => ["ntqprogressbar.h", "TQProgressBar foo;", 12], - "TQT_NO_PROGRESSDIALOG" => ["ntqprogressdialog.h", "TQProgressDialog foo;", 13], - "TQT_NO_PUSHBUTTON" => ["ntqpushbutton.h", "TQPushButton foo( (TQWidget *) NULL );", 12], - "TQT_NO_PROPERTIES" => ["ntqmetaobject.h", "TQMetaProperty foo;", 0], -# "TQT_NO_TQTMULTILINEEDIT" => ["ntqtmultilineedit.h", "TQtMultiLineEdit foo;", 15], -# "TQT_NO_TQTTABLEVIEW" => ["ntqttableview.h", "TQFoo foo;", 16, q£ -# class TQFoo: public TQtTableView -# { -# public: -# TQFoo() {}; -# ~TQFoo() {}; -# void paintCell( TQPainter *, int, int) {}; -# }; -# £], - "TQT_NO_TQUUID_STRING" => ["ntquuid.h", "TQUuid foo( TQString::null );", 8], - "TQT_NO_RANGECONTROL" => ["ntqrangecontrol.h", "TQRangeControl foo;", 10], - "TQT_NO_REGEXP" => ["ntqregexp.h", "TQRegExp foo;", 5], - "TQT_NO_REGEXP_WILDCARD" => ["ntqregexp.h", q£ - TQRegExp foo; - foo.wildcard(); - £, 8], - "TQT_NO_REMOTE" => ["ntqapplication.h", q£ - TQApplication foo( argc, argv ); - foo.remoteControlEnabled(); - £, 15], - "TQT_NO_RADIOBUTTON" => ["ntqradiobutton.h", "TQRadioButton foo( (TQWidget *) NULL );", 12], - "TQT_NO_RICHTEXT" => ["ntqsimplerichtext.h, qstring.h, qfont.h", "TQSimpleRichText foo( TQString::null, TQFont() );", 10], - "TQT_NO_SCROLLBAR" => ["ntqscrollbar.h", "TQScrollBar foo( (TQWidget *) NULL );", 12], - "TQT_NO_SCROLLVIEW" => ["ntqscrollview.h", "TQScrollView foo;", 12], - "TQT_NO_SEMIMODAL" => ["ntqsemimodal.h", "TQSemiModal foo;", 10], - "TQT_NO_SESSIONMANAGER" => ["ntqapplication.h", q£ - TQApplication foo( argc, argv ); - foo.sessionId(); - £, 15], - "TQT_NO_SETTINGS" => ["ntqsettings.h", "TQSettings foo;", 5], - "TQT_NO_SIGNALMAPPER" => ["ntqsignalmapper.h", "TQSignalMapper foo( (TQObject *) NULL );", 0], - "TQT_NO_SIZEGRIP" => ["ntqsizegrip.h", "TQSizeGrip foo( (TQWidget *) NULL );", 10], - "TQT_NO_SLIDER" => ["ntqslider.h", "TQSlider foo( (TQWidget *) NULL );", 12], - "TQT_NO_SOUND" => ["ntqsound.h", "TQSound foo( TQString::null );", 5], - - - "TQT_NO_SPINWIDGET" => ["ntqrangecontrol.h", "TQSpinWidget foo;", 10], - "TQT_NO_SPRINTF" => ["ntqcolor.h", q£ - TQColor foo; - foo.name(); - £, 0], - - - - "TQT_NO_SQL" => ["ntqsqlcursor.h", "TQSqlCursor foo;", 5], - "TQT_NO_STRINGLIST" => ["ntqstringlist.h", "TQStringList foo;", 0], - "TQT_NO_STYLE" => ["ntqapplication.h", q£ - TQApplication foo( argc, argv ); - foo.style(); - £, 15], - -# "TQT_NO_STYLE_CDE" => ["ntqcdestyle.h", "TQCDEStyle foo;", 16], -# "TQT_NO_STYLE_COMPACT" => ["ntqcompactstyle.h", "TQCompactStyle foo;", 16], -# "TQT_NO_STYLE_INTERLACE" => ["ntqinterlacestyle.h", "TQInterlaceStyle foo;", 16], -# "TQT_NO_STYLE_PLATINUM" => ["ntqplatinumstyle.h", "TQPlatinumStyle foo;", 16], -# "TQT_NO_STYLE_MOTIF" => ["ntqmotifstyle.h", "TQMotifStyle foo;", 16], -# "TQT_NO_STYLE_MOTIFPLUS" => ["ntqmotifplusstyle.h", "TQMotifPlusStyle foo;", 16], -# "TQT_NO_STYLE_SGI" => ["ntqsgistyle.h", "TQSGIStyle foo;", 16], -# "TQT_NO_STYLE_WINDOWS" => ["ntqwindowsstyle.h", "TQWindowsStyle foo;", 16], - "TQT_NO_TABBAR" => ["ntqtabbar.h", "TQTabBar foo;", 10], - "TQT_NO_TABDIALOG" => ["ntqtabdialog.h", "TQTabDialog foo;", 12], - "TQT_NO_TABLE" => ["ntqtable.h", "TQTable foo;", 10], - "TQT_NO_TABWIDGET" => ["ntqtabwidget.h", "TQTabWidget foo;", 10], - "TQT_NO_TEXTBROWSER" => ["ntqtextbrowser.h", "TQTextBrowser foo;", 14], - "TQT_NO_TEXTCODEC" => ["ntqtextcodec.h", "TQTextCodec::codecForIndex(1);", 5], - "TQT_NO_TEXTCODECPLUGIN" => ["ntqtextcodecplugin.h, qstringlist.h, qvaluelist.h, qtextcodec.h", "TQFoo foo;", 6, q£ - - class TQFoo: public TQTextCodecPlugin - { - public: - TQFoo() {}; - ~TQFoo() {}; - TQStringList names() const {return TQStringList();} - TQValueListmibEnums() const {return TQValueList();} - TQTextCodec *createForName( const TQString & name ) {return (TQTextCodec *)NULL;} - TQTextCodec *createForMib( int mib ) {return (TQTextCodec *)NULL;} - }; - TQ_EXPORT_PLUGIN( TQFoo ) - £], - "TQT_NO_TEXTEDIT" => ["ntqtextedit.h", "TQTextEdit foo;", 13], - "TQT_NO_TEXTSTREAM" => ["ntqtextstream.h", "TQTextStream foo;", 5], - "TQT_NO_TEXTVIEW" => ["ntqtextview.h", "TQTextView foo;", 14], #Obsolete - "TQT_NO_TOOLBAR" => ["ntqtoolbar.h", "TQToolBar foo;", 10], - "TQT_NO_TOOLBUTTON" => ["ntqtoolbutton.h", "TQToolButton foo((TQWidget *) NULL );", 12], - "TQT_NO_TOOLTIP" => ["ntqtooltip.h", "TQToolTip::hide();", 10], - - "TQT_NO_TRANSFORMATIONS" => ["ntqpainter.h", q£ - TQPainter *foo= new TQPainter(); - foo->setViewXForm( true );£, 5], - "TQT_NO_VARIANT" => ["ntqvariant.h", "TQVariant foo;", 0], - "TQT_NO_WHATSTHIS" => ["ntqwhatsthis.h", "TQWhatsThis::inWhatsThisMode();", 10], - "TQT_NO_WHEELEVENT" => ["ntqevent.h", "TQWheelEvent foo( TQPoint(1,1), 1, 1 );", 5], - "TQT_NO_WIDGET_TOPEXTRA" => ["ntqwidget.h", "TQWidget foo; foo.caption();", 9], - "TQT_NO_WIDGETSTACK" => ["ntqwidgetstack.h", "TQWidgetStack foo;", 13], - "TQT_NO_WIZARD" => ["ntqwizard.h", "TQWizard foo;", 13], - "TQT_NO_WMATRIX" => ["ntqwmatrix.h", "TQWMatrix foo;", 0], - "TQT_NO_XML" => ["ntqxml.h", "TQXmlNamespaceSupport foo;", 5], - ); - -} diff --git a/smoke/tqt/tqt_smoke.h b/smoke/tqt/tqt_smoke.h new file mode 100644 index 0000000..3ca29df --- /dev/null +++ b/smoke/tqt/tqt_smoke.h @@ -0,0 +1,9 @@ +#ifndef TQT_SMOKE_H +#define TQT_SMOKE_H + +// Defined in smokedata.cpp, initialized by init_qt_Smoke(), used by all .cpp files +extern Smoke* qt_Smoke; + +class TQGlobalSpace { }; + +#endif diff --git a/smoke/tqt/tqtguess.pl.in b/smoke/tqt/tqtguess.pl.in new file mode 100644 index 0000000..c4758c1 --- /dev/null +++ b/smoke/tqt/tqtguess.pl.in @@ -0,0 +1,501 @@ +#!/usr/bin/perl + +# tqtguess.pl : check how TQt was compiled. Issue a list of all defined TQT_NO_* macros, one per line. +# +# author: germain Garand +# licence: GPL v.2 + +# options: -q: be quieter +# -o file: redirect output to "file". (default: ./qtdefines) +# -t [0..15]: set the testing threshold (see below) +# -f "flags": additional compiler flags/parameters + +use Getopt::Std; + +use vars qw/$opt_f $opt_o $opt_p/; + +getopts('qo:f:t:'); + +# Threshold : +# 0 - test basic TQt types/classes +# 5 - test higher level, non-gui classes +# 8 - test options of the above (ex: TQT_NO_IMAGE_SMOOTHSCALE) +# 10 - test basic widgets +# 12 - test composite widgets +# 13 - test widgets inheriting composite widgets +# 15 - test goodies (default) + +my $default_threshold = @qt_test_threshold@; +my $cc = "@CXX@"; +my $ccflags = $opt_f || "@CXXFLAGS@"; + +my $nspaces = 50; + +my %qtdefs=(); +my %qtundefs=(); + +my $tmp = gettmpfile(); +my $qtinc = '@tqt_includes@'; +my $allinc = '@all_includes@'; +my $alllib = '@all_libraries@'; +my $qtflags ='@LIB_TQT@'; +my %x; +$x{'LIBPNG'} = '@LIBPNG@'; +$x{'LIBJPEG'} = '@LIBJPEG@'; +$x{'LIBSM'} = '@LIBSM@'; +$x{'LIBSOCKET'} = '@LIBSOCKET@'; +$x{'LIBDL'} = '@LIBDL@'; +$x{'LIBRESOLV'} = '@LIBRESOLV@'; +$x{'LIB_X11'} = '@LIB_X11@'; +$x{'X_PRE_LIBS'} = '@X_PRE_LIBS@'; +$x{'LIB_X11'} =~ s/\$\((.*?)\)/$x{$1}/g; + +$qtflags =~ s/\$\((.*?)\)/$x{$1}/g; + + -e "$qtinc/ntqglobal.h" or die "Invalid TQt directory.\n"; + +my $ccmd = "$cc $ccflags $allinc $alllib -o $tmp $tmp.cpp $qtflags"; + +my $threshold = defined($opt_t)?$opt_t : $default_threshold; +$threshold >= 0 or die "invalid testing threshold: $threshold\n"; + +print "Checking how TQt was built... \n"; +print "Threshold is set to $threshold\n" unless $opt_q; + +my($count, $used, $total); +map{ $tests{$_}->[2]>=$threshold ? ($used++, $total++):$total++ } keys %tests; + +print "Number of defines to be tested : $used/$total\n\n" unless $opt_q; +open( TQTDEFS, ">".($opt_o || "ntqtdefines") ) or die "Can't open output file: $!\n"; + +grab_qglobal_symbols(); +preliminary_test(); +perform_all_tests(); + +print +scalar(keys %qtdefs) . " defines found.\n"; + +print TQTDEFS join("\n", keys %qtdefs), "\n"; +close; + +#--------------------------------------------------------------# + +sub gettmpfile +{ + my $tmpdir = $ENV{'TMP'} || "."; + my $tmpname = $$."-qtguess"; + while( -e "$tmpdir/$tmpname" || -e "$tmpdir/${tmpname}.cpp" ) + { + $tmpname .= int (rand * 9); + } + return "$tmpdir/$tmpname"; +} + +#--------------------------------------------------------------# + +sub grab_qglobal_symbols +{ + my $cmd = "$cc -E -D__cplusplus -dM -I$qtinc $qtinc/ntqglobal.h 2>/dev/null"; + my $symbols = `$cmd`; + for(0..1) + { + if( check_exit_status($?) ) + { + while( $symbols =~/^#\s*define\s*(TQT_\S+)/gm ) + { + $qtdefs{$1} = 1; + } + print "Found ". scalar( keys %qtdefs )." predefined symbol".((scalar( keys %qtdefs ) -1)?"s":"")." in qglobal.h\n" unless ($opt_q or !(keys %qtdefs)); + while( $symbols =~/^#\s*define\s*TQT_MODULE_(\S+)/gm ) + { + $qtundefs{"TQT_NO_$1"} = 1; + } + print "Found ". scalar( keys %qtundefs )." undefined symbol".((scalar( keys %qtundefs ) -1)?"s":"")." in qglobal.h\n" unless ($opt_q or !(keys %qtundefs)); + last; + } + elsif(! $_) # first try + { + print "Failed to run $cmd.\nTrying without __cplusplus (might be already defined)\n"; + $cmd = "$cc -E -dM -I$qtinc $qtinc/ntqglobal.h 2>/dev/null"; + $symbols = `$cmd`; + next; + } + } +} + +#--------------------------------------------------------------# + +sub preliminary_test +{ + my $msg = "Trying to compile and link a small program..."; + print $msg, " " x ($nspaces - length($msg) + 8); + open( OUT, ">${tmp}.cpp" ) or die "Failed to open temp file ${tmp}.cpp: $!\n"; + my $simple=q£ + #include + int main( int argc, char **argv ) + { + TQApplication foo( argc, argv ); + return 0; + } + £; + print OUT $simple; + close OUT; + my $out = `$ccmd 2>&1`; + if( !check_exit_status($?) ) + { + die <<"EOF"; + +FAILED : check your configuration. +Failed program was: +$simple +Compiled with: +$ccmd +Compiler output: +$out +EOF + } + else + { + print "OK\n"; + } +} + +#--------------------------------------------------------------# + +sub perform_all_tests +{ + foreach ( sort { $tests{$a}->[2] <=> $tests{$b}->[2]} keys %tests) + { + $tests{$_}->[2] < $threshold and next; + ($qtdefs{$_} || $qtundefs{$_}) and do + { + print "\rSkipping $_ (in ntqglobal.h)".( " " x (($nspaces-16) - length($_)) ).($qtundefs{$_}?"*Undefined*":" [Defined]").($opt_q?"":"\n"); + next + }; + print "\rTesting $_".( " " x ($nspaces - length($_)) ); + open( OUT, ">${tmp}.cpp" ) or die "Failed to open temp file ${tmp}.cpp: $!\n"; + foreach $def(keys %qtdefs) + { + print OUT "#define $def\n"; + } + foreach $inc(split /,\s*/, $tests{$_}->[0]) + { + print OUT "#include <$inc>\n"; + } + print OUT "#include \n"; + print OUT $tests{$_}->[3] if $tests{$_}->[3]; # need to define some classes ? + print OUT qq£ + + int main( int argc, char **argv ) + { + $tests{$_}->[1] + return 0; + } + £; + close OUT; + + my $out = `$ccmd 2>&1`; + + my $ok = check_exit_status($?); + if( !$ok ) + { + $qtdefs{$_} = 1; + } + print +$opt_q ? ++$count."/$used" : ( $ok ? "*Undefined*\n" : " [Defined]\n" ); + } + $opt_q && print "\n"; +} + +#--------------------------------------------------------------# + +sub check_exit_status +{ + my $a = 0xFFFF & shift; + if( !$a ) + { + return 1; + } + elsif( $a == 0xFF00 ) + { + die "\nSystem call failed: $!\n"; + } + elsif( $a > 0x80 ) + { + # non-zero status. + } + else + { + if( $a & 0x80 ) + { + die "\n$cc coredumped with signal ". ($a & ~0x80); + } + die "\n$cc interrupted by signal $a\n"; + } + return 0; +} + +#--------------------------------------------------------------# + +END +{ + unlink $tmp if -e $tmp; + unlink "${tmp}.cpp" if -e "${tmp}.cpp"; +} + +#--------------------------------------------------------------# + +BEGIN { + +# "DEFINE" => ["header-1.h,... header-n.h", "main() code", priority, "Definitions (if needed)"] + +our %tests = ( + "TQT_NO_ACCEL" => ["ntqaccel.h", "TQAccel foo( (TQWidget*)NULL );", 5], + "TQT_NO_ACTION" => ["ntqaction.h", "TQAction foo( (TQObject*)NULL );", 5], + "TQT_NO_ASYNC_IO" => ["ntqasyncio.h", "TQAsyncIO foo();", 5], + "TQT_NO_ASYNC_IMAGE_IO"=> ["ntqasyncimageio.h", "TQImageDecoder foo( (TQImageConsumer*) NULL );", 5], + "TQT_NO_BIG_CODECS" => ["ntqbig5codec.h", "TQBig5Codec foo();", 5], + "TQT_NO_BUTTON" => ["ntqbutton.h", "TQButton foo( (TQWidget*)NULL );", 10], + "TQT_NO_BUTTONGROUP" => ["ntqbuttongroup.h", "TQButtonGroup foo( (TQWidget*)NULL );", 12], + "TQT_NO_CANVAS" => ["ntqcanvas.h", "TQCanvas foo( (TQObject*)NULL );", 10], + "TQT_NO_CHECKBOX" => ["ntqcheckbox.h", "TQCheckBox( (TQWidget*)NULL );", 10], + "TQT_NO_CLIPBOARD" => ["ntqapplication.h, qclipboard.h", q£ + TQApplication foo( argc, argv ); + TQClipboard *baz= foo.clipboard(); + £, 5], + "TQT_NO_COLORDIALOG" => ["ntqcolordialog.h", "TQColorDialog::customCount();", 12], + "TQT_NO_COMBOBOX" => ["ntqcombobox.h", "TQComboBox( (TQWidget*)NULL );", 10], + "TQT_NO_COMPAT" => ["ntqfontmetrics.h", q£ + TQFontMetrics *foo= new TQFontMetrics( TQFont() ); + int bar = foo->width( 'c' ); + £, 0], + "TQT_NO_COMPONENT" => ["ntqapplication.h", q£ + TQApplication foo( argc, argv ); + foo.addLibraryPath( TQString::null ); + £, 5], + "TQT_NO_CURSOR" => ["ntqcursor.h", "TQCursor foo;", 5], + "TQT_NO_DATASTREAM" => ["ntqdatastream.h", "TQDataStream foo;", 5], + "TQT_NO_DATETIMEEDIT" => ["ntqdatetimeedit.h", "TQTimeEdit foo;", 12], + "TQT_NO_DIAL" => ["ntqdial.h", "TQDial foo;", 10], + "TQT_NO_DIALOG" => ["ntqdialog.h", "TQDialog foo;", 12], + "TQT_NO_DIR" => ["ntqdir.h", "TQDir foo;", 5], + "TQT_NO_DNS" => ["ntqdns.h", "TQDns foo;", 5], + "TQT_NO_DOM" => ["ntqdom.h", "TQDomDocumentType foo;", 5], + "TQT_NO_DRAGANDDROP" => ["ntqevent.h", "TQDropEvent foo( TQPoint(1,1) );", 5], + "TQT_NO_DRAWUTIL" => ["ntqdrawutil.h, qcolor.h", "ntqDrawPlainRect( (TQPainter *) NULL, 0, 0, 0, 0, TQColor() );", 10], + "TQT_NO_ERRORMESSAGE" => ["ntqerrormessage.h", "TQErrorMessage foo( (TQWidget*) NULL );", 13], + "TQT_NO_FILEDIALOG" => ["ntqfiledialog.h", "TQFileIconProvider foo;", 13], + + "TQT_NO_FONTDATABASE" => ["ntqfontdatabase.h", "TQFontDatabase foo;", 5], + "TQT_NO_FONTDIALOG" => ["ntqfontdialog.h", "TQFontDialog::getFont( (bool *)NULL );", 12], + "TQT_NO_FRAME" => ["ntqframe.h", "TQFrame foo;", 10], + "TQT_NO_GRID" => ["ntqgrid.h", "TQGrid foo(5);", 12], + "TQT_NO_GRIDVIEW" => ["ntqgridview.h", "TQFoo foo;", 13, q£ + class TQFoo: public TQGridView + { + public: + TQFoo(){}; + ~TQFoo(){}; + void paintCell(TQPainter *, int, int){}; + }; + £], + "TQT_NO_GROUPBOX" => ["ntqgroupbox.h", "TQGroupBox foo;", 12], + "TQT_NO_HBOX" => ["ntqhbox.h", "TQHBox foo;", 12], + "TQT_NO_HBUTTONGROUP" => ["ntqhbuttongroup.h", "TQHButtonGroup foo;", 13], + "TQT_NO_HEADER" => ["ntqheader.h", "TQHeader foo;", 10], + "TQT_NO_HGROUPBOX" => ["ntqhgroupbox.h", "TQHGroupBox foo;", 13], + "TQT_NO_ICONSET" => ["ntqiconset.h", "TQIconSet foo;", 8], + + "TQT_NO_ICONVIEW" => ["ntqiconview.h", "TQIconView foo;", 13], + "TQT_NO_IMAGEFORMATPLUGIN" => ["ntqimageformatplugin.h, qstringlist.h", "TQFoo foo;", 5, q£ + + class TQFoo: public TQImageFormatPlugin + { + public: + TQFoo() {}; + ~TQFoo() {}; + TQStringList keys() const { return TQStringList(); }; + bool installIOHandler( const TQString &format ) { return true; }; + }; + TQ_EXPORT_PLUGIN( TQFoo ) + £], + "TQT_NO_IMAGE_DITHER_TO_1" => ["ntqimage.h", q£ + TQImage *foo = new TQImage; + foo->createAlphaMask(); + £, 8], + "TQT_NO_IMAGE_HEURISTIC_MASK" => ["ntqimage.h", q£ + TQImage *foo = new TQImage; + foo->createHeuristicMask(); + £, 8], + "TQT_NO_IMAGE_MIRROR" => ["ntqimage.h", q£ + TQImage *foo = new TQImage; + foo->mirror(); + £, 8], + "TQT_NO_IMAGE_SMOOTHSCALE" => ["ntqimage.h", q£ + TQImage *foo = new TQImage; + foo->smoothScale( 10, 10); + £, 8], + "TQT_NO_IMAGE_TEXT" => ["ntqimage.h", "TQImageTextKeyLang foo;", 8], + "TQT_NO_IMAGE_TRANSFORMATION" => ["ntqimage.h", q£ + TQImage *foo = new TQImage; + foo->scale( 10, 10); + £, 8], + "TQT_NO_IMAGE_TRUECOLOR" => ["ntqimage.h", q£ + TQImage *foo = new TQImage; + foo->convertDepthWithPalette( 1, (TQRgb*) NULL, 1 ); + £, 8], + "TQT_NO_INPUTDIALOG" => ["ntqinputdialog.h, qstring.h", q£TQInputDialog::getText( TQString::null, TQString::null);£, 13], + "TQT_NO_IMAGEIO" => ["ntqbitmap.h, qstring.h", q£ + TQBitmap foo( TQString::fromLatin1("foobar") ); + £, 5], + "TQT_NO_IMAGEIO_JPEG" => ["ntqjpegio.h", "ntqInitJpegIO();", 8], + "TQT_NO_IMAGEIO_MNG" => ["ntqmngio.h", "ntqInitMngIO();", 8], + "TQT_NO_IMAGEIO_PNG" => ["ntqpngio.h", "ntqInitPngIO();", 8], + "TQT_NO_LABEL" => ["ntqlabel.h", "TQLabel foo( (TQWidget*) NULL );", 10], + "TQT_NO_LAYOUT" => ["ntqlayout.h", "TQFoo foo;", 10, q£ + + class TQFoo: public TQLayout + { + public: + TQFoo() {}; + ~TQFoo() {}; + void addItem( TQLayoutItem * ) { }; + TQSize sizeHint() const { return TQSize(); } + TQLayoutIterator iterator() { return TQLayoutIterator( (TQGLayoutIterator *) NULL ); }; + void setGeometry( const TQRect & ) { }; + }; + £], + "TQT_NO_LCDNUMBER" => ["ntqlcdnumber.h", "TQLCDNumber foo;", 12], + "TQT_NO_LINEEDIT" => ["ntqlineedit.h", "TQLineEdit foo( (TQWidget *) NULL );", 12], + "TQT_NO_LISTBOX" => ["ntqlistbox.h", "TQListBox foo;", 13], + "TQT_NO_LISTVIEW" => ["ntqlistview.h", "TQListView foo;", 13], + "TQT_NO_MAINWINDOW" => ["ntqmainwindow.h", "TQMainWindow foo;", 13], + "TQT_NO_MENUBAR" => ["ntqmenubar.h", "TQMenuBar foo;", 13], + "TQT_NO_MOVIE" => ["ntqmovie.h", "TQMovie foo;", 5], + "TQT_NO_MENUDATA" => ["ntqmenudata.h", "TQMenuData foo;", 9], + "TQT_NO_MESSAGEBOX" => ["ntqmessagebox.h", "TQMessageBox foo;", 13], + "TQT_NO_MIME" => ["ntqmime.h", "TQMimeSourceFactory foo;", 5], + "TQT_NO_MIMECLIPBOARD" => ["ntqapplication.h, qclipboard.h", q£ + TQApplication foo( argc, argv ); + TQClipboard *baz= foo.clipboard(); + baz->data(); + £, 8], + + "TQT_NO_MULTILINEEDIT" => ["ntqmultilineedit.h", "TQMultiLineEdit foo;", 14], + "TQT_NO_NETWORK" => ["ntqnetwork.h", "ntqInitNetworkProtocols();", 5], + "TQT_NO_NETWORKPROTOCOL" => ["ntqnetworkprotocol.h", "TQNetworkProtocol foo;", 8], + "TQT_NO_NETWORKPROTOCOL_FTP" => ["ntqftp.h", "TQFtp foo;", 9], + "TQT_NO_PALETTE" => ["ntqpalette.h", "TQColorGroup foo;", 5], + "TQT_NO_PICTURE" => ["ntqpicture.h", "TQPicture foo;", 5], + "TQT_NO_PIXMAP_TRANSFORMATION" =>["ntqbitmap.h, qwmatrix.h", q£ + TQBitmap *foo= new TQBitmap(); + TQWMatrix bar; + foo->xForm( bar ); + £, 5], + "TQT_NO_POPUPMENU" => ["ntqpopupmenu.h", "TQPopupMenu foo;", 12], + "TQT_NO_PRINTER" => ["ntqprinter.h", "TQPrinter foo;", 5], + "TQT_NO_PRINTDIALOG" => ["ntqprintdialog.h", "TQPrintDialog foo( (TQPrinter*) NULL );", 13], + "TQT_NO_PROCESS" => ["ntqprocess.h", "TQProcess foo;", 5], + "TQT_NO_PROGRESSBAR" => ["ntqprogressbar.h", "TQProgressBar foo;", 12], + "TQT_NO_PROGRESSDIALOG" => ["ntqprogressdialog.h", "TQProgressDialog foo;", 13], + "TQT_NO_PUSHBUTTON" => ["ntqpushbutton.h", "TQPushButton foo( (TQWidget *) NULL );", 12], + "TQT_NO_PROPERTIES" => ["ntqmetaobject.h", "TQMetaProperty foo;", 0], +# "TQT_NO_TQTMULTILINEEDIT" => ["ntqtmultilineedit.h", "TQtMultiLineEdit foo;", 15], +# "TQT_NO_TQTTABLEVIEW" => ["ntqttableview.h", "TQFoo foo;", 16, q£ +# class TQFoo: public TQtTableView +# { +# public: +# TQFoo() {}; +# ~TQFoo() {}; +# void paintCell( TQPainter *, int, int) {}; +# }; +# £], + "TQT_NO_TQUUID_STRING" => ["ntquuid.h", "TQUuid foo( TQString::null );", 8], + "TQT_NO_RANGECONTROL" => ["ntqrangecontrol.h", "TQRangeControl foo;", 10], + "TQT_NO_REGEXP" => ["ntqregexp.h", "TQRegExp foo;", 5], + "TQT_NO_REGEXP_WILDCARD" => ["ntqregexp.h", q£ + TQRegExp foo; + foo.wildcard(); + £, 8], + "TQT_NO_REMOTE" => ["ntqapplication.h", q£ + TQApplication foo( argc, argv ); + foo.remoteControlEnabled(); + £, 15], + "TQT_NO_RADIOBUTTON" => ["ntqradiobutton.h", "TQRadioButton foo( (TQWidget *) NULL );", 12], + "TQT_NO_RICHTEXT" => ["ntqsimplerichtext.h, qstring.h, qfont.h", "TQSimpleRichText foo( TQString::null, TQFont() );", 10], + "TQT_NO_SCROLLBAR" => ["ntqscrollbar.h", "TQScrollBar foo( (TQWidget *) NULL );", 12], + "TQT_NO_SCROLLVIEW" => ["ntqscrollview.h", "TQScrollView foo;", 12], + "TQT_NO_SEMIMODAL" => ["ntqsemimodal.h", "TQSemiModal foo;", 10], + "TQT_NO_SESSIONMANAGER" => ["ntqapplication.h", q£ + TQApplication foo( argc, argv ); + foo.sessionId(); + £, 15], + "TQT_NO_SETTINGS" => ["ntqsettings.h", "TQSettings foo;", 5], + "TQT_NO_SIGNALMAPPER" => ["ntqsignalmapper.h", "TQSignalMapper foo( (TQObject *) NULL );", 0], + "TQT_NO_SIZEGRIP" => ["ntqsizegrip.h", "TQSizeGrip foo( (TQWidget *) NULL );", 10], + "TQT_NO_SLIDER" => ["ntqslider.h", "TQSlider foo( (TQWidget *) NULL );", 12], + "TQT_NO_SOUND" => ["ntqsound.h", "TQSound foo( TQString::null );", 5], + + + "TQT_NO_SPINWIDGET" => ["ntqrangecontrol.h", "TQSpinWidget foo;", 10], + "TQT_NO_SPRINTF" => ["ntqcolor.h", q£ + TQColor foo; + foo.name(); + £, 0], + + + + "TQT_NO_SQL" => ["ntqsqlcursor.h", "TQSqlCursor foo;", 5], + "TQT_NO_STRINGLIST" => ["ntqstringlist.h", "TQStringList foo;", 0], + "TQT_NO_STYLE" => ["ntqapplication.h", q£ + TQApplication foo( argc, argv ); + foo.style(); + £, 15], + +# "TQT_NO_STYLE_CDE" => ["ntqcdestyle.h", "TQCDEStyle foo;", 16], +# "TQT_NO_STYLE_COMPACT" => ["ntqcompactstyle.h", "TQCompactStyle foo;", 16], +# "TQT_NO_STYLE_INTERLACE" => ["ntqinterlacestyle.h", "TQInterlaceStyle foo;", 16], +# "TQT_NO_STYLE_PLATINUM" => ["ntqplatinumstyle.h", "TQPlatinumStyle foo;", 16], +# "TQT_NO_STYLE_MOTIF" => ["ntqmotifstyle.h", "TQMotifStyle foo;", 16], +# "TQT_NO_STYLE_MOTIFPLUS" => ["ntqmotifplusstyle.h", "TQMotifPlusStyle foo;", 16], +# "TQT_NO_STYLE_SGI" => ["ntqsgistyle.h", "TQSGIStyle foo;", 16], +# "TQT_NO_STYLE_WINDOWS" => ["ntqwindowsstyle.h", "TQWindowsStyle foo;", 16], + "TQT_NO_TABBAR" => ["ntqtabbar.h", "TQTabBar foo;", 10], + "TQT_NO_TABDIALOG" => ["ntqtabdialog.h", "TQTabDialog foo;", 12], + "TQT_NO_TABLE" => ["ntqtable.h", "TQTable foo;", 10], + "TQT_NO_TABWIDGET" => ["ntqtabwidget.h", "TQTabWidget foo;", 10], + "TQT_NO_TEXTBROWSER" => ["ntqtextbrowser.h", "TQTextBrowser foo;", 14], + "TQT_NO_TEXTCODEC" => ["ntqtextcodec.h", "TQTextCodec::codecForIndex(1);", 5], + "TQT_NO_TEXTCODECPLUGIN" => ["ntqtextcodecplugin.h, qstringlist.h, qvaluelist.h, qtextcodec.h", "TQFoo foo;", 6, q£ + + class TQFoo: public TQTextCodecPlugin + { + public: + TQFoo() {}; + ~TQFoo() {}; + TQStringList names() const {return TQStringList();} + TQValueListmibEnums() const {return TQValueList();} + TQTextCodec *createForName( const TQString & name ) {return (TQTextCodec *)NULL;} + TQTextCodec *createForMib( int mib ) {return (TQTextCodec *)NULL;} + }; + TQ_EXPORT_PLUGIN( TQFoo ) + £], + "TQT_NO_TEXTEDIT" => ["ntqtextedit.h", "TQTextEdit foo;", 13], + "TQT_NO_TEXTSTREAM" => ["ntqtextstream.h", "TQTextStream foo;", 5], + "TQT_NO_TEXTVIEW" => ["ntqtextview.h", "TQTextView foo;", 14], #Obsolete + "TQT_NO_TOOLBAR" => ["ntqtoolbar.h", "TQToolBar foo;", 10], + "TQT_NO_TOOLBUTTON" => ["ntqtoolbutton.h", "TQToolButton foo((TQWidget *) NULL );", 12], + "TQT_NO_TOOLTIP" => ["ntqtooltip.h", "TQToolTip::hide();", 10], + + "TQT_NO_TRANSFORMATIONS" => ["ntqpainter.h", q£ + TQPainter *foo= new TQPainter(); + foo->setViewXForm( true );£, 5], + "TQT_NO_VARIANT" => ["ntqvariant.h", "TQVariant foo;", 0], + "TQT_NO_WHATSTHIS" => ["ntqwhatsthis.h", "TQWhatsThis::inWhatsThisMode();", 10], + "TQT_NO_WHEELEVENT" => ["ntqevent.h", "TQWheelEvent foo( TQPoint(1,1), 1, 1 );", 5], + "TQT_NO_WIDGET_TOPEXTRA" => ["ntqwidget.h", "TQWidget foo; foo.caption();", 9], + "TQT_NO_WIDGETSTACK" => ["ntqwidgetstack.h", "TQWidgetStack foo;", 13], + "TQT_NO_WIZARD" => ["ntqwizard.h", "TQWizard foo;", 13], + "TQT_NO_WMATRIX" => ["ntqwmatrix.h", "TQWMatrix foo;", 0], + "TQT_NO_XML" => ["ntqxml.h", "TQXmlNamespaceSupport foo;", 5], + ); + +} -- cgit v1.2.3