diff --git a/.gitmodules b/.gitmodules index bdec8fc..69dd7b2 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,6 +1,3 @@ -[submodule "admin"] - path = admin - url = https://system@scm.trinitydesktop.org/scm/git/tde-common-admin [submodule "cmake"] path = cmake url = https://system@scm.trinitydesktop.org/scm/git/tde-common-cmake diff --git a/AUTHORS b/AUTHORS new file mode 100644 index 0000000..4832772 --- /dev/null +++ b/AUTHORS @@ -0,0 +1,8 @@ +Georgy (George) Yunaev - Copyright (C) 2004-2007 + + +THANKS: + + - Jed Wing, the author of chmlib. This library is used by kchmviewer to access chm content. + - Razvan Cojocaru, the author of xchm. I used some ideas and chm processing code from xchm. + - All the users, who report bugs, and suggest features. You help making kchnviewer better. diff --git a/CMakeLists.txt b/CMakeLists.txt index 2a60f3c..5eb32bb 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -41,17 +41,17 @@ tde_setup_paths( ) ##### optional stuff -option( WITH_ALL_OPTIONS "Enable all optional support" OFF ) -option( WITH_GCC_VISIBILITY "Enable fvisibility and fvisibility-inlines-hidden" ${WITH_ALL_OPTIONS} ) -option( WITH_TDE "Build with TDE itegration instead of standalone TQt" ${WITH_ALL_OPTIONS} ) -option( WITH_CHMLIB "Build with external chmlib" ${WITH_ALL_OPTIONS} ) +option( WITH_ALL_OPTIONS "Enable all optional support" OFF ) +option( WITH_GCC_VISIBILITY "Enable fvisibility and fvisibility-inlines-hidden" ${WITH_ALL_OPTIONS} ) +option( WITH_TDE "Build with TDE itegration instead of standalone TQt" ${WITH_ALL_OPTIONS} ) +option( WITH_CHMLIB "Build with external chmlib" ${WITH_ALL_OPTIONS} ) ##### user requested modules -option( BUILD_ALL "Build all" ON ) -option( BUILD_DOC "Build documentation" ${BUILD_ALL} ) -option( BUILD_TRANSLATIONS "Build translations" ${BUILD_ALL} ) +option( BUILD_ALL "Build all" ON ) +option( BUILD_DOC "Build documentation" ${BUILD_ALL} ) +option( BUILD_TRANSLATIONS "Build translations" ${BUILD_ALL} ) ##### configure checks @@ -72,7 +72,7 @@ set( CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} -Wl,--no-undefined" add_subdirectory( lib ) add_subdirectory( src ) -tde_conditional_add_subdirectory( BUILD_DOC doc ) +tde_conditional_add_subdirectory( BUILD_DOC doc ) tde_conditional_add_subdirectory( BUILD_TRANSLATIONS po ) diff --git a/INSTALL b/INSTALL new file mode 100644 index 0000000..a599042 --- /dev/null +++ b/INSTALL @@ -0,0 +1,22 @@ +Basic Installation +================== + +kchmviewer relies on cmake to build. + +Here are suggested default options: + + -DCMAKE_INSTALL_PREFIX="/opt/trinity" \ + -DCONFIG_INSTALL_DIR="/etc/trinity" \ + -DSYSCONF_INSTALL_DIR="/etc" \ + -DXDG_MENU_INSTALL_DIR="/etc/xdg/menus" \ + -DCMAKE_BUILD_TYPE=RelWithDebInfo \ + -DCMAKE_VERBOSE_MAKEFILE="ON" \ + -DCMAKE_SKIP_RPATH="OFF" \ + -DBUILD_ALL="ON" \ + -DWITH_ALL_OPTIONS="ON" + + +Requirements +============ +o TDE libraries (tdelibs) +o Libchm diff --git a/Makefile.am b/Makefile.am deleted file mode 100644 index dd66115..0000000 --- a/Makefile.am +++ /dev/null @@ -1,7 +0,0 @@ -AUTOMAKE_OPTIONS = foreign 1.6 - -SUBDIRS = lib src po doc - -package-messages: - $(MAKE) -f admin/Makefile.common package-messages - $(MAKE) -C po merge diff --git a/Makefile.cvs b/Makefile.cvs deleted file mode 100644 index 5b6902b..0000000 --- a/Makefile.cvs +++ /dev/null @@ -1,11 +0,0 @@ -all: - @echo "This Makefile is only for the CVS repository" - @echo "This will be deleted before making the distribution" - @echo "" - $(MAKE) -f admin/Makefile.common cvs - rm -rf autom4te.cache - -dist: - $(MAKE) -f admin/Makefile.common dist - -.SILENT: diff --git a/README b/README index c68e440..0ba9341 100644 --- a/README +++ b/README @@ -1,123 +1,38 @@ -1. OVERVIEW - KchmViewer is a chm (MS HTML help file format) viewer, written in C++. Unlike most existing CHM viewers for Unix, - it uses Trolltech Qt widget library, and does not depend on KDE or Gnome. However, it may be compiled with full - KDE support, including KDE widgets and TDEIO/TDEHTML. - - The main advantage of KchmViewer is extended support for non-English languages. Unlike others, KchmViewer in most - cases correctly detects chm file encoding, correctly shows tables of context of Russian, Korean, Chinese and - Japanese help files, and correctly searches in non-English help files (search for MBCS languages - ja/ko/ch is - still in progress). - - KchmViewer is written by Georgy Yunaev (gyunaev@ulduzsoft.com), and is licensed under GNU GPL license. Please - do NOT use this email for bug reporting; see below. - -2. FEATURES - - - Standalone viewer, depends on Qt only. Does not require KDE, Gnome or wxWindows toolkit. - - A KDE viewer can be compiled optionally, with TDEIO slave, TDEHTML and K*Widget support. - - Completely safe and harmless. Does not support JavaScript in any way, optionally warns you before opening an - external web page, or switching to another help file. - - Correctly detects and shows encoding of any valid chm file. - - Correctly shows non-English chm files, including cyrillic, chinese, japanese and others. - - Correctly searches in non-English chm files using chm built-in search index. - - Shows an appropriate image for every TOC entry. - - Has complete chm index support, including multiple index entries, cross-links and parent/child entries in index. - - Persistent bookmarks support. Allows to store bookmarks even if "Favorites" window was not enabled for this chm - file. Also stores the screen position for every bookmark. You can also edit/delete bookmarks. - - For any opened chm file, stores the last opened window, search history, bookmark history, font size and so on, so - when you open this file again, everything is always on the place. - - Has easy and powerful search-in-page support. - - Allows to increase or decrease the font size, so physically handicapped people can read texts easily. - - Has standard Back/Forward/Home navigation. - - Can print the opened pages on a standard printer (usually via CUPS). - - Has complex search query support. You can use search queries like "lazy people" + learn -not. - - -3. INSTALLATION - - Usually kchmviewer is distributed in source code archive, so you need to compile it first. It compiles with Qt 3.x, - but recommended Qt version is 3.3.4 and above. This is due to font resizing bug existing in previous Qt versions, - so if you use pre-3.3.4, you will have problems with font sizes. Note that you need to install qt3-devel package, - not only qt package. - -3.1. Qt-only version - - To compile Qt-only version of kchmviewer, follow the simple procedure: - - > tar zxf kchmviewer-.tar.gzi - > cd kchmviewer- - > ./configure - > make - > sudo make install - - The last step is optional; you can use kchmviewer binary without installation. - -3.2 KDE version - - This procedure will create the Qt-only executable, which does not use KDE. If you want to compile executable - for KDE, add --with-kde to configure options. For KDE version, 'make install' is required to work with TDEHTML - browser. Note that you need tdelibs-devel package installed. - - > tar zxf kchmviewer-.tar.gz - > cd kchmviewer- - > ./configure --with-kde - > make - > sudo make install - -3.3 x86-64 version - - To compile kchmviewer version for x86-64, make sure that you have installed 64-bit qt and qt-devel libraries, - and specify the path to them with --with-qt-libraries= configure switch: - - > tar zxf kchmviewer-.tar.gz - > cd kchmviewer- - > ./configure --with-qt-libraries=/usr/lib/qt3/lib64 [--with-kde (optional)] - > make - > sudo make install - - If you experience any link error, make sure you have all 64bit libraries installed. Look careful on error - messages; usually they point you to right direction. - - -4. USAGE - - Usage of kchmviewer is simple: - - > kchmviewer mychmfile.chm - - for the rest of command-line options, see kchmviewer --help - - -5. BUG REPORTING - - Please use kchmviewer@ulduzsoft.com for bug reporting. - - -6. THANKS - - Thanks to: - - Jed Wing, the author of chmlib. This library is used by kchmviewer to access chm content. - - Razvan Cojocaru, the author of xchm. I used some ideas and chm processing code from xchm. - - All the users, who report bugs, and suggest features. You help making kchnviewer better. - - -7. LICENSE - - kchmviewer is distributed under GNU GPL license. - Copyright (C) 2004-2007 Georgy (George) Yunaev - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + KchmViewer - a chm files viewer. + + + Kchmviewer is a chm files (MS HTML help file format) viewer. + The main advantage of KchmViewer is extended support for non-English + languages. KchmViewer in most cases correctly detects chm file encoding, + correctly shows tables of context of Russian, Korean, Chinese and + Japanese help files. It searches in non-English help files (albeit, the + search for MBCS languages - ja/ko/ch is still in progress.) + + + +FEATURES: +========= + + - Has support for TDEIO slave, TDEHTML and K*Widget. + - Safe and harmless, kchviewer does not support JavaScript, + optionally warns you before opening an external web page or switching + to another help file. + - Detects and shows encoding of any valid chm file. + - Shows non-English chm files, including cyrillic, chinese, japanese... + - Search in non-English chm files using chm built-in search index. + - Shows an appropriate image for every TOC entry. + - Has chm index support, including multiple index entries, cross-links + and parent/child entries in index. + - Persistent bookmarks support. Kchviewer stores the screen position + for every bookmark. + - For any opened chm files, stores the last opened window, search history, + bookmark history, font size, etc, so when you open this file again, + everything is on the last place. + - Has easy and powerful search-in-page support. + - Allows to increase or decrease the font size, so partially sighted + people can read texts easily. + - Has standard Back/Forward/Home navigation. + - Can print the opened pages on a standard printer (usually via CUPS). + - Has complex search query support. diff --git a/aclocal.m4 b/aclocal.m4 deleted file mode 100644 index dd92cb3..0000000 --- a/aclocal.m4 +++ /dev/null @@ -1,863 +0,0 @@ -# generated automatically by aclocal 1.9.6 -*- Autoconf -*- - -# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, -# 2005 Free Software Foundation, Inc. -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY, to the extent permitted by law; without -# even the implied warranty of MERCHANTABILITY or FITNESS FOR A -# PARTICULAR PURPOSE. - -# Copyright (C) 2002, 2003, 2005 Free Software Foundation, Inc. -# -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# AM_AUTOMAKE_VERSION(VERSION) -# ---------------------------- -# Automake X.Y traces this macro to ensure aclocal.m4 has been -# generated from the m4 files accompanying Automake X.Y. -AC_DEFUN([AM_AUTOMAKE_VERSION], [am__api_version="1.9"]) - -# AM_SET_CURRENT_AUTOMAKE_VERSION -# ------------------------------- -# Call AM_AUTOMAKE_VERSION so it can be traced. -# This function is AC_REQUIREd by AC_INIT_AUTOMAKE. -AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], - [AM_AUTOMAKE_VERSION([1.9.6])]) - -# AM_AUX_DIR_EXPAND -*- Autoconf -*- - -# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc. -# -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets -# $ac_aux_dir to `$srcdir/foo'. In other projects, it is set to -# `$srcdir', `$srcdir/..', or `$srcdir/../..'. -# -# Of course, Automake must honor this variable whenever it calls a -# tool from the auxiliary directory. The problem is that $srcdir (and -# therefore $ac_aux_dir as well) can be either absolute or relative, -# depending on how configure is run. This is pretty annoying, since -# it makes $ac_aux_dir quite unusable in subdirectories: in the top -# source directory, any form will work fine, but in subdirectories a -# relative path needs to be adjusted first. -# -# $ac_aux_dir/missing -# fails when called from a subdirectory if $ac_aux_dir is relative -# $top_srcdir/$ac_aux_dir/missing -# fails if $ac_aux_dir is absolute, -# fails when called from a subdirectory in a VPATH build with -# a relative $ac_aux_dir -# -# The reason of the latter failure is that $top_srcdir and $ac_aux_dir -# are both prefixed by $srcdir. In an in-source build this is usually -# harmless because $srcdir is `.', but things will broke when you -# start a VPATH build or use an absolute $srcdir. -# -# So we could use something similar to $top_srcdir/$ac_aux_dir/missing, -# iff we strip the leading $srcdir from $ac_aux_dir. That would be: -# am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"` -# and then we would define $MISSING as -# MISSING="\${SHELL} $am_aux_dir/missing" -# This will work as long as MISSING is not called from configure, because -# unfortunately $(top_srcdir) has no meaning in configure. -# However there are other variables, like CC, which are often used in -# configure, and could therefore not use this "fixed" $ac_aux_dir. -# -# Another solution, used here, is to always expand $ac_aux_dir to an -# absolute PATH. The drawback is that using absolute paths prevent a -# configured tree to be moved without reconfiguration. - -AC_DEFUN([AM_AUX_DIR_EXPAND], -[dnl Rely on autoconf to set up CDPATH properly. -AC_PREREQ([2.50])dnl -# expand $ac_aux_dir to an absolute path -am_aux_dir=`cd $ac_aux_dir && pwd` -]) - -# AM_CONDITIONAL -*- Autoconf -*- - -# Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005 -# Free Software Foundation, Inc. -# -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# serial 7 - -# AM_CONDITIONAL(NAME, SHELL-CONDITION) -# ------------------------------------- -# Define a conditional. -AC_DEFUN([AM_CONDITIONAL], -[AC_PREREQ(2.52)dnl - ifelse([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])], - [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl -AC_SUBST([$1_TRUE]) -AC_SUBST([$1_FALSE]) -if $2; then - $1_TRUE= - $1_FALSE='#' -else - $1_TRUE='#' - $1_FALSE= -fi -AC_CONFIG_COMMANDS_PRE( -[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then - AC_MSG_ERROR([[conditional "$1" was never defined. -Usually this means the macro was only invoked conditionally.]]) -fi])]) - - -# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005 -# Free Software Foundation, Inc. -# -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# serial 8 - -# There are a few dirty hacks below to avoid letting `AC_PROG_CC' be -# written in clear, in which case automake, when reading aclocal.m4, -# will think it sees a *use*, and therefore will trigger all it's -# C support machinery. Also note that it means that autoscan, seeing -# CC etc. in the Makefile, will ask for an AC_PROG_CC use... - - -# _AM_DEPENDENCIES(NAME) -# ---------------------- -# See how the compiler implements dependency checking. -# NAME is "CC", "CXX", "GCJ", or "OBJC". -# We try a few techniques and use that to set a single cache variable. -# -# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was -# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular -# dependency, and given that the user is not expected to run this macro, -# just rely on AC_PROG_CC. -AC_DEFUN([_AM_DEPENDENCIES], -[AC_REQUIRE([AM_SET_DEPDIR])dnl -AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl -AC_REQUIRE([AM_MAKE_INCLUDE])dnl -AC_REQUIRE([AM_DEP_TRACK])dnl - -ifelse([$1], CC, [depcc="$CC" am_compiler_list=], - [$1], CXX, [depcc="$CXX" am_compiler_list=], - [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'], - [$1], GCJ, [depcc="$GCJ" am_compiler_list='gcc3 gcc'], - [depcc="$$1" am_compiler_list=]) - -AC_CACHE_CHECK([dependency style of $depcc], - [am_cv_$1_dependencies_compiler_type], -[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then - # We make a subdir and do the tests there. Otherwise we can end up - # making bogus files that we don't know about and never remove. For - # instance it was reported that on HP-UX the gcc test will end up - # making a dummy file named `D' -- because `-MD' means `put the output - # in D'. - mkdir conftest.dir - # Copy depcomp to subdir because otherwise we won't find it if we're - # using a relative directory. - cp "$am_depcomp" conftest.dir - cd conftest.dir - # We will build objects and dependencies in a subdirectory because - # it helps to detect inapplicable dependency modes. For instance - # both Tru64's cc and ICC support -MD to output dependencies as a - # side effect of compilation, but ICC will put the dependencies in - # the current directory while Tru64 will put them in the object - # directory. - mkdir sub - - am_cv_$1_dependencies_compiler_type=none - if test "$am_compiler_list" = ""; then - am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp` - fi - for depmode in $am_compiler_list; do - # Setup a source with many dependencies, because some compilers - # like to wrap large dependency lists on column 80 (with \), and - # we should not choose a depcomp mode which is confused by this. - # - # We need to recreate these files for each test, as the compiler may - # overwrite some of them when testing with obscure command lines. - # This happens at least with the AIX C compiler. - : > sub/conftest.c - for i in 1 2 3 4 5 6; do - echo '#include "conftst'$i'.h"' >> sub/conftest.c - # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with - # Solaris 8's {/usr,}/bin/sh. - touch sub/conftst$i.h - done - echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf - - case $depmode in - nosideeffect) - # after this tag, mechanisms are not by side-effect, so they'll - # only be used when explicitly requested - if test "x$enable_dependency_tracking" = xyes; then - continue - else - break - fi - ;; - none) break ;; - esac - # We check with `-c' and `-o' for the sake of the "dashmstdout" - # mode. It turns out that the SunPro C++ compiler does not properly - # handle `-M -o', and we need to detect this. - if depmode=$depmode \ - source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \ - depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ - $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \ - >/dev/null 2>conftest.err && - grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && - grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 && - ${MAKE-make} -s -f confmf > /dev/null 2>&1; then - # icc doesn't choke on unknown options, it will just issue warnings - # or remarks (even with -Werror). So we grep stderr for any message - # that says an option was ignored or not supported. - # When given -MP, icc 7.0 and 7.1 complain thusly: - # icc: Command line warning: ignoring option '-M'; no argument required - # The diagnosis changed in icc 8.0: - # icc: Command line remark: option '-MP' not supported - if (grep 'ignoring option' conftest.err || - grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else - am_cv_$1_dependencies_compiler_type=$depmode - break - fi - fi - done - - cd .. - rm -rf conftest.dir -else - am_cv_$1_dependencies_compiler_type=none -fi -]) -AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type]) -AM_CONDITIONAL([am__fastdep$1], [ - test "x$enable_dependency_tracking" != xno \ - && test "$am_cv_$1_dependencies_compiler_type" = gcc3]) -]) - - -# AM_SET_DEPDIR -# ------------- -# Choose a directory name for dependency files. -# This macro is AC_REQUIREd in _AM_DEPENDENCIES -AC_DEFUN([AM_SET_DEPDIR], -[AC_REQUIRE([AM_SET_LEADING_DOT])dnl -AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl -]) - - -# AM_DEP_TRACK -# ------------ -AC_DEFUN([AM_DEP_TRACK], -[AC_ARG_ENABLE(dependency-tracking, -[ --disable-dependency-tracking speeds up one-time build - --enable-dependency-tracking do not reject slow dependency extractors]) -if test "x$enable_dependency_tracking" != xno; then - am_depcomp="$ac_aux_dir/depcomp" - AMDEPBACKSLASH='\' -fi -AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno]) -AC_SUBST([AMDEPBACKSLASH]) -]) - -# Generate code to set up dependency tracking. -*- Autoconf -*- - -# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005 -# Free Software Foundation, Inc. -# -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -#serial 3 - -# _AM_OUTPUT_DEPENDENCY_COMMANDS -# ------------------------------ -AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], -[for mf in $CONFIG_FILES; do - # Strip MF so we end up with the name of the file. - mf=`echo "$mf" | sed -e 's/:.*$//'` - # Check whether this is an Automake generated Makefile or not. - # We used to match only the files named `Makefile.in', but - # some people rename them; so instead we look at the file content. - # Grep'ing the first line is not enough: some people post-process - # each Makefile.in and add a new line on top of each file to say so. - # So let's grep whole file. - if grep '^#.*generated by automake' $mf > /dev/null 2>&1; then - dirpart=`AS_DIRNAME("$mf")` - else - continue - fi - # Extract the definition of DEPDIR, am__include, and am__quote - # from the Makefile without running `make'. - DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` - test -z "$DEPDIR" && continue - am__include=`sed -n 's/^am__include = //p' < "$mf"` - test -z "am__include" && continue - am__quote=`sed -n 's/^am__quote = //p' < "$mf"` - # When using ansi2knr, U may be empty or an underscore; expand it - U=`sed -n 's/^U = //p' < "$mf"` - # Find all dependency output files, they are included files with - # $(DEPDIR) in their names. We invoke sed twice because it is the - # simplest approach to changing $(DEPDIR) to its actual value in the - # expansion. - for file in `sed -n " - s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ - sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do - # Make sure the directory exists. - test -f "$dirpart/$file" && continue - fdir=`AS_DIRNAME(["$file"])` - AS_MKDIR_P([$dirpart/$fdir]) - # echo "creating $dirpart/$file" - echo '# dummy' > "$dirpart/$file" - done -done -])# _AM_OUTPUT_DEPENDENCY_COMMANDS - - -# AM_OUTPUT_DEPENDENCY_COMMANDS -# ----------------------------- -# This macro should only be invoked once -- use via AC_REQUIRE. -# -# This code is only required when automatic dependency tracking -# is enabled. FIXME. This creates each `.P' file that we will -# need in order to bootstrap the dependency handling code. -AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS], -[AC_CONFIG_COMMANDS([depfiles], - [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS], - [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"]) -]) - -# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005 -# Free Software Foundation, Inc. -# -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# serial 8 - -# AM_CONFIG_HEADER is obsolete. It has been replaced by AC_CONFIG_HEADERS. -AU_DEFUN([AM_CONFIG_HEADER], [AC_CONFIG_HEADERS($@)]) - -# Do all the work for Automake. -*- Autoconf -*- - -# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005 -# Free Software Foundation, Inc. -# -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# serial 12 - -# This macro actually does too much. Some checks are only needed if -# your package does certain things. But this isn't really a big deal. - -# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE]) -# AM_INIT_AUTOMAKE([OPTIONS]) -# ----------------------------------------------- -# The call with PACKAGE and VERSION arguments is the old style -# call (pre autoconf-2.50), which is being phased out. PACKAGE -# and VERSION should now be passed to AC_INIT and removed from -# the call to AM_INIT_AUTOMAKE. -# We support both call styles for the transition. After -# the next Automake release, Autoconf can make the AC_INIT -# arguments mandatory, and then we can depend on a new Autoconf -# release and drop the old call support. -AC_DEFUN([AM_INIT_AUTOMAKE], -[AC_PREREQ([2.58])dnl -dnl Autoconf wants to disallow AM_ names. We explicitly allow -dnl the ones we care about. -m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl -AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl -AC_REQUIRE([AC_PROG_INSTALL])dnl -# test to see if srcdir already configured -if test "`cd $srcdir && pwd`" != "`pwd`" && - test -f $srcdir/config.status; then - AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) -fi - -# test whether we have cygpath -if test -z "$CYGPATH_W"; then - if (cygpath --version) >/dev/null 2>/dev/null; then - CYGPATH_W='cygpath -w' - else - CYGPATH_W=echo - fi -fi -AC_SUBST([CYGPATH_W]) - -# Define the identity of the package. -dnl Distinguish between old-style and new-style calls. -m4_ifval([$2], -[m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl - AC_SUBST([PACKAGE], [$1])dnl - AC_SUBST([VERSION], [$2])], -[_AM_SET_OPTIONS([$1])dnl - AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl - AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl - -_AM_IF_OPTION([no-define],, -[AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package]) - AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl - -# Some tools Automake needs. -AC_REQUIRE([AM_SANITY_CHECK])dnl -AC_REQUIRE([AC_ARG_PROGRAM])dnl -AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version}) -AM_MISSING_PROG(AUTOCONF, autoconf) -AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version}) -AM_MISSING_PROG(AUTOHEADER, autoheader) -AM_MISSING_PROG(MAKEINFO, makeinfo) -AM_PROG_INSTALL_SH -AM_PROG_INSTALL_STRIP -AC_REQUIRE([AM_PROG_MKDIR_P])dnl -# We need awk for the "check" target. The system "awk" is bad on -# some platforms. -AC_REQUIRE([AC_PROG_AWK])dnl -AC_REQUIRE([AC_PROG_MAKE_SET])dnl -AC_REQUIRE([AM_SET_LEADING_DOT])dnl -_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])], - [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])], - [_AM_PROG_TAR([v7])])]) -_AM_IF_OPTION([no-dependencies],, -[AC_PROVIDE_IFELSE([AC_PROG_CC], - [_AM_DEPENDENCIES(CC)], - [define([AC_PROG_CC], - defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl -AC_PROVIDE_IFELSE([AC_PROG_CXX], - [_AM_DEPENDENCIES(CXX)], - [define([AC_PROG_CXX], - defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl -]) -]) - - -# When config.status generates a header, we must update the stamp-h file. -# This file resides in the same directory as the config header -# that is generated. The stamp files are numbered to have different names. - -# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the -# loop where config.status creates the headers, so we can generate -# our stamp files there. -AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK], -[# Compute $1's index in $config_headers. -_am_stamp_count=1 -for _am_header in $config_headers :; do - case $_am_header in - $1 | $1:* ) - break ;; - * ) - _am_stamp_count=`expr $_am_stamp_count + 1` ;; - esac -done -echo "timestamp for $1" >`AS_DIRNAME([$1])`/stamp-h[]$_am_stamp_count]) - -# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc. -# -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# AM_PROG_INSTALL_SH -# ------------------ -# Define $install_sh. -AC_DEFUN([AM_PROG_INSTALL_SH], -[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl -install_sh=${install_sh-"$am_aux_dir/install-sh"} -AC_SUBST(install_sh)]) - -# Copyright (C) 2003, 2005 Free Software Foundation, Inc. -# -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# serial 2 - -# Check whether the underlying file-system supports filenames -# with a leading dot. For instance MS-DOS doesn't. -AC_DEFUN([AM_SET_LEADING_DOT], -[rm -rf .tst 2>/dev/null -mkdir .tst 2>/dev/null -if test -d .tst; then - am__leading_dot=. -else - am__leading_dot=_ -fi -rmdir .tst 2>/dev/null -AC_SUBST([am__leading_dot])]) - -# Check to see how 'make' treats includes. -*- Autoconf -*- - -# Copyright (C) 2001, 2002, 2003, 2005 Free Software Foundation, Inc. -# -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# serial 3 - -# AM_MAKE_INCLUDE() -# ----------------- -# Check to see how make treats includes. -AC_DEFUN([AM_MAKE_INCLUDE], -[am_make=${MAKE-make} -cat > confinc << 'END' -am__doit: - @echo done -.PHONY: am__doit -END -# If we don't find an include directive, just comment out the code. -AC_MSG_CHECKING([for style of include used by $am_make]) -am__include="#" -am__quote= -_am_result=none -# First try GNU make style include. -echo "include confinc" > confmf -# We grep out `Entering directory' and `Leaving directory' -# messages which can occur if `w' ends up in MAKEFLAGS. -# In particular we don't look at `^make:' because GNU make might -# be invoked under some other name (usually "gmake"), in which -# case it prints its new name instead of `make'. -if test "`$am_make -s -f confmf 2> /dev/null | grep -v 'ing directory'`" = "done"; then - am__include=include - am__quote= - _am_result=GNU -fi -# Now try BSD make style include. -if test "$am__include" = "#"; then - echo '.include "confinc"' > confmf - if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then - am__include=.include - am__quote="\"" - _am_result=BSD - fi -fi -AC_SUBST([am__include]) -AC_SUBST([am__quote]) -AC_MSG_RESULT([$_am_result]) -rm -f confinc confmf -]) - -# Fake the existence of programs that GNU maintainers use. -*- Autoconf -*- - -# Copyright (C) 1997, 1999, 2000, 2001, 2003, 2005 -# Free Software Foundation, Inc. -# -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# serial 4 - -# AM_MISSING_PROG(NAME, PROGRAM) -# ------------------------------ -AC_DEFUN([AM_MISSING_PROG], -[AC_REQUIRE([AM_MISSING_HAS_RUN]) -$1=${$1-"${am_missing_run}$2"} -AC_SUBST($1)]) - - -# AM_MISSING_HAS_RUN -# ------------------ -# Define MISSING if not defined so far and test if it supports --run. -# If it does, set am_missing_run to use it, otherwise, to nothing. -AC_DEFUN([AM_MISSING_HAS_RUN], -[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl -test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing" -# Use eval to expand $SHELL -if eval "$MISSING --run true"; then - am_missing_run="$MISSING --run " -else - am_missing_run= - AC_MSG_WARN([`missing' script is too old or missing]) -fi -]) - -# Copyright (C) 2003, 2004, 2005 Free Software Foundation, Inc. -# -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# AM_PROG_MKDIR_P -# --------------- -# Check whether `mkdir -p' is supported, fallback to mkinstalldirs otherwise. -# -# Automake 1.8 used `mkdir -m 0755 -p --' to ensure that directories -# created by `make install' are always world readable, even if the -# installer happens to have an overly restrictive umask (e.g. 077). -# This was a mistake. There are at least two reasons why we must not -# use `-m 0755': -# - it causes special bits like SGID to be ignored, -# - it may be too restrictive (some setups expect 775 directories). -# -# Do not use -m 0755 and let people choose whatever they expect by -# setting umask. -# -# We cannot accept any implementation of `mkdir' that recognizes `-p'. -# Some implementations (such as Solaris 8's) are not thread-safe: if a -# parallel make tries to run `mkdir -p a/b' and `mkdir -p a/c' -# concurrently, both version can detect that a/ is missing, but only -# one can create it and the other will error out. Consequently we -# restrict ourselves to GNU make (using the --version option ensures -# this.) -AC_DEFUN([AM_PROG_MKDIR_P], -[if mkdir -p --version . >/dev/null 2>&1 && test ! -d ./--version; then - # We used to keeping the `.' as first argument, in order to - # allow $(mkdir_p) to be used without argument. As in - # $(mkdir_p) $(somedir) - # where $(somedir) is conditionally defined. However this is wrong - # for two reasons: - # 1. if the package is installed by a user who cannot write `.' - # make install will fail, - # 2. the above comment should most certainly read - # $(mkdir_p) $(DESTDIR)$(somedir) - # so it does not work when $(somedir) is undefined and - # $(DESTDIR) is not. - # To support the latter case, we have to write - # test -z "$(somedir)" || $(mkdir_p) $(DESTDIR)$(somedir), - # so the `.' trick is pointless. - mkdir_p='mkdir -p --' -else - # On NextStep and OpenStep, the `mkdir' command does not - # recognize any option. It will interpret all options as - # directories to create, and then abort because `.' already - # exists. - for d in ./-p ./--version; - do - test -d $d && rmdir $d - done - # $(mkinstalldirs) is defined by Automake if mkinstalldirs exists. - if test -f "$ac_aux_dir/mkinstalldirs"; then - mkdir_p='$(mkinstalldirs)' - else - mkdir_p='$(install_sh) -d' - fi -fi -AC_SUBST([mkdir_p])]) - -# Helper functions for option handling. -*- Autoconf -*- - -# Copyright (C) 2001, 2002, 2003, 2005 Free Software Foundation, Inc. -# -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# serial 3 - -# _AM_MANGLE_OPTION(NAME) -# ----------------------- -AC_DEFUN([_AM_MANGLE_OPTION], -[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])]) - -# _AM_SET_OPTION(NAME) -# ------------------------------ -# Set option NAME. Presently that only means defining a flag for this option. -AC_DEFUN([_AM_SET_OPTION], -[m4_define(_AM_MANGLE_OPTION([$1]), 1)]) - -# _AM_SET_OPTIONS(OPTIONS) -# ---------------------------------- -# OPTIONS is a space-separated list of Automake options. -AC_DEFUN([_AM_SET_OPTIONS], -[AC_FOREACH([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])]) - -# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET]) -# ------------------------------------------- -# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. -AC_DEFUN([_AM_IF_OPTION], -[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])]) - -# Check to make sure that the build environment is sane. -*- Autoconf -*- - -# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005 -# Free Software Foundation, Inc. -# -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# serial 4 - -# AM_SANITY_CHECK -# --------------- -AC_DEFUN([AM_SANITY_CHECK], -[AC_MSG_CHECKING([whether build environment is sane]) -# Just in case -sleep 1 -echo timestamp > conftest.file -# Do `set' in a subshell so we don't clobber the current shell's -# arguments. Must try -L first in case configure is actually a -# symlink; some systems play weird games with the mod time of symlinks -# (eg FreeBSD returns the mod time of the symlink's containing -# directory). -if ( - set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null` - if test "$[*]" = "X"; then - # -L didn't work. - set X `ls -t $srcdir/configure conftest.file` - fi - rm -f conftest.file - if test "$[*]" != "X $srcdir/configure conftest.file" \ - && test "$[*]" != "X conftest.file $srcdir/configure"; then - - # If neither matched, then we have a broken ls. This can happen - # if, for instance, CONFIG_SHELL is bash and it inherits a - # broken ls alias from the environment. This has actually - # happened. Such a system could not be considered "sane". - AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken -alias in your environment]) - fi - - test "$[2]" = conftest.file - ) -then - # Ok. - : -else - AC_MSG_ERROR([newly created file is older than distributed files! -Check your system clock]) -fi -AC_MSG_RESULT(yes)]) - -# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc. -# -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# AM_PROG_INSTALL_STRIP -# --------------------- -# One issue with vendor `install' (even GNU) is that you can't -# specify the program used to strip binaries. This is especially -# annoying in cross-compiling environments, where the build's strip -# is unlikely to handle the host's binaries. -# Fortunately install-sh will honor a STRIPPROG variable, so we -# always use install-sh in `make install-strip', and initialize -# STRIPPROG with the value of the STRIP variable (set by the user). -AC_DEFUN([AM_PROG_INSTALL_STRIP], -[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl -# Installed binaries are usually stripped using `strip' when the user -# run `make install-strip'. However `strip' might not be the right -# tool to use in cross-compilation environments, therefore Automake -# will honor the `STRIP' environment variable to overrule this program. -dnl Don't test for $cross_compiling = yes, because it might be `maybe'. -if test "$cross_compiling" != no; then - AC_CHECK_TOOL([STRIP], [strip], :) -fi -INSTALL_STRIP_PROGRAM="\${SHELL} \$(install_sh) -c -s" -AC_SUBST([INSTALL_STRIP_PROGRAM])]) - -# Check how to create a tarball. -*- Autoconf -*- - -# Copyright (C) 2004, 2005 Free Software Foundation, Inc. -# -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# serial 2 - -# _AM_PROG_TAR(FORMAT) -# -------------------- -# Check how to create a tarball in format FORMAT. -# FORMAT should be one of `v7', `ustar', or `pax'. -# -# Substitute a variable $(am__tar) that is a command -# writing to stdout a FORMAT-tarball containing the directory -# $tardir. -# tardir=directory && $(am__tar) > result.tar -# -# Substitute a variable $(am__untar) that extract such -# a tarball read from stdin. -# $(am__untar) < result.tar -AC_DEFUN([_AM_PROG_TAR], -[# Always define AMTAR for backward compatibility. -AM_MISSING_PROG([AMTAR], [tar]) -m4_if([$1], [v7], - [am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'], - [m4_case([$1], [ustar],, [pax],, - [m4_fatal([Unknown tar format])]) -AC_MSG_CHECKING([how to create a $1 tar archive]) -# Loop over all known methods to create a tar archive until one works. -_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none' -_am_tools=${am_cv_prog_tar_$1-$_am_tools} -# Do not fold the above two line into one, because Tru64 sh and -# Solaris sh will not grok spaces in the rhs of `-'. -for _am_tool in $_am_tools -do - case $_am_tool in - gnutar) - for _am_tar in tar gnutar gtar; - do - AM_RUN_LOG([$_am_tar --version]) && break - done - am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"' - am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"' - am__untar="$_am_tar -xf -" - ;; - plaintar) - # Must skip GNU tar: if it does not support --format= it doesn't create - # ustar tarball either. - (tar --version) >/dev/null 2>&1 && continue - am__tar='tar chf - "$$tardir"' - am__tar_='tar chf - "$tardir"' - am__untar='tar xf -' - ;; - pax) - am__tar='pax -L -x $1 -w "$$tardir"' - am__tar_='pax -L -x $1 -w "$tardir"' - am__untar='pax -r' - ;; - cpio) - am__tar='find "$$tardir" -print | cpio -o -H $1 -L' - am__tar_='find "$tardir" -print | cpio -o -H $1 -L' - am__untar='cpio -i -H $1 -d' - ;; - none) - am__tar=false - am__tar_=false - am__untar=false - ;; - esac - - # If the value was cached, stop now. We just wanted to have am__tar - # and am__untar set. - test -n "${am_cv_prog_tar_$1}" && break - - # tar/untar a dummy directory, and stop if the command works - rm -rf conftest.dir - mkdir conftest.dir - echo GrepMe > conftest.dir/file - AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar]) - rm -rf conftest.dir - if test -s conftest.tar; then - AM_RUN_LOG([$am__untar /dev/null 2>&1 && break - fi -done -rm -rf conftest.dir - -AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool]) -AC_MSG_RESULT([$am_cv_prog_tar_$1])]) -AC_SUBST([am__tar]) -AC_SUBST([am__untar]) -]) # _AM_PROG_TAR - -m4_include([acinclude.m4]) diff --git a/admin b/admin deleted file mode 160000 index 73da1dc..0000000 --- a/admin +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 73da1dc813757ec2c9cba699453a6ced536cf9f3 diff --git a/am_edit b/am_edit deleted file mode 100644 index 3d31fdd..0000000 --- a/am_edit +++ /dev/null @@ -1,2015 +0,0 @@ -#!/usr/bin/perl -w - -# Expands the specialised KDE tags in Makefile.in to (hopefully) valid -# make syntax. -# When called without file parameters, we work recursively on all Makefile.in -# in and below the current subdirectory. When called with file parameters, -# only those Makefile.in are changed. -# The currently supported tags are -# -# {program}_METASOURCES -# where you have a choice of two styles -# {program}_METASOURCES = name1.moc name2.moc ... [\] -# {program}_METASOURCES = AUTO -# The second style requires other tags as well. -# -# To install icons : -# KDE_ICON = iconname iconname2 ... -# KDE_ICON = AUTO -# -# For documentation : -# ... -# -# and more new tags TBD! -# -# The concept (and base code) for this program came from automoc, -# supplied by the following -# -# Matthias Ettrich (The originator) -# Kalle Dalheimer (The original implementator) -# Harri Porten -# Alex Zepeda -# David Faure -# Stephan Kulow - -use Cwd; -use File::Find; -use File::Basename; - -# Prototype the functions -sub initialise (); -sub processMakefile ($); -sub updateMakefile (); -sub restoreMakefile (); - -sub removeLine ($$); -sub appendLines ($); -sub substituteLine ($$); - -sub findMocCandidates (); -sub pruneMocCandidates ($); -sub checkMocCandidates (); -sub addMocRules (); - -sub tag_AUTOMAKE (); -sub tag_META_INCLUDES (); -sub tag_METASOURCES (); -sub tag_POFILES (); -sub tag_DOCFILES (); -sub tag_LOCALINSTALL(); -sub tag_IDLFILES(); -sub tag_UIFILES(); -sub tag_SUBDIRS(); -sub tag_ICON(); -sub tag_CLOSURE(); -sub tag_DIST(); - -# Some global globals... -$verbose = 0; # a debug flag -$thisProg = "$0"; # This programs name -$topdir = cwd(); # The current directory -@makefiles = (); # Contains all the files we'll process -@foreignfiles = (); -$start = (times)[0]; # some stats for testing - comment out for release -$version = "v0.2"; -$errorflag = 0; -$cppExt = "(cpp|cc|cxx|C|c\\+\\+)"; -$hExt = "(h|H|hh|hxx|hpp|h\\+\\+)"; -$progId = "KDE tags expanded automatically by " . basename($thisProg); -$automkCall = "\n"; -$printname = ""; # used to display the directory the Makefile is in -$use_final = 1; # create code for --enable-final -$cleantarget = "clean"; -$dryrun = 0; -$pathoption = 0; -$foreign_libtool = 0; - -while (defined ($ARGV[0])) -{ - $_ = shift; - if (/^--version$/) - { - print STDOUT "\n"; - print STDOUT basename($thisProg), " $version\n", - "This is really free software, unencumbered by the GPL.\n", - "You can do anything you like with it except sueing me.\n", - "Copyright 1998 Kalle Dalheimer \n", - "Concept, design and unnecessary questions about perl\n", - " by Matthias Ettrich \n\n", - "Making it useful by Stephan Kulow and\n", - "Harri Porten \n", - "Updated (Feb-1999), John Birch \n", - "Current Maintainer Stephan Kulow\n\n"; - exit 0; - } - elsif (/^--verbose$|^-v$/) - { - $verbose = 1; # Oh is there a problem...? - } - elsif (/^-p(.+)$|^--path=(.+)$/) - { - $thisProg = "$1/".basename($thisProg) if($1); - $thisProg = "$2/".basename($thisProg) if($2); - warn ("$thisProg doesn't exist\n") if (!(-f $thisProg)); - $pathoption=1; - } - elsif (/^--help$|^-h$/) - { - print STDOUT "Usage $thisProg [OPTION] ... [dir/Makefile.in]...\n", - "\n", - "Patches dir/Makefile.in generated by automake\n", - "(where dir can be an absolute or relative directory name)\n", - "\n", - " -v, --verbose verbosely list files processed\n", - " -h, --help print this help, then exit\n", - " --version print version number, then exit\n", - " -p, --path= use the path to am_edit if the path\n", - " called from is not the one to be used\n", - " --no-final don't patch for --enable-final\n"; - - exit 0; - } - elsif (/^--no-final$/) - { - $use_final = 0; - $thisProg .= " --no-final"; - } - elsif (/^--foreign-libtool$/) - { - $foreign_libtool = 1; - $thisProg .= " --foreign-libtool"; - } - elsif (/^-n$/) - { - $dryrun = 1; - } - else - { - # user selects what input files to check - # add full path if relative path is given - $_ = cwd()."/".$_ if (! /^\//); - print "User wants $_\n" if ($verbose); - push (@makefiles, $_); - } -} - -if ($thisProg =~ /^\// && !$pathoption ) -{ - print STDERR "Illegal full pathname call performed...\n", - "The call to \"$thisProg\"\nwould be inserted in some Makefile.in.\n", - "Please use option --path.\n"; - exit 1; -} - -# Only scan for files when the user hasn't entered data -if (!@makefiles) -{ - print STDOUT "Scanning for Makefile.in\n" if ($verbose); - find (\&add_makefile, cwd()); - #chdir('$topdir'); -} else { - print STDOUT "Using input files specified by user\n" if ($verbose); -} - -foreach $makefile (sort(@makefiles)) -{ - processMakefile ($makefile); - last if ($errorflag); -} - -# Just some debug statistics - comment out for release as it uses printf. -printf STDOUT "Time %.2f CPU sec\n", (times)[0] - $start if ($verbose); - -exit $errorflag; # causes make to fail if erroflag is set - -#----------------------------------------------------------------------------- - -# In conjunction with the "find" call, this builds the list of input files -sub add_makefile () -{ - push (@makefiles, $File::Find::name) if (/Makefile.in$/); -} - -#----------------------------------------------------------------------------- - -# Processes a single make file -# The parameter contains the full path name of the Makefile.in to use -sub processMakefile ($) -{ - # some useful globals for the subroutines called here - local ($makefile) = @_; - local @headerdirs = ('.'); - local $haveAutomocTag = 0; - local $MakefileData = ""; - - local $cxxsuffix = "KKK"; - - local @programs = (); # lists the names of programs and libraries - local $program = ""; - - local %realObjs = (); # lists the objects compiled into $program - local %sources = (); # lists the sources used for $program - local %finalObjs = (); # lists the objects compiled when final - local %realname = (); # the binary name of program variable - local %idlfiles = (); # lists the idl files used for $program - local %globalmocs = ();# list of all mocfiles (in %mocFiles format) - local %important = (); # list of files to be generated asap - local %uiFiles = (); - - local $allidls = ""; - local $idl_output = "";# lists all idl generated files for cleantarget - local $ui_output = "";# lists all uic generated files for cleantarget - - local %depedmocs = (); - - local $metasourceTags = 0; - local $dep_files = ""; - local $dep_finals = ""; - local %target_adds = (); # the targets to add - local $kdelang = ""; - local @cleanfiles = (); - local $cleanMoc = ""; - local $closure_output = ""; - - local %varcontent = (); - - $makefileDir = dirname($makefile); - chdir ($makefileDir); - $printname = $makefile; - $printname =~ s/^\Q$topdir\E\///; - $makefile = basename($makefile); - - print STDOUT "Processing makefile $printname\n" if ($verbose); - - # Setup and see if we need to do this. - return if (!initialise()); - - tag_AUTOMAKE (); # Allows a "make" to redo the Makefile.in - tag_META_INCLUDES (); # Supplies directories for src locations - - foreach $program (@programs) { - $sources_changed{$program} = 0; - $depedmocs{$program} = ""; - $important{$program} = ""; - tag_IDLFILES(); # Sorts out idl rules - tag_CLOSURE(); - tag_UIFILES(); # Sorts out ui rules - tag_METASOURCES (); # Sorts out the moc rules - if ($sources_changed{$program}) { - my $lookup = "$program" . '_SOURCES\s*=\s*(.*)'; - substituteLine($lookup, "$program\_SOURCES=" . $sources{$program}); - } - if ($important{$program}) { - local %source_dict = (); - for $source (split(/[\034\s]+/, $sources{$program})) { - $source_dict{$source} = 1; - } - for $source (@cleanfiles) { - $source_dict{$source} = 0; - } - for $source (keys %source_dict) { - next if (!$source); - if ($source_dict{$source}) { - # sanity check - if (! -f $source) { - print STDERR "Error: $source is listed in a _SOURCE line in $printname, but doesn't exist yet. Put it in DISTCLEANFILES!\n"; - } else { - $target_adds{"\$(srcdir)/$source"} .= $important{$program}; - } - } - } - } - } - if ($cleanMoc) { - # Always add dist clean tag - # Add extra *.moc.cpp files created for USE_AUTOMOC because they - # aren't included in the normal *.moc clean rules. - appendLines ("$cleantarget-metasources:\n\t-rm -f $cleanMoc\n"); - $target_adds{"$cleantarget-am"} .= "$cleantarget-metasources "; - } - - tag_DIST() unless ($kdeopts{"noautodist"}); - - if ($idl_output) { - appendLines ("$cleantarget-idl:\n\t-rm -f $idl_output\n"); - $target_adds{"$cleantarget-am"} .= "$cleantarget-idl "; - } - - if ($ui_output) { - appendLines ("$cleantarget-ui:\n\t-rm -f $ui_output\n"); - $target_adds{"$cleantarget-am"} .= "$cleantarget-ui "; - } - - if ($closure_output) { - appendLines ("$cleantarget-closures:\n\t-rm -f $closure_output\n"); - $target_adds{"$cleantarget-am"} .= "$cleantarget-closures "; - } - - if ($MakefileData =~ /\nKDE_LANG\s*=\s*(\S*)\s*\n/) { - $kdelang = '$(KDE_LANG)' - } else { - $kdelang = ''; - } - - tag_POFILES (); # language rules for po directory - tag_DOCFILES (); # language rules for doc directories - tag_LOCALINSTALL(); # add $(DESTDIR) before all kde_ dirs - tag_ICON(); - tag_SUBDIRS(); - - my $tmp = "force-reedit:\n"; - $tmp .= "\t$automkCall\n\tcd \$(top_srcdir) && perl $thisProg $printname\n\n"; - appendLines($tmp); - - make_meta_classes(); - tag_COMPILE_FIRST(); - tag_FINAL() if (!$kdeopts{"nofinal"}); - - my $final_lines = "final:\n\t\$(MAKE) "; - my $final_install_lines = "final-install:\n\t\$(MAKE) "; - my $nofinal_lines = "no-final:\n\t\$(MAKE) "; - my $nofinal_install_lines = "no-final-install:\n\t\$(MAKE) "; - - foreach $program (@programs) { - - my $lookup = "$program\_OBJECTS.*=[^\n]*"; - - my $new = ""; - - my @list = split(/[\034\s]+/, $realObjs{$program}); - - if (!$kdeopts{"nofinal"} && @list > 1 && $finalObjs{$program}) { - - $new .= "$program\_final\_OBJECTS = " . $finalObjs{$program}; - $new .= "\n$program\_nofinal\_OBJECTS = " . $realObjs{$program}; - $new .= "\n\@KDE_USE_FINAL_FALSE\@$program\_OBJECTS = \$($program\_nofinal\_OBJECTS)"; - $new .= "\n\@KDE_USE_FINAL_TRUE\@$program\_OBJECTS = \$($program\_final\_OBJECTS)"; - - $final_lines .= "$program\_OBJECTS=\"\$($program\_final_OBJECTS)\" "; - $final_install_lines .= "$program\_OBJECTS=\"\$($program\_final_OBJECTS)\" "; - $nofinal_lines .= "$program\_OBJECTS=\"\$($program\_nofinal\_OBJECTS)\" "; - $nofinal_install_lines .= "$program\_OBJECTS=\"\$($program\_nofinal_OBJECTS)\" "; - } else { - $new = "$program\_OBJECTS = " . $realObjs{$program}; - } - substituteLine ($lookup, $new); - } - appendLines($final_lines . "all-am"); - appendLines($final_install_lines . "install-am"); - appendLines($nofinal_lines . "all-am"); - appendLines($nofinal_install_lines . "install-am"); - - my $lookup = 'DEP_FILES\s*=([^\n]*)'; - if ($MakefileData =~ /\n$lookup\n/o) { - $depfiles = $1; - - if ($dep_finals) { - $lines = "\@KDE_USE_FINAL_TRUE\@DEP_FILES = $dep_files $dep_finals \034\t$depfiles\n"; - $lines .= "\@KDE_USE_FINAL_FALSE\@DEP_FILES = $dep_files $depfiles\n"; - } else { - $lines = "DEP_FILES = $dep_files $depfiles\n"; - } - substituteLine($lookup, $lines); - } - - my $cvs_lines = "cvs-clean:\n"; - $cvs_lines .= "\t\$(MAKE) admindir=\$(top_srcdir)/admin -f \$(top_srcdir)/admin/Makefile.common cvs-clean\n"; - appendLines($cvs_lines); - - $cvs_lines = "kde-rpo-clean:\n"; - $cvs_lines .= "\t-rm -f *.rpo\n"; - appendLines($cvs_lines); - $target_adds{"clean"} .= "kde-rpo-clean "; - - my %target_dels = ("install-data-am" => ""); - - # some strange people like to do a install-exec, and expect that also - # all modules are installed. automake doesn't know this, so we need to move - # this here from install-data to install-exec. - if ($MakefileData =~ m/\nkde_module_LTLIBRARIES\s*=/) { - $target_adds{"install-exec-am"} .= "install-kde_moduleLTLIBRARIES "; - $target_dels{"install-data-am"} .= "install-kde_moduleLTLIBRARIES "; - $target_adds{"install-data-am"} .= " "; - } - - my $lines = ""; - - foreach $add (keys %target_adds) { - my $lookup = quotemeta($add) . ':([^\n]*)'; - if ($MakefileData =~ /\n$lookup\n/) { - my $newlines = $1; - my $oldlines = $lookup; - if (defined $target_dels{$add}) { - foreach $del (split(' ', $target_dels{$add})) { - $newlines =~ s/\s*$del\s*/ /g; - } - } - substituteLine($oldlines, "$add: " . $target_adds{$add} . $newlines); - } else { - $lines .= "$add: " . $target_adds{$add} . "\n"; - } - } - if ($lines) { - appendLines($lines); - } - - my $found = 1; - - while ($found) { - if ($MakefileData =~ m/\n(.*)\$\(CXXFLAGS\)(.*)\n/) { - my $vor = $1; # "vor" means before in German - my $nach = $2; # "nach" means after in German - my $lookup = quotemeta("$1\$(CXXFLAGS)$2"); - my $replacement = "$1\$(KCXXFLAGS)$2"; - $MakefileData =~ s/$lookup/$replacement/; - $lookup =~ s/\\\$\\\(CXXFLAGS\\\)/\\\$\\\(KCXXFLAGS\\\)/; - $replacement = "$vor\$(KCXXFLAGS) \$(KDE_CXXFLAGS)$nach"; - substituteLine($lookup, $replacement); - } else { - $found = 0; - } - } - - if($foreign_libtool == 0) { - $lookup = '(\n[^#].*\$\(LIBTOOL\) --mode=link) (\$\(CXXLD\).*\$\(KCXXFLAGS\))'; - - if ($MakefileData =~ m/$lookup/ ) { - $MakefileData =~ s/$lookup/$1 --tag=CXX $2/; - } - - $lookup = '(\n[^#].*\$\(LIBTOOL\) --mode=compile)\s+(\$\(CXX\)\s+)'; - if ($MakefileData =~ m/$lookup/ ) { - $MakefileData =~ s/$lookup/$1 --tag=CXX $2/; - } - } - - $MakefileData =~ s/\$\(KCXXFLAGS\)/\$\(CXXFLAGS\)/g; - - $lookup = '(.*)cp -pr \$\$/\$\$file \$\(distdir\)/\$\$file(.*)'; - if ($MakefileData =~ m/\n$lookup\n/) { - substituteLine($lookup, "$1cp -pr \$\$d/\$\$file \$(distdir)/\$\$file$2"); - } - - # Always update the Makefile.in - updateMakefile (); - return; -} - -#----------------------------------------------------------------------------- - -# Beware: This procedure is not complete. E.g. it also parses lines -# containing a '=' in rules (for instance setting shell vars). For our -# usage this us enough, though. -sub read_variables () -{ - while ($MakefileData =~ /\n\s*(\S+)\s*=([^\n]*)/g) { - $varcontent{$1} = $2; - } -} - -# Check to see whether we should process this make file. -# This is where we look for tags that we need to process. -# A small amount of initialising on the tags is also done here. -# And of course we open and/or create the needed make files. -sub initialise () -{ - if (! -r "Makefile.am") { - print STDOUT "found Makefile.in without Makefile.am\n" if ($verbose); - return 0; - } - - # Checking for files to process... - open (FILEIN, $makefile) - || die "Could not open $makefileDir/$makefile: $!\n"; - # Read the file - # stat(FILEIN)[7] might look more elegant, but is slower as it - # requires stat'ing the file - seek(FILEIN, 0, 2); - my $fsize = tell(FILEIN); - seek(FILEIN, 0, 0); - read FILEIN, $MakefileData, $fsize; - close FILEIN; - print "DOS CRLF within $makefileDir/$makefile!\n" if($MakefileData =~ y/\r//d); - - # Remove the line continuations, but keep them marked - # Note: we lose the trailing spaces but that's ok. - $MakefileData =~ s/\\\s*\n\s*/\034/g; - - # If we've processed the file before... - restoreMakefile () if ($MakefileData =~ /$progId/); - - foreach $dir (@foreignfiles) { - if (substr($makefileDir,0,length($dir)) eq $dir) { - return 0; - } - } - - %kdeopts = (); - $kdeopts{"foreign"} = 0; - $kdeopts{"qtonly"} = 0; - $kdeopts{"noautodist"} = 0; - $kdeopts{"foreign-libtool"} = $foreign_libtool; - $kdeopts{"nofinal"} = !$use_final; # default - - read_variables(); - - if ($MakefileData =~ /\nKDE_OPTIONS\s*=\s*([^\n]*)\n/) { - local @kde_options = split(/[\s\034]/, $1); - if (grep(/^foreign$/, @kde_options)) { - push(@foreignfiles, $makefileDir . "/"); - return 0; # don't touch me - } - for $opt (@kde_options) { - if (!defined $kdeopts{$opt}) { - print STDERR "Warning: unknown option $opt in $printname\n"; - } else { - $kdeopts{$opt} = 1; - } - } - } - - # Look for the tags that mean we should process this file. - $metasourceTags = 0; - $metasourceTags++ while ($MakefileData =~ /\n[^=\#]*METASOURCES\s*=/g); - - my $pofileTag = 0; - $pofileTag++ while ($MakefileData =~ /\nPOFILES\s*=/g); - if ($pofileTag > 1) - { - print STDERR "Error: Only one POFILES tag allowed\n"; - $errorflag = 1; - } - - while ($MakefileData =~ /\n\.SUFFIXES:([^\n]+)\n/g) { - my @list=split(' ', $1); - foreach $ext (@list) { - if ($ext =~ /^\.$cppExt$/) { - $cxxsuffix = $ext; - $cxxsuffix =~ s/\.//g; - print STDOUT "will use suffix $cxxsuffix\n" if ($verbose); - last; - } - } - } - - while ($MakefileData =~ /\n(\S*)_OBJECTS\s*=[ \t\034]*([^\n]*)\n/g) { - - my $program = $1; - my $objs = $2; # safe them - - my $ocv = 0; - - my @objlist = split(/[\s\034]+/, $objs); - foreach $obj (@objlist) { - if ($obj =~ /(\S*)\$\((\S+)\)/ ) { - my $pre = $1; - my $variable = $2; - if ($pre eq '' && exists($varcontent{$variable})) { - my @addlist = split(/[\s\034]+/, $varcontent{$variable}); - push(@objlist, @addlist); - } elsif ($variable !~ 'OBJEXT') { - $ocv = 1; - } - } - } - - next if ($ocv); - - $program =~ s/^am_// if ($program =~ /^am_/); - - my $sourceprogram = $program; - $sourceprogram =~ s/\@am_/\@/ if($sourceprogram =~ /^.*\@am_.+/); - - print STDOUT "found program $program\n" if ($verbose); - push(@programs, $program); - - $realObjs{$program} = $objs; - - if ($MakefileData =~ /\n$sourceprogram\_SOURCES\s*=\s*(.*)\n/) { - $sources{$program} = $1; - } - else { - $sources{$program} = ""; - print STDERR "found program with no _SOURCES: $program\n"; - } - - my $realprogram = $program; - $realprogram =~ s/_/\\./g; # unmask to regexp - if ($MakefileData =~ /\n($realprogram)(\$\(EXEEXT\)?)?:.*\$\($program\_OBJECTS\)/) { - $realname{$program} = $1; - } else { - # not standard Makefile - nothing to worry about - $realname{$program} = ""; - } - } - - my $lookup = '\nDEPDIR\s*=.*'; - if ($MakefileData !~ /($lookup)\n/o) { - $lookup = '\nbindir\s*=.*'; - if ($MakefileData =~ /($lookup)\n/) { - substituteLine ($lookup, "DEPDIR = .deps\n$1"); - } - } - - my @marks = ('MAINTAINERCLEANFILES', 'CLEANFILES', 'DISTCLEANFILES'); - foreach $mark (@marks) { - while ($MakefileData =~ /\n($mark)\s*=\s*([^\n]*)/g) { - foreach $file (split('[\034\s]', $2)) { - $file =~ s/\.\///; - push(@cleanfiles, $file); - } - } - } - - my $localTag = 0; - $localTag++ if ($MakefileData =~ /\ninstall-\S+-local:/); - - return (!$errorflag); -} - -#----------------------------------------------------------------------------- - -# Gets the list of user defined directories - relative to $srcdir - where -# header files could be located. -sub tag_META_INCLUDES () -{ - my $lookup = '[^=\n]*META_INCLUDES\s*=\s*(.*)'; - return 1 if ($MakefileData !~ /($lookup)\n/o); - print STDOUT "META_INCLUDE processing <$1>\n" if ($verbose); - - my $headerStr = $2; - removeLine ($lookup, $1); - - $headerStr =~ tr/\034/ /; - my @headerlist = split(' ', $headerStr); - - foreach $dir (@headerlist) - { - $dir =~ s#\$\(srcdir\)#.#; - if (! -d $dir) - { - print STDERR "Warning: $dir can't be found. ", - "Must be a relative path to \$(srcdir)\n"; - } - else - { - push (@headerdirs, $dir); - } - } - - return 0; -} - -#----------------------------------------------------------------------------- - -sub tag_FINAL() -{ - my @final_names = (); - - foreach $program (@programs) { - - if ($sources{$program} =~ /\(/) { - print STDOUT "found ( in $program\_SOURCES. skipping\n" if ($verbose); - next; - } - - my $mocs = ""; # Moc files (in this program) - my $moc_cpp_added = 0; # If we added some .moc.cpp files, due to - # no other .cpp file including the .moc one. - - my @progsources = split(/[\s\034]+/, $sources{$program}); - my %shash = (); - @shash{@progsources} = 1; # we are only interested in the existence - my %sourcelist = (); - - foreach $source (@progsources) { - my $suffix = $source; - $suffix =~ s/^.*\.([^\.]+)$/$1/; - - $sourcelist{$suffix} .= $source . " "; - } - foreach my $mocFile (keys (%globalmocs)) - { - my ($dir, $hFile, $cppFile) = split ("\035", $globalmocs{$mocFile}, 3); - if (defined ($cppFile)) { - $mocs .= " $mocFile.moc" if exists $shash{$cppFile}; - } else { - $sourcelist{$cxxsuffix} .= $mocFile . ".moc." . $cxxsuffix; - $moc_cpp_added = 1; - } - } - foreach $suffix (keys %sourcelist) { - - # See if this file contains c++ code. (i.e., just check the file's suffix against c++ extensions) - my $suffix_is_cxx = 0; - if($suffix =~ /($cppExt)$/) { - $cxxsuffix = $1; - $suffix_is_cxx = 1; - } - - my $mocfiles_in = ($suffix eq $cxxsuffix) && $moc_cpp_added; - - my @sourcelist = split(/[\s\034]+/, $sourcelist{$suffix}); - - if ((@sourcelist == 1 && !$mocfiles_in) || $suffix_is_cxx != 1 ) { - - # we support IDL on our own - if ($suffix eq "skel" || $suffix =~ /^stub/ || $suffix =~ /^signals/ - || $suffix eq "h" || $suffix eq "ui" ) { - next; - } - - foreach $file (@sourcelist) { - - $file =~ s/\Q$suffix\E$//; - - $finalObjs{$program} .= $file; - if ($program =~ /_la$/) { - $finalObjs{$program} .= "lo "; - } else { - $finalObjs{$program} .= "o "; - } - } - next; # suffix - } - - my $source_deps = ""; - foreach $source (@sourcelist) { - if (-f $source) { - $source_deps .= " \$(srcdir)/$source"; - } else { - $source_deps .= " $source"; - } - } - - $handling = "$program.all_$suffix.$suffix: \$(srcdir)/Makefile.in" . $source_deps . " " . join(' ', $mocs) . "\n"; - $handling .= "\t\@echo 'creating $program.all_$suffix.$suffix ...'; \\\n"; - $handling .= "\trm -f $program.all_$suffix.files $program.all_$suffix.final; \\\n"; - $handling .= "\techo \"#define KDE_USE_FINAL 1\" >> $program.all_$suffix.final; \\\n"; - $handling .= "\tfor file in " . $sourcelist{$suffix} . "; do \\\n"; - $handling .= "\t echo \"#include \\\"\$\$file\\\"\" >> $program.all_$suffix.files; \\\n"; - $handling .= "\t test ! -f \$\(srcdir\)/\$\$file || egrep '^#pragma +implementation' \$\(srcdir\)/\$\$file >> $program.all_$suffix.final; \\\n"; - $handling .= "\tdone; \\\n"; - $handling .= "\tcat $program.all_$suffix.final $program.all_$suffix.files > $program.all_$suffix.$suffix; \\\n"; - $handling .= "\trm -f $program.all_$suffix.final $program.all_$suffix.files\n"; - - appendLines($handling); - - push(@final_names, "$program.all_$suffix.$suffix"); - my $finalObj = "$program.all_$suffix."; - if ($program =~ /_la$/) { - $finalObj .= "lo"; - } else { - $finalObj .= "o"; - } - $finalObjs{$program} .= $finalObj . " "; - } - } - - if (!$kdeopts{"nofinal"} && @final_names >= 1) { - # add clean-final target - my $lines = "$cleantarget-final:\n"; - $lines .= "\t-rm -f " . join(' ', @final_names) . "\n" if (@final_names); - appendLines($lines); - $target_adds{"$cleantarget-am"} .= "$cleantarget-final "; - - foreach $finalfile (@final_names) { - $finalfile =~ s/\.[^.]*$/.P/; - $dep_finals .= " \$(DEPDIR)/$finalfile"; - } - } -} - -#----------------------------------------------------------------------------- - -sub tag_COMPILE_FIRST() -{ - foreach $program (@programs) { - my $lookup = "$program" . '_COMPILE_FIRST\s*=\s*(.*)'; - if ($MakefileData =~ m/\n$lookup\n/) { - my @compilefirst = split(/[\s\034]+/, $1); - my @progsources = split(/[\s\034]+/, $sources{$program}); - my %donesources = (); - $handling = ""; - foreach $source (@progsources) { - my @deps = (); - my $sdeps = ""; - if (-f $source) { - $sdeps = "\$(srcdir)/$source"; - } else { - $sdeps = "$source"; - } - foreach $depend (@compilefirst) { - next if ($source eq $depend); - # avoid cyclic dependencies - next if defined($donesources{$depend}); - push @deps, $depend; - } - $handling .= "$sdeps: " . join(' ', @deps) . "\n" if (@deps); - $donesources{$source} = 1; - } - appendLines($handling) if (length($handling)); - } - } -} - -#----------------------------------------------------------------------------- - - -# Organises the list of headers that we'll use to produce moc files -# from. -sub tag_METASOURCES () -{ - local @newObs = (); # here we add to create object files - local @deped = (); # here we add to create moc files - local $mocExt = ".moc"; - local %mocFiles = (); - - my $line = ""; - my $postEqual = ""; - - my $lookup; - my $found = ""; -#print "$program: tag_METASOURCES\n"; - if ($metasourceTags > 1) { - $lookup = $program . '_METASOURCES\s*=\s*(.*)'; - return 1 if ($MakefileData !~ /\n($lookup)\n/); - $found = $1; - } else { - $lookup = $program . '_METASOURCES\s*=\s*(.*)'; - if ($MakefileData !~ /\n($lookup)\n/) { - $lookup = 'METASOURCES\s*=\s*(.*)'; - return 1 if ($MakefileData !~ /\n($lookup)\n/o); - $found = $1; - $metasourceTags = 0; # we can use the general target only once - } else { - $found = $1; - } - } - print STDOUT "METASOURCE processing <$found>)\n" if ($verbose); - - $postEqual = $found; - $postEqual =~ s/[^=]*=//; - - removeLine ($lookup, $found); - - # Always find the header files that could be used to "moc" - return 1 if (findMocCandidates ()); - - if ($postEqual =~ /AUTO\s*(\S*)|USE_AUTOMOC\s*(\S*)/) - { - print STDERR "$printname: the argument for AUTO|USE_AUTOMOC is obsolete" if ($+); - $mocExt = ".moc.$cxxsuffix"; - $haveAutomocTag = 1; - } - else - { - # Not automoc so read the list of files supplied which - # should be .moc files. - - $postEqual =~ tr/\034/ /; - - # prune out extra headers - This also checks to make sure that - # the list is valid. - pruneMocCandidates ($postEqual); - } - - checkMocCandidates (); - - if (@newObs) { - my $ext = ($program =~ /_la$/) ? ".moc.lo " : ".moc.o "; - $realObjs{$program} .= "\034" . join ($ext, @newObs) . $ext; - $depedmocs{$program} = join (".moc.$cxxsuffix " , @newObs) . ".moc.$cxxsuffix"; - foreach $file (@newObs) { - $dep_files .= " \$(DEPDIR)/$file.moc.P" if($dep_files !~/$file.moc.P/); - } - } - if (@deped) { - $depedmocs{$program} .= " "; - $depedmocs{$program} .= join('.moc ', @deped) . ".moc"; - $depedmocs{$program} .= " "; - } - addMocRules (); - @globalmocs{keys %mocFiles}=values %mocFiles; -} - -#----------------------------------------------------------------------------- - -# Returns 0 if the line was processed - 1 otherwise. -# Errors are logged in the global $errorflags -sub tag_AUTOMAKE () -{ - my $lookup = '.*cd \$\(top_srcdir\)\s+&&[\s\034]+\$\(AUTOMAKE\)(.*)'; - return 1 if ($MakefileData !~ /\n($lookup)\n/); - print STDOUT "AUTOMAKE processing <$1>\n" if ($verbose); - - my $newLine = $1."\n\tcd \$(top_srcdir) && perl $thisProg $printname"; - substituteLine ($lookup, $newLine); - $automkCall = $1; - return 0; -} - -#----------------------------------------------------------------------------- - -sub handle_TOPLEVEL() -{ - my $pofiles = ""; - my @restfiles = (); - opendir (THISDIR, "."); - foreach $entry (readdir(THISDIR)) { - next if (-d $entry); - - next if ($entry eq "CVS" || $entry =~ /^\./ || $entry =~ /^Makefile/ || $entry =~ /~$/ || $entry =~ /^\#.*\#$/ || $entry =~ /.gmo$/); - - if ($entry =~ /\.po$/) { - next; - } - push(@restfiles, $entry); - } - closedir (THISDIR); - - if (@restfiles) { - $target_adds{"install-data-am"} .= "install-nls-files "; - $lines = "install-nls-files:\n"; - $lines .= "\t\$(mkinstalldirs) \$(DESTDIR)\$(kde_locale)/$kdelang\n"; - for $file (@restfiles) { - $lines .= "\t\$(INSTALL_DATA) \$\(srcdir\)/$file \$(DESTDIR)\$(kde_locale)/$kdelang/$file\n"; - } - $target_adds{"uninstall"} .= "uninstall-nls-files "; - $lines .= "uninstall-nls-files:\n"; - for $file (@restfiles) { - $lines .= "\t-rm -f \$(DESTDIR)\$(kde_locale)/$kdelang/$file\n"; - } - appendLines($lines); - } - - return 0; -} - -#----------------------------------------------------------------------------- - -sub tag_SUBDIRS () -{ - if ($MakefileData !~ /\nSUBDIRS\s*=\s*\$\(AUTODIRS\)\s*\n/) { - return 1; - } - - my $subdirs = "."; - - opendir (THISDIR, "."); - foreach $entry (readdir(THISDIR)) { - next if ($entry eq "CVS" || $entry =~ /^\./); - if (-d $entry && -f $entry . "/Makefile.am") { - $subdirs .= " $entry"; - next; - } - } - closedir (THISDIR); - - my $lines = "SUBDIRS =$subdirs\n"; - substituteLine('SUBDIRS\s*=.*', $lines); - return 0; -} - -sub tag_IDLFILES () -{ - my @psources = split(/[\034\s]+/, $sources{$program}); - my $dep_lines = ""; - my @cppFiles = (); - - foreach $source (@psources) { - - my $skel = ($source =~ m/\.skel$/); - my $stub = ($source =~ m/\.stub$/); - my $signals = ($source =~ m/\.signals$/); - - if ($stub || $skel || $signals) { - - my $qs = quotemeta($source); - $sources{$program} =~ s/$qs//; - $sources_changed{$program} = 1; - - print STDOUT "adding IDL file $source\n" if ($verbose); - - $source =~ s/\.(stub|skel|signals)$//; - - my $sourcename; - - if ($skel) { - $sourcename = "$source\_skel"; - } elsif ($stub) { - $sourcename = "$source\_stub"; - } else { - $sourcename = "$source\_signals"; - } - - my $sourcedir = ''; - if (-f "$makefileDir/$source.h") { - $sourcedir = '$(srcdir)/'; - } else { - if ($MakefileData =~ /\n$source\_DIR\s*=\s*(\S+)\n/) { - $sourcedir = $1; - $sourcedir .= "/" if ($sourcedir !~ /\/$/); - } - } - - if ($allidls !~ /$source\_kidl/) { - - $dep_lines .= "$source.kidl: $sourcedir$source.h \$(DCOP_DEPENDENCIES)\n"; - $dep_lines .= "\t\$(DCOPIDL) $sourcedir$source.h > $source.kidl || ( rm -f $source.kidl ; /bin/false )\n"; - - $allidls .= $source . "_kidl "; - } - - if ($allidls !~ /$sourcename/) { - - $dep_lines_tmp = ""; - - if ($skel) { - $dep_lines .= "$sourcename.$cxxsuffix: $source.kidl\n"; - $dep_lines .= "\t\$(DCOPIDL2CPP) --c++-suffix $cxxsuffix --no-signals --no-stub $source.kidl\n"; - } elsif ($stub) { - $dep_lines_tmp = "\t\$(DCOPIDL2CPP) --c++-suffix $cxxsuffix --no-signals --no-skel $source.kidl\n"; - } else { # signals - $dep_lines_tmp = "\t\$(DCOPIDL2CPP) --c++-suffix $cxxsuffix --no-stub --no-skel $source.kidl\n"; - } - - if ($stub || $signals) { - $target_adds{"$sourcename.$cxxsuffix"} .= "$sourcename.h "; - $dep_lines .= "$sourcename.h: $source.kidl\n"; - $dep_lines .= $dep_lines_tmp; - } - - $allidls .= $sourcename . " "; - } - - $idlfiles{$program} .= $sourcename . " "; - - if ($program =~ /_la$/) { - $realObjs{$program} .= " $sourcename.lo"; - } else { - $realObjs{$program} .= " $sourcename.\$(OBJEXT)"; - } - $sources{$program} .= " $sourcename.$cxxsuffix"; - $sources_changed{$program} = 1; - $important{$program} .= "$sourcename.h " if (!$skel); - $idl_output .= "\\\n\t$sourcename.$cxxsuffix $sourcename.h $source.kidl "; - push(@cleanfiles, "$sourcename.$cxxsuffix"); - push(@cleanfiles, "$sourcename.h"); - push(@cleanfiles, "$sourcename.kidl"); - $dep_files .= " \$(DEPDIR)/$sourcename.P" if ($dep_files !~/$sourcename.P/); - } - } - if ($dep_lines) { - appendLines($dep_lines); - } - - if (0) { - my $lookup = "($program)"; - $lookup .= '(|\$\(EXEEXT\))'; - $lookup =~ s/\_/./g; - $lookup .= ":(.*..$program\_OBJECTS..*)"; - # $lookup = quotemeta($lookup); - if ($MakefileData =~ /\n$lookup\n/) { - - my $line = "$1$2: "; - foreach $file (split(' ', $idlfiles{$program})) { - $line .= "$file.$cxxsuffix "; - } - $line .= $3; - substituteLine($lookup, $line); - } else { - print STDERR "no built dependency found $lookup\n"; - } - } -} - -sub tag_UIFILES () -{ - my @psources = split(/[\034\s]+/, $sources{$program}); - my $dep_lines = ""; - my @depFiles = (); - - foreach $source (@psources) { - - if ($source =~ m/\.ui$/) { - - print STDERR "adding UI file $source\n" if ($verbose); - - my $qs = quotemeta($source); - $sources{$program} =~ s/$qs//; - $sources_changed{$program} = 1; - - $source =~ s/\.ui$//; - - my $sourcedir = ''; - if (-f "$makefileDir/$source.ui") { - $sourcedir = '$(srcdir)/'; - } - - if (!$uiFiles{$source}) { - - $dep_lines .= "$source.$cxxsuffix: $sourcedir$source.ui $source.h $source.moc\n"; - $dep_lines .= "\trm -f $source.$cxxsuffix\n"; - if (!$kdeopts{"qtonly"}) { - $dep_lines .= "\techo '#include ' > $source.$cxxsuffix\n"; - my ($mangled_source) = $source; - $mangled_source =~ s/[^A-Za-z0-9]/_/g; # get rid of garbage - $dep_lines .= "\t\$(UIC) -tr \${UIC_TR} -i $source.h $sourcedir$source.ui | sed -e \"s,\${UIC_TR}( \\\"\\\" ),QString::null,g\" | sed -e \"s,\${UIC_TR}( \\\"\\\"\\, \\\"\\\" ),QString::null,g\" | sed -e \"s,image\\([0-9][0-9]*\\)_data,img\\1_" . $mangled_source . ",g\" >> $source.$cxxsuffix || rm -f $source.$cxxsuffix\n"; - } else { - $dep_lines .= "\t\$(UIC) -i $source.h $sourcedir$source.ui > $source.$cxxsuffix || rm -f $source.$cxxsuffix\n"; - } - $dep_lines .= "\techo '#include \"$source.moc\"' >> $source.$cxxsuffix\n\n"; - $dep_lines .= "$source.h: $sourcedir$source.ui\n"; - $dep_lines .= "\t\$(UIC) -o $source.h $sourcedir$source.ui\n\n"; - $dep_lines .= "$source.moc: $source.h\n"; - $dep_lines .= "\t\$(MOC) $source.h -o $source.moc\n"; - - $uiFiles{$source} = 1; - $depedmocs{$program} .= " $source.moc"; - $globalmocs{$source} = "\035$source.h\035$source.cpp"; - } - - if ($program =~ /_la$/) { - $realObjs{$program} .= " $source.lo"; - } else { - $realObjs{$program} .= " $source.\$(OBJEXT)"; - } - $sources{$program} .= " $source.$cxxsuffix"; - $sources_changed{$program} = 1; - $important{$program} .= "$source.h "; - $ui_output .= "\\\n\t$source.$cxxsuffix $source.h $source.moc "; - push(@cleanfiles, "$source.$cxxsuffix"); - push(@cleanfiles, "source.h"); - push(@cleanfiles, "$source.moc"); - $dep_files .= " \$(DEPDIR)/$source.P" if($dep_files !~/$source.P/ ); - } - } - if ($dep_lines) { - appendLines($dep_lines); - } -} - -sub tag_ICON() -{ - my $lookup = '([^\s]*)_ICON\s*=\s*([^\n]*)'; - my $install = ""; - my $uninstall = ""; - - while ($MakefileData =~ /\n$lookup/og) { - my $destdir; - if ($1 eq "KDE") { - $destdir = "kde_icondir"; - } else { - $destdir = $1 . "dir"; - } - my $iconauto = ($2 =~ /AUTO\s*$/); - my @appnames = (); - if ( ! $iconauto ) { - my @_appnames = split(" ", $2); - print STDOUT "KDE_ICON processing <@_appnames>\n" if ($verbose); - foreach $appname (@_appnames) { - push(@appnames, quotemeta($appname)); - } - } else { - print STDOUT "KDE_ICON processing \n" if ($verbose); - } - - my @files = (); - opendir (THISDIR, "."); - foreach $entry (readdir(THISDIR)) { - next if ($entry eq "CVS" || $entry =~ /^\./ || $entry =~ /^Makefile/ || $entry =~ /~$/ || $entry =~ /^\#.*\#$/); - next if (! -f $entry); - if ( $iconauto ) - { - push(@files, $entry) - if ($entry =~ /\.xpm/ || $entry =~ /\.png/ || $entry =~ /\.mng/); - } else { - foreach $appname (@appnames) { - push(@files, $entry) - if ($entry =~ /-$appname\.xpm/ || $entry =~ /-$appname\.png/ || $entry =~ /-$appname\.mng/); - } - } - } - closedir (THISDIR); - - my %directories = (); - - foreach $file (@files) { - my $newfile = $file; - my $prefix = $file; - $prefix =~ s/\.(png|xpm|mng)$//; - my $appname = $prefix; - $appname =~ s/^[^-]+-// if ($appname =~ /-/) ; - $appname =~ s/^[^-]+-// if ($appname =~ /-/) ; - $appname = quotemeta($appname); - $prefix =~ s/$appname$//; - $prefix =~ s/-$//; - - $prefix = 'lo16-app' if ($prefix eq 'mini'); - $prefix = 'lo32-app' if ($prefix eq 'lo'); - $prefix = 'hi48-app' if ($prefix eq 'large'); - $prefix .= '-app' if ($prefix =~ m/^...$/); - - my $type = $prefix; - $type =~ s/^.*-([^-]+)$/$1/; - $prefix =~ s/^(.*)-[^-]+$/$1/; - - my %type_hash = - ( - 'action' => 'actions', - 'app' => 'apps', - 'device' => 'devices', - 'filesys' => 'filesystems', - 'mime' => 'mimetypes' - ); - - if (! defined $type_hash{$type} ) { - print STDERR "unknown icon type $type in $printname ($file)\n"; - next; - } - - my %dir_hash = - ( - 'los' => 'locolor/16x16', - 'lom' => 'locolor/32x32', - 'him' => 'hicolor/32x32', - 'hil' => 'hicolor/48x48', - 'lo16' => 'locolor/16x16', - 'lo22' => 'locolor/22x22', - 'lo32' => 'locolor/32x32', - 'hi16' => 'hicolor/16x16', - 'hi22' => 'hicolor/22x22', - 'hi32' => 'hicolor/32x32', - 'hi48' => 'hicolor/48x48', - 'hi64' => 'hicolor/64x64', - 'hisc' => 'hicolor/scalable' - ); - - $newfile =~ s@.*-($appname\.(png|xpm|mng?))@$1@; - - if (! defined $dir_hash{$prefix}) { - print STDERR "unknown icon prefix $prefix in $printname\n"; - next; - } - - my $dir = $dir_hash{$prefix} . "/" . $type_hash{$type}; - if ($newfile =~ /-[^\.]/) { - my $tmp = $newfile; - $tmp =~ s/^([^-]+)-.*$/$1/; - $dir = $dir . "/" . $tmp; - $newfile =~ s/^[^-]+-//; - } - - if (!defined $directories{$dir}) { - $install .= "\t\$(mkinstalldirs) \$(DESTDIR)\$($destdir)/$dir\n"; - $directories{$dir} = 1; - } - - $install .= "\t\$(INSTALL_DATA) \$(srcdir)/$file \$(DESTDIR)\$($destdir)/$dir/$newfile\n"; - $uninstall .= "\t-rm -f \$(DESTDIR)\$($destdir)/$dir/$newfile\n"; - - } - } - - if (length($install)) { - $target_adds{"install-data-am"} .= "install-kde-icons "; - $target_adds{"uninstall-am"} .= "uninstall-kde-icons "; - appendLines("install-kde-icons:\n" . $install . "\nuninstall-kde-icons:\n" . $uninstall); - } -} - -sub handle_POFILES($$) -{ - my @pofiles = split(" ", $_[0]); - my $lang = $_[1]; - - # Build rules for creating the gmo files - my $tmp = ""; - my $allgmofiles = ""; - my $pofileLine = "POFILES ="; - foreach $pofile (@pofiles) - { - $pofile =~ /(.*)\.[^\.]*$/; # Find name minus extension - $tmp .= "$1.gmo: $pofile\n"; - $tmp .= "\trm -f $1.gmo; \$(GMSGFMT) -o $1.gmo \$(srcdir)/$pofile\n"; - $tmp .= "\ttest ! -f $1.gmo || touch $1.gmo\n"; - $allgmofiles .= " $1.gmo"; - $pofileLine .= " $1.po"; - } - appendLines ($tmp); - my $lookup = 'POFILES\s*=([^\n]*)'; - if ($MakefileData !~ /\n$lookup/o) { - appendLines("$pofileLine\nGMOFILES =$allgmofiles"); - } else { - substituteLine ($lookup, "$pofileLine\nGMOFILES =$allgmofiles"); - } - - if ($allgmofiles) { - - # Add the "clean" rule so that the maintainer-clean does something - appendLines ("clean-nls:\n\t-rm -f $allgmofiles\n"); - - $target_adds{"maintainer-clean"} .= "clean-nls "; - - $lookup = 'DISTFILES\s*=\s*(.*)'; - if ($MakefileData =~ /\n$lookup\n/o) { - $tmp = "DISTFILES = \$(GMOFILES) \$(POFILES) $1"; - substituteLine ($lookup, $tmp); - } - } - - $target_adds{"install-data-am"} .= "install-nls "; - - $tmp = "install-nls:\n"; - if ($lang) { - $tmp .= "\t\$(mkinstalldirs) \$(DESTDIR)\$(kde_locale)/$lang/LC_MESSAGES\n"; - } - $tmp .= "\t\@for base in "; - foreach $pofile (@pofiles) - { - $pofile =~ /(.*)\.[^\.]*$/; # Find name minus extension - $tmp .= "$1 "; - } - - $tmp .= "; do \\\n"; - if ($lang) { - $tmp .= "\t echo \$(INSTALL_DATA) \$\$base.gmo \$(DESTDIR)\$(kde_locale)/$lang/LC_MESSAGES/\$\$base.mo ;\\\n"; - $tmp .= "\t test ! -f \$\$base.gmo || \$(INSTALL_DATA) \$\$base.gmo \$(DESTDIR)\$(kde_locale)/$lang/LC_MESSAGES/\$\$base.mo ;\\\n" - } else { - $tmp .= "\t echo \$(INSTALL_DATA) \$\$base.gmo \$(DESTDIR)\$(kde_locale)/\$\$base/LC_MESSAGES/\$(PACKAGE).mo ;\\\n"; - $tmp .= "\t \$(mkinstalldirs) \$(DESTDIR)\$(kde_locale)/\$\$base/LC_MESSAGES ; \\\n"; - $tmp .= "\t test ! -f \$\$base.gmo || \$(INSTALL_DATA) \$\$base.gmo \$(DESTDIR)\$(kde_locale)/\$\$base/LC_MESSAGES/\$(PACKAGE).mo ;\\\n"; - } - $tmp .= "\tdone\n\n"; - appendLines ($tmp); - - $target_adds{"uninstall"} .= "uninstall-nls "; - - $tmp = "uninstall-nls:\n"; - foreach $pofile (@pofiles) - { - $pofile =~ /(.*)\.[^\.]*$/; # Find name minus extension - if ($lang) { - $tmp .= "\trm -f \$(DESTDIR)\$(kde_locale)/$lang/LC_MESSAGES/$1.mo\n"; - } else { - $tmp .= "\trm -f \$(DESTDIR)\$(kde_locale)/$1/LC_MESSAGES/\$(PACKAGE).mo\n"; - } - } - appendLines($tmp); - - $target_adds{"all"} .= "all-nls "; - - $tmp = "all-nls: \$(GMOFILES)\n"; - - appendLines($tmp); - - $target_adds{"distdir"} .= "distdir-nls "; - - $tmp = "distdir-nls:\$(GMOFILES)\n"; - $tmp .= "\tfor file in \$(POFILES); do \\\n"; - $tmp .= "\t cp \$(srcdir)/\$\$file \$(distdir); \\\n"; - $tmp .= "\tdone\n"; - $tmp .= "\tfor file in \$(GMOFILES); do \\\n"; - $tmp .= "\t cp \$(srcdir)/\$\$file \$(distdir); \\\n"; - $tmp .= "\tdone\n"; - - appendLines ($tmp); - - if (!$lang) { - appendLines("merge:\n\t\$(MAKE) -f \$(top_srcdir)/admin/Makefile.common package-merge POFILES=\"\${POFILES}\" PACKAGE=\${PACKAGE}\n\n"); - } - -} - -#----------------------------------------------------------------------------- - -# Returns 0 if the line was processed - 1 otherwise. -# Errors are logged in the global $errorflags -sub tag_POFILES () -{ - my $lookup = 'POFILES\s*=([^\n]*)'; - return 1 if ($MakefileData !~ /\n$lookup/o); - print STDOUT "POFILES processing <$1>\n" if ($verbose); - - my $tmp = $1; - - # make sure these are all gone. - if ($MakefileData =~ /\n\.po\.gmo:\n/) - { - print STDERR "Warning: Found old .po.gmo rules in $printname. New po rules not added\n"; - return 1; - } - - # Either find the pofiles in the directory (AUTO) or use - # only the specified po files. - my $pofiles = ""; - if ($tmp =~ /^\s*AUTO\s*$/) - { - opendir (THISDIR, "."); - $pofiles = join(" ", grep(/\.po$/, readdir(THISDIR))); - closedir (THISDIR); - print STDOUT "pofiles found = $pofiles\n" if ($verbose); - if (-f "charset" && -f "tdelibs.po") { - handle_TOPLEVEL(); - } - } - else - { - $tmp =~ s/\034/ /g; - $pofiles = $tmp; - } - return 1 if (!$pofiles); # Nothing to do - - handle_POFILES($pofiles, $kdelang); - - return 0; -} - -sub helper_LOCALINSTALL($) -{ - my $lookup = "\n" . $_[0] . ":"; - if ($MakefileData =~ /($lookup)/) { - - my $install = $MakefileData; - $install =~ s/\n/\035/g; - $install =~ s/.*\035$_[0]:[^\035]*\035//; - my $emptyline = 0; - while (! $emptyline) { - if ($install =~ /([^\035]*)\035(.*)/) { - local $line = $1; - $install = $2; - if ($line !~ /^\s*$/ && $line !~ /^(\@.*\@)*\t/) { - $emptyline = 1; - } else { - replaceDestDir($line); - } - } else { - $emptyline = 1; - } - } - } - -} - -sub tag_LOCALINSTALL () -{ - helper_LOCALINSTALL('install-exec-local'); - helper_LOCALINSTALL('install-data-local'); - helper_LOCALINSTALL('uninstall-local'); - - return 0; -} - -sub replaceDestDir($) { - local $line = $_[0]; - - if ( $line =~ /^\s*(\@.*\@)*\s*\$\(mkinstalldirs\)/ - || $line =~ /^\s*(\@.*\@)*\s*\$\(INSTALL\S*\)/ - || $line =~ /^\s*(\@.*\@)*\s*(-?rm.*) \S*$/) - { - $line =~ s/^(.*) ([^\s]+)\s*$/$1 \$(DESTDIR)$2/ if ($line !~ /\$\(DESTDIR\)/); - } - - if ($line ne $_[0]) { - $_[0] = quotemeta $_[0]; - substituteLine($_[0], $line); - } -} - -#--------------------------------------------------------------------------- -sub tag_CLOSURE () { - return if ($program !~ /_la$/); - - my $lookup = quotemeta($realname{$program}) . ":.*?\n\t.*?\\((.*?)\\) .*\n"; - $MakefileData =~ m/$lookup/; - return if ($1 !~ /CXXLINK/); - - if ($MakefileData !~ /\n$program\_LDFLAGS\s*=.*-no-undefined/ && - $MakefileData !~ /\n$program\_LDFLAGS\s*=.*KDE_PLUGIN/ ) { - print STDERR "Report: $program contains undefined in $printname\n" if ($program =~ /^lib/ && $dryrun); - return; - } - my $closure = $realname{$program} . ".closure"; - my $lines = "$closure: \$($program\_OBJECTS) \$($program\_DEPENDENCIES)\n"; - $lines .= "\t\@echo \"int main() {return 0;}\" > $program\_closure.$cxxsuffix\n"; - $lines .= "\t\@\$\(LTCXXCOMPILE\) -c $program\_closure.$cxxsuffix\n"; - $lines .= "\t\$\(CXXLINK\) $program\_closure.lo \$($program\_LDFLAGS) \$($program\_OBJECTS) \$($program\_LIBADD) \$(LIBS)\n"; - $lines .= "\t\@rm -f $program\_closure.* $closure\n"; - $lines .= "\t\@echo \"timestamp\" > $closure\n"; - $lines .= "\n"; - appendLines($lines); - $lookup = $realname{$program} . ": (.*)"; - if ($MakefileData =~ /\n$lookup\n/) { - $lines = "\@KDE_USE_CLOSURE_TRUE@". $realname{$program} . ": $closure $1"; - $lines .= "\n\@KDE_USE_CLOSURE_FALSE@" . $realname{$program} . ": $1"; - substituteLine($lookup, $lines); - } - $closure_output .= " $closure"; -} - -sub tag_DIST () { - my %foundfiles = (); - opendir (THISDIR, "."); - foreach $entry (readdir(THISDIR)) { - next if ($entry eq "CVS" || $entry =~ /^\./ || $entry eq "Makefile" || $entry =~ /~$/ || $entry =~ /^\#.*\#$/); - next if (! -f $entry); - next if ($entry =~ /\.moc/ || $entry =~ /\.moc.$cppExt$/ || $entry =~ /\.lo$/ || $entry =~ /\.la$/ || $entry =~ /\.o/); - next if ($entry =~ /.+meta_unload.$cppExt$/ || $entry =~ /\.all_$cppExt\.$cppExt$/); - $foundfiles{$entry} = 1; - } - closedir (THISDIR); - - # doing this for MAINTAINERCLEANFILES would be wrong - my @marks = ("EXTRA_DIST", "DIST_COMMON", '\S*_SOURCES', '\S*_HEADERS', 'CLEANFILES', 'DISTCLEANFILES', '\S*_OBJECTS'); - foreach $mark (@marks) { - while ($MakefileData =~ /\n($mark)\s*=\s*([^\n]*)/g) { - foreach $file (split('[\034\s]', $2)) { - $file =~ s/\.\///; - $foundfiles{$file} = 0 if (defined $foundfiles{$file}); - } - } - } - my @files = ("Makefile", "config.cache", "config.log", "stamp-h", - "stamp-h1", "stamp-h1", "config.h", "Makefile", - "config.status", "config.h", "libtool", "core" ); - foreach $file (@files) { - $foundfiles{$file} = 0 if (defined $foundfiles{$file}); - } - - my $KDE_DIST = ""; - foreach $file (keys %foundfiles) { - if ($foundfiles{$file} == 1) { - $KDE_DIST .= "$file "; - } - } - if ($KDE_DIST) { - print "KDE_DIST $printname $KDE_DIST\n" if ($verbose); - - my $lookup = "DISTFILES *=(.*)"; - if ($MakefileData =~ /\n$lookup\n/o) { - substituteLine($lookup, "KDE_DIST=$KDE_DIST\n\nDISTFILES=$1 \$(KDE_DIST)\n"); - } - } -} - -#----------------------------------------------------------------------------- -# Returns 0 if the line was processed - 1 otherwise. -# Errors are logged in the global $errorflags -sub tag_DOCFILES () -{ - $target_adds{"all"} .= "docs-am "; - - my $lookup = 'KDE_DOCS\s*=\s*([^\n]*)'; - goto nodocs if ($MakefileData !~ /\n$lookup/o); - print STDOUT "KDE_DOCS processing <$1>\n" if ($verbose); - - my $tmp = $1; - - # Either find the files in the directory (AUTO) or use - # only the specified po files. - my $files = ""; - my $appname = $tmp; - $appname =~ s/^(\S*)\s*.*$/$1/; - if ($appname =~ /AUTO/) { - $appname = basename($makefileDir); - if ("$appname" eq "en") { - print STDERR "Error: KDE_DOCS = AUTO relies on the directory name. Yours is 'en' - you most likely want something else, e.g. KDE_DOCS = myapp\n"; - exit(1); - } - } - - if ($tmp !~ / - /) - { - opendir (THISDIR, "."); - foreach $entry (readdir(THISDIR)) { - next if ($entry eq "CVS" || $entry =~ /^\./ || $entry =~ /^Makefile/ || $entry =~ /~$/ || $entry =~ /^\#.*\#$/); - next if (! -f $entry); - $files .= "$entry "; - } - closedir (THISDIR); - print STDOUT "docfiles found = $files\n" if ($verbose); - } - else - { - $tmp =~ s/\034/ /g; - $tmp =~ s/^\S*\s*-\s*//; - $files = $tmp; - } - goto nodocs if (!$files); # Nothing to do - - if ($files =~ /(^| )index\.docbook($| )/) { - - my $lines = ""; - my $lookup = 'MEINPROC\s*='; - if ($MakefileData !~ /\n($lookup)/) { - $lines = "MEINPROC=/\$(kde_bindir)/meinproc\n"; - } - $lookup = 'KDE_XSL_STYLESHEET\s*='; - if ($MakefileData !~ /\n($lookup)/) { - $lines .= "KDE_XSL_STYLESHEET=/\$(kde_datadir)/ksgmltools2/customization/tde-chunk.xsl\n"; - } - $lookup = '\nindex.cache.bz2:'; - if ($MakefileData !~ /\n($lookup)/) { - $lines .= "index.cache.bz2: \$(srcdir)/index.docbook \$(KDE_XSL_STYLESHEET) $files\n"; - $lines .= "\t\@if test -n \"\$(MEINPROC)\"; then echo \$(MEINPROC) --check --cache index.cache.bz2 \$(srcdir)/index.docbook; \$(MEINPROC) --check --cache index.cache.bz2 \$(srcdir)/index.docbook; fi\n"; - $lines .= "\n"; - } - - $lines .= "docs-am: index.cache.bz2\n"; - $lines .= "\n"; - $lines .= "install-docs: docs-am install-nls\n"; - $lines .= "\t\$(mkinstalldirs) \$(DESTDIR)\$(kde_htmldir)/$kdelang/$appname\n"; - $lines .= "\t\@if test -f index.cache.bz2; then \\\n"; - $lines .= "\techo \$(INSTALL_DATA) index.cache.bz2 \$(DESTDIR)\$(kde_htmldir)/$kdelang/$appname/; \\\n"; - $lines .= "\t\$(INSTALL_DATA) index.cache.bz2 \$(DESTDIR)\$(kde_htmldir)/$kdelang/$appname/; \\\n"; - $lines .= "\tfi\n"; - $lines .= "\t-rm -f \$(DESTDIR)\$(kde_htmldir)/$kdelang/$appname/common\n"; - $lines .= "\t\$(LN_S) \$(kde_libs_htmldir)/$kdelang/common \$(DESTDIR)\$(kde_htmldir)/$kdelang/$appname/common\n"; - - $lines .= "\n"; - $lines .= "uninstall-docs:\n"; - $lines .= "\t-rm -rf \$(kde_htmldir)/$kdelang/$appname\n"; - $lines .= "\n"; - $lines .= "clean-docs:\n"; - $lines .= "\t-rm -f index.cache.bz2\n"; - $lines .= "\n"; - $target_adds{"install-data-am"} .= "install-docs "; - $target_adds{"uninstall"} .= "uninstall-docs "; - $target_adds{"clean-am"} .= "clean-docs "; - appendLines ($lines); - } else { - appendLines("docs-am: $files\n"); - } - - $target_adds{"install-data-am"} .= "install-nls "; - $target_adds{"uninstall"} .= "uninstall-nls "; - - $tmp = "install-nls:\n"; - $tmp .= "\t\$(mkinstalldirs) \$(DESTDIR)\$(kde_htmldir)/$kdelang/$appname\n"; - $tmp .= "\t\@for base in $files; do \\\n"; - $tmp .= "\t echo \$(INSTALL_DATA) \$\$base \$(DESTDIR)\$(kde_htmldir)/$kdelang/$appname/\$\$base ;\\\n"; - $tmp .= "\t \$(INSTALL_DATA) \$(srcdir)/\$\$base \$(DESTDIR)\$(kde_htmldir)/$kdelang/$appname/\$\$base ;\\\n"; - $tmp .= "\tdone\n"; - if ($appname eq 'common') { - $tmp .= "\t\@echo \"merging common and language specific dir\" ;\\\n"; - $tmp .= "\tif test ! -f \$(kde_htmldir)/en/common/tde-common.css; then echo 'no english docs found in \$(kde_htmldir)/en/common/'; exit 1; fi \n"; - $tmp .= "\t\@com_files=`cd \$(kde_htmldir)/en/common && echo *` ;\\\n"; - $tmp .= "\tcd \$(DESTDIR)\$(kde_htmldir)/$kdelang/common ;\\\n"; - $tmp .= "\tif test -n \"\$\$com_files\"; then for p in \$\$com_files ; do \\\n"; - $tmp .= "\t case \" $files \" in \\\n"; - $tmp .= "\t *\" \$\$p \"*) ;; \\\n"; - $tmp .= "\t *) test ! -f \$\$p && echo \$(LN_S) ../../en/common/\$\$p \$(DESTDIR)\$(kde_htmldir)/$kdelang/common/\$\$p && \$(LN_S) ../../en/common/\$\$p \$\$p ;; \\\n"; - $tmp .= "\t esac ; \\\n"; - $tmp .= "\tdone ; fi ; true\n"; - } - $tmp .= "\n"; - $tmp .= "uninstall-nls:\n"; - $tmp .= "\tfor base in $files; do \\\n"; - $tmp .= "\t rm -f \$(DESTDIR)\$(kde_htmldir)/$kdelang/$appname/\$\$base ;\\\n"; - $tmp .= "\tdone\n\n"; - appendLines ($tmp); - - $target_adds{"distdir"} .= "distdir-nls "; - - $tmp = "distdir-nls:\n"; - $tmp .= "\tfor file in $files; do \\\n"; - $tmp .= "\t cp \$(srcdir)/\$\$file \$(distdir); \\\n"; - $tmp .= "\tdone\n"; - - appendLines ($tmp); - - return 0; - - nodocs: - appendLines("docs-am:\n"); - return 1; -} - -#----------------------------------------------------------------------------- -# Find headers in any of the source directories specified previously, that -# are candidates for "moc-ing". -sub findMocCandidates () -{ - foreach $dir (@headerdirs) - { - my @list = (); - opendir (SRCDIR, "$dir"); - @hFiles = grep { /.+\.$hExt$/o && !/^\./ } readdir(SRCDIR); - closedir SRCDIR; - foreach $hf (@hFiles) - { - next if ($hf =~ /^\.\#/); - $hf =~ /(.*)\.[^\.]*$/; # Find name minus extension - next if ($uiFiles{$1}); - open (HFIN, "$dir/$hf") || die "Could not open $dir/$hf: $!\n"; - my $hfsize = 0; - seek(HFIN, 0, 2); - $hfsize = tell(HFIN); - seek(HFIN, 0, 0); - read HFIN, $hfData, $hfsize; - close HFIN; - # push (@list, $hf) if(index($hfData, "Q_OBJECT") >= 0); ### fast but doesn't handle //Q_OBJECT - if ( $hfData =~ /{([^}]*)Q_OBJECT/s ) { ## handle " { friend class blah; Q_OBJECT " - push (@list, $hf) unless $1 =~ m://[^\n]*Q_OBJECT[^\n]*$:s; ## handle "// Q_OBJECT" - } - } - # The assoc array of root of headerfile and header filename - foreach $hFile (@list) - { - $hFile =~ /(.*)\.[^\.]*$/; # Find name minus extension - if ($mocFiles{$1}) - { - print STDERR "Warning: Multiple header files found for $1\n"; - next; # Use the first one - } - $mocFiles{$1} = "$dir\035$hFile"; # Add relative dir - } - } - - return 0; -} - -#----------------------------------------------------------------------------- - -# The programmer has specified a moc list. Prune out the moc candidates -# list that we found based on looking at the header files. This generates -# a warning if the programmer gets the list wrong, but this doesn't have -# to be fatal here. -sub pruneMocCandidates ($) -{ - my %prunedMoc = (); - local @mocList = split(' ', $_[0]); - - foreach $mocname (@mocList) - { - $mocname =~ s/\.moc$//; - if ($mocFiles{$mocname}) - { - $prunedMoc{$mocname} = $mocFiles{$mocname}; - } - else - { - my $print = $makefileDir; - $print =~ s/^\Q$topdir\E\\//; - # They specified a moc file but we can't find a header that - # will generate this moc file. That's possible fatal! - print STDERR "Warning: No moc-able header file for $print/$mocname\n"; - } - } - - undef %mocFiles; - %mocFiles = %prunedMoc; -} - -#----------------------------------------------------------------------------- - -# Finds the cpp files (If they exist). -# The cpp files get appended to the header file separated by \035 -sub checkMocCandidates () -{ - my @cppFiles; - my $cpp2moc; # which c++ file includes which .moc files - my $moc2cpp; # which moc file is included by which c++ files - - return unless (keys %mocFiles); - opendir(THISDIR, ".") || return; - @cppFiles = grep { /.+\.$cppExt$/o && !/.+\.moc\.$cppExt$/o - && !/.+\.all_$cppExt\.$cppExt$/o - && !/^\./ } readdir(THISDIR); - closedir THISDIR; - return unless (@cppFiles); - my $files = join (" ", @cppFiles); - $cpp2moc = {}; - $moc2cpp = {}; - foreach $cxxf (@cppFiles) - { - open (CXXFIN, $cxxf) || die "Could not open $cxxf: $!\n"; - seek(CXXFIN, 0, 2); - my $cxxfsize = tell(CXXFIN); - seek(CXXFIN, 0, 0); - read CXXFIN, $cxxfData, $cxxfsize; - close CXXFIN; - while(($cxxfData =~ m/^[ \t]*\#include\s*[<\"](.*\.moc)[>\"]/gm)) { - $cpp2moc->{$cxxf}->{$1} = 1; - $moc2cpp->{$1}->{$cxxf} = 1; - } - } - foreach my $mocFile (keys (%mocFiles)) - { - @cppFiles = keys %{$moc2cpp->{"$mocFile.moc"}}; - if (@cppFiles == 1) { - $mocFiles{$mocFile} .= "\035" . $cppFiles[0]; - push(@deped, $mocFile); - } elsif (@cppFiles == 0) { - push (@newObs, $mocFile); # Produce new object file - next if ($haveAutomocTag); # This is expected... - # But this is an error we can deal with - let them know - print STDERR - "Warning: No c++ file that includes $mocFile.moc\n"; - } else { - # We can't decide which file to use, so it's fatal. Although as a - # guess we could use the mocFile.cpp file if it's in the list??? - print STDERR - "Error: Multiple c++ files that include $mocFile.moc\n"; - print STDERR "\t",join ("\t", @cppFiles),"\n"; - $errorflag = 1; - delete $mocFiles{$mocFile}; - # Let's continue and see what happens - They have been told! - } - } -} - -#----------------------------------------------------------------------------- - -# Add the rules for generating moc source from header files -# For Automoc output *.moc.cpp but normally we'll output *.moc -# (We must compile *.moc.cpp separately. *.moc files are included -# in the appropriate *.cpp file by the programmer) -sub addMocRules () -{ - my $cppFile; - my $hFile; - - foreach $mocFile (keys (%mocFiles)) - { - undef $cppFile; - ($dir, $hFile, $cppFile) = split ("\035", $mocFiles{$mocFile}, 3); - $dir =~ s#^\.#\$(srcdir)#; - if (defined ($cppFile)) - { - $cppFile =~ s,\.[^.]*$,,; - $target_adds{"$cppFile.o"} .= "$mocFile.moc "; - $target_adds{"$cppFile.lo"} .= "$mocFile.moc "; - appendLines ("$mocFile.moc: $dir/$hFile\n\t\$(MOC) $dir/$hFile -o $mocFile.moc\n"); - $cleanMoc .= " $mocFile.moc"; - } - else - { - appendLines ("$mocFile$mocExt: $dir/$hFile\n\t\$(MOC) $dir/$hFile -o $mocFile$mocExt\n"); - $cleanMoc .= " $mocFile$mocExt"; - } - } -} - -sub make_meta_classes () -{ - return if ($kdeopts{"qtonly"}); - - my $cppFile; - my $hFile; - my $moc_class_headers = ""; - foreach $program (@programs) { - my $mocs = ""; - my @progsources = split(/[\s\034]+/, $sources{$program}); - my @depmocs = split(' ', $depedmocs{$program}); - my %shash = (), %mhash = (); - @shash{@progsources} = 1; # we are only interested in the existence - @mhash{@depmocs} = 1; - - print STDOUT "program=$program\n" if ($verbose); - print STDOUT "psources=[".join(' ', keys %shash)."]\n" if ($verbose); - print STDOUT "depmocs=[".join(' ', keys %mhash)."]\n" if ($verbose); - print STDOUT "globalmocs=[".join(' ', keys(%globalmocs))."]\n" if ($verbose); - foreach my $mocFile (keys (%globalmocs)) - { - my ($dir, $hFile, $cppFile) = split ("\035", $globalmocs{$mocFile}, 3); - if (defined ($cppFile)) - { - $mocs .= " $mocFile.moc" if exists $shash{$cppFile}; - } - else - { - # Bah. This is the case, if no C++ file includes the .moc - # file. We make a .moc.cpp file for that. Unfortunately this - # is not included in the %sources hash, but rather is mentioned - # in %depedmocs. If the user wants to use AUTO he can't just - # use an unspecific METAINCLUDES. Instead he must use - # program_METAINCLUDES. Anyway, it's not working real nicely. - # E.g. Its not clear what happens if user specifies two - # METAINCLUDES=AUTO in the same Makefile.am. - $mocs .= " $mocFile.moc.$cxxsuffix" - if exists $mhash{$mocFile.".moc.$cxxsuffix"}; - } - } - if ($mocs) { - print STDOUT "==> mocs=[".$mocs."]\n" if ($verbose); - my $sourcename = $program."_meta_unload"; - my $ext = ($program =~ /_la$/) ? ".lo" : ".o"; - my $srcfile = $sourcename.".$cxxsuffix"; - my $objfile = $sourcename.$ext; - $moc_class_headers .= " $srcfile"; - my $appl; - $appl = "$srcfile: $mocs\n"; - $appl .= "\t\@echo 'creating $srcfile'\n"; - $appl .= "\t\@-rm -f $srcfile\n"; - $appl .= "\t\@if test \${kde_qtver} = 2; then \\\n"; - $appl .= "\t\techo 'static const char * _metalist_$program\[\] = {' > $srcfile ;\\\n"; - $appl .= "\t\tcat $mocs | grep 'char.*className' | "; - $appl .= "sed -e 's/.*[^A-Za-z0-9_:]\\([A-Za-z0-9_:]*\\)::className.*\$\$/\\\"\\1\\\",/' | sort | uniq >> $srcfile ;\\\n"; - $appl .= "\t\techo '0};' >> $srcfile ;\\\n"; - $appl .= "\t\techo '#include ' >> $srcfile ;\\\n"; - $appl .= "\t\techo '_UNLOAD($program)' >> $srcfile ;\\\n"; - $appl .= "\telse echo > $srcfile; fi\n"; - $appl .= "\n"; - - $realObjs{$program} .= " \034" . $objfile . " "; - $sources{$program} .= " $srcfile"; - $sources_changed{$program} = 1; - $dep_files .= " \$(DEPDIR)/$sourcename.P" if($dep_files !~/$sourcename\.P/); - appendLines ($appl); - } - print STDOUT "\n" if $verbose; - } - if ($moc_class_headers) { - appendLines ("$cleantarget-moc-classes:\n\t-rm -f $moc_class_headers\n"); - $target_adds{"$cleantarget-am"} .= "$cleantarget-moc-classes "; - } -} - -#----------------------------------------------------------------------------- - -sub updateMakefile () -{ - return if ($dryrun); - - open (FILEOUT, "> $makefile") - || die "Could not create $makefile: $!\n"; - - $MakefileData =~ s/\034/\\\n\t/g; # Restore continuation lines - # Append our $progId line, _below_ the "generated by automake" line - # because automake-1.6 relies on the first line to be his own. - my $progIdLine = "\# $progId - " . '$Revision: 16 $ '."\n"; - if ( !( $MakefileData =~ s/^(.*generated .*by automake.*\n)/$1$progIdLine/ ) ) { - warn "automake line not found in $makefile\n"; - # Fallback: first line - print FILEOUT $progIdLine; - }; - print FILEOUT $MakefileData; - close FILEOUT; -} - -#----------------------------------------------------------------------------- - -# The given line needs to be removed from the makefile -# Do this by adding the special "removed line" comment at the line start. -sub removeLine ($$) -{ - my ($lookup, $old) = @_; - - $old =~ s/\034/\\\n#>- /g; # Fix continuation lines - $MakefileData =~ s/\n$lookup/\n#>\- $old/; -} - -#----------------------------------------------------------------------------- - -# Replaces the old line with the new line -# old line(s) are retained but tagged as removed. The new line(s) have the -# "added" tag placed before it. -sub substituteLine ($$) -{ - my ($lookup, $new) = @_; - - if ($MakefileData =~ /\n($lookup)/) { - $old = $1; - $old =~ s/\034/\\\n#>\- /g; # Fix continuation lines - $new =~ s/\034/\\\n\t/g; - my $newCount = ($new =~ tr/\n//) + 1; - $MakefileData =~ s/\n$lookup/\n#>- $old\n#>\+ $newCount\n$new/; - } else { - print STDERR "Warning: substitution of \"$lookup\" in $printname failed\n"; - } -} - -#----------------------------------------------------------------------------- - -# Slap new lines on the back of the file. -sub appendLines ($) -{ - my ($new) = @_; - $new =~ s/\034/\\\n\t/g; # Fix continuation lines - my $newCount = ($new =~ tr/\n//) + 1; - $MakefileData .= "\n#>\+ $newCount\n$new"; -} - -#----------------------------------------------------------------------------- - -# Restore the Makefile.in to the state it was before we fiddled with it -sub restoreMakefile () -{ - $MakefileData =~ s/# $progId[^\n\034]*[\n\034]*//g; - # Restore removed lines - $MakefileData =~ s/([\n\034])#>\- /$1/g; - # Remove added lines - while ($MakefileData =~ /[\n\034]#>\+ ([^\n\034]*)/) - { - my $newCount = $1; - my $removeLines = ""; - while ($newCount--) { - $removeLines .= "[^\n\034]*([\n\034]|)"; - } - $MakefileData =~ s/[\n\034]#>\+.*[\n\034]$removeLines/\n/; - } -} - -#----------------------------------------------------------------------------- diff --git a/config.h.in b/config.h.in deleted file mode 100644 index e69de29..0000000 diff --git a/configure.files b/configure.files deleted file mode 100644 index 1083352..0000000 --- a/configure.files +++ /dev/null @@ -1 +0,0 @@ -configure.in.in diff --git a/doc/Makefile.am b/doc/Makefile.am deleted file mode 100644 index ed8dc31..0000000 --- a/doc/Makefile.am +++ /dev/null @@ -1 +0,0 @@ -SUBDIRS = en tdeioslave diff --git a/doc/en/Makefile.am b/doc/en/Makefile.am deleted file mode 100644 index 72e7ae5..0000000 --- a/doc/en/Makefile.am +++ /dev/null @@ -1,2 +0,0 @@ -KDE_LANG = en -KDE_DOCS = kchmviewer diff --git a/doc/tdeioslave/Makefile.am b/doc/tdeioslave/Makefile.am deleted file mode 100644 index 81fee21..0000000 --- a/doc/tdeioslave/Makefile.am +++ /dev/null @@ -1 +0,0 @@ -SUBDIRS = en diff --git a/doc/tdeioslave/en/Makefile.am b/doc/tdeioslave/en/Makefile.am deleted file mode 100644 index d520be4..0000000 --- a/doc/tdeioslave/en/Makefile.am +++ /dev/null @@ -1 +0,0 @@ -SUBDIRS = msits diff --git a/doc/tdeioslave/en/msits/Makefile.am b/doc/tdeioslave/en/msits/Makefile.am deleted file mode 100644 index dc2ad98..0000000 --- a/doc/tdeioslave/en/msits/Makefile.am +++ /dev/null @@ -1,2 +0,0 @@ -KDE_LANG = en -KDE_DOCS = tdeioslave/msits diff --git a/lib/Makefile.am b/lib/Makefile.am deleted file mode 100644 index fcf2131..0000000 --- a/lib/Makefile.am +++ /dev/null @@ -1,17 +0,0 @@ -if AMC_USE_KDE -SUBDIR_TDEIO = tdeio-msits -endif - -if AMC_BUILD_CHMLIB -SUBDIR_CHMLIB = chmlib -endif - -SUBDIRS = $(SUBDIR_CHMLIB) $(SUBDIR_TDEIO) libchmfile -DIST_SUBDIRS = chmlib tdeio-msits libchmfile - -package-messages: - $(MAKE) -f admin/Makefile.common package-messages - $(MAKE) -C po merge - -# Uncomment this line before opening the project in tdevelop for the first time! -#SUBDIRS = chmlib tdeio-msits libchmfile diff --git a/lib/chmlib/Makefile.am b/lib/chmlib/Makefile.am deleted file mode 100644 index bcbe427..0000000 --- a/lib/chmlib/Makefile.am +++ /dev/null @@ -1,3 +0,0 @@ -noinst_LTLIBRARIES = libchm.la -noinst_HEADERS = chm_lib.h lzx.h -libchm_la_SOURCES = chm_lib.c lzx.c diff --git a/lib/libchmfile/CMakeLists.txt b/lib/libchmfile/CMakeLists.txt index b56565f..cd8990a 100644 --- a/lib/libchmfile/CMakeLists.txt +++ b/lib/libchmfile/CMakeLists.txt @@ -23,6 +23,4 @@ tde_add_library( chmfile STATIC_PIC libchmfileimpl.cpp libchmtextencoding.cpp libchmtocimage.cpp - - DESTINATION ${LIB_INSTALL_DIR} ) diff --git a/lib/libchmfile/lchmurlhandler.cpp b/lib/libchmfile/lchmurlhandler.cpp deleted file mode 100644 index 6e905f6..0000000 --- a/lib/libchmfile/lchmurlhandler.cpp +++ /dev/null @@ -1,32 +0,0 @@ -/*************************************************************************** - * Copyright (C) 2004-2005 by Georgy Yunaev, gyunaev@ulduzsoft.com * - * Please do not use email address above for bug reports; see * - * the README file * - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the * - * Free Software Foundation, Inc., * - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - ***************************************************************************/ -#include "lchmurlhandler.h" - -LCHMUrlHandler::LCHMUrlHandler() -{ -} - - -LCHMUrlHandler::~LCHMUrlHandler() -{ -} - - diff --git a/lib/libchmfile/lchmurlhandler.h b/lib/libchmfile/lchmurlhandler.h deleted file mode 100644 index 9eb29ec..0000000 --- a/lib/libchmfile/lchmurlhandler.h +++ /dev/null @@ -1,36 +0,0 @@ -/*************************************************************************** - * Copyright (C) 2004-2007 by Georgy Yunaev, gyunaev@ulduzsoft.com * - * Please do not use email address above for bug reports; see * - * the README file * - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the * - * Free Software Foundation, Inc., * - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - ***************************************************************************/ - -#ifndef LCHMURLHANDLER_H -#define LCHMURLHANDLER_H - -/** - @author tim -*/ -class LCHMUrlHandler{ -public: - LCHMUrlHandler(); - - ~LCHMUrlHandler(); - -}; - -#endif diff --git a/lib/libchmfile/qt34.cpp b/lib/libchmfile/qt34.cpp deleted file mode 100644 index cb2f3d8..0000000 --- a/lib/libchmfile/qt34.cpp +++ /dev/null @@ -1,259 +0,0 @@ -/*************************************************************************** - * Copyright (C) 2007 by Albert Astals Cid, aacid@kde.org * - * Please do not use email address above for bug reports; see * - * the README file * - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the * - * Free Software Foundation, Inc., * - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - ***************************************************************************/ - -#include - -#include "tqt34.h" - -LIBCHMCString::LIBCHMCString() -{ -} - -LIBCHMCString::LIBCHMCString(const char *string) -{ -#if defined (USE_TQT_4) - cs = TQByteArray(string); -#else - cs = TQCString(string); -#endif -} - - -const char *LIBCHMCString::toCString() const -{ - return cs.data(); -} - - -void LIBCHMCString::clear() -{ -#if defined (USE_TQT_4) - cs = TQByteArray(); -#else - cs = TQCString(); -#endif -} - -bool LIBCHMCString::operator==(const TQString &string) const -{ - return TQString(cs) == string; -} - -uint LIBCHMCString::length() const -{ - return cs.length(); -} - -bool LIBCHMCString::isEmpty() const -{ - return cs.isEmpty(); -} - -void LIBCHMCString::prepend(char c) -{ - cs = c + cs; -} - -char LIBCHMCString::at(uint i) const -{ - return cs.at(i); -} - -void LIBCHMCString::replace(uint index, uint len, const char *str) -{ - cs.replace(index, len, str); -} - -void LIBCHMCString::remove(uint index, uint len) -{ - cs.remove(index, len); -} - -LIBCHMCString LIBCHMCString::lower() -{ -#if defined (USE_TQT_4) - return cs.toLower().data(); -#else - return cs.lower().data(); -#endif -} - - - -LIBCHMRegExp::LIBCHMRegExp(const TQString ®exp) -{ - re = TQRegExp(regexp); -} - -int LIBCHMRegExp::search(const TQString &str, int offset) -{ -#if defined (USE_TQT_4) - return re.indexIn(str, offset); -#else - return re.search(str, offset); -#endif -} - -TQString LIBCHMRegExp::cap(int nth) -{ - return re.cap(nth); -} - -void LIBCHMRegExp::setMinimal(bool minimal) -{ - return re.setMinimal(minimal); -} - -int LIBCHMRegExp::matchedLength() const -{ - return re.matchedLength(); -} - - - - -LIBCHMString::LIBCHMString() -{ -} - -LIBCHMString::LIBCHMString(const TQString &string) -{ - s = string; -} - -LIBCHMString::LIBCHMString(const char *string) -{ - s = TQString(string); -} - -TQString LIBCHMString::lower() const -{ -#if defined (USE_TQT_4) - return s.toLower(); -#else - return s.lower(); -#endif -} - -const char *LIBCHMString::ascii() const -{ -#if defined (USE_TQT_4) - return s.toAscii(); -#else - return s.ascii(); -#endif -} - -int LIBCHMString::find(char c, int index) const -{ -#if defined (USE_TQT_4) - return s.indexOf(c, index); -#else - return s.find(c, index); -#endif -} - -int LIBCHMString::find(const TQChar &c, int index) const -{ -#if defined (USE_TQT_4) - return s.indexOf(c, index); -#else - return s.find(c, index); -#endif -} - -int LIBCHMString::find(const TQString &string, int index, bool cs) const -{ -#if defined (USE_TQT_4) - TQt::CaseSensitivity cse; - if (cs) cse = TQt::CaseSensitive; - else cse = TQt::CaseInsensitive; - return s.indexOf(string, index, cse); -#else - return s.find(string, index, cs); -#endif -} - -int LIBCHMString::findRev(char c) const -{ -#if defined (USE_TQT_4) - return s.lastIndexOf(c); -#else - return s.findRev(c); -#endif -} - -TQChar LIBCHMString::at(uint i) const -{ - return s.at(i); -} - -TQString LIBCHMString::left(uint len) const -{ - return s.left(len); -} - -LIBCHMString LIBCHMString::mid(uint index, uint len) const -{ - return s.mid(index, len); -} - -bool LIBCHMString::isEmpty() const -{ - return s.isEmpty(); -} - -TQString LIBCHMString::toString() const -{ - return s; -} - -bool LIBCHMString::operator==(const TQString &string) const -{ - return s == string; -} - - - -TQString LIBCHMDir::cleanDirPath(const TQString &dir) -{ -#if defined (USE_TQT_4) - return TQDir::cleanPath(dir); -#else - return TQDir::cleanDirPath(dir); -#endif -} - - - -bool LIBCHMStringList::contains(const TQStringList &list, const TQString &string) -{ - return list.contains(string); -} - -TQStringList LIBCHMStringList::split(const TQRegExp ®exp, const TQString &string) -{ -#if defined (USE_TQT_4) - return string.split(regexp, TQString::SkipEmptyParts); -#else - return TQStringList::split(regexp, string); -#endif -} diff --git a/lib/tdeio-msits/CMakeLists.txt b/lib/tdeio-msits/CMakeLists.txt index 3f61de2..203fe5c 100644 --- a/lib/tdeio-msits/CMakeLists.txt +++ b/lib/tdeio-msits/CMakeLists.txt @@ -38,5 +38,5 @@ install( install( FILES ${PROJECT_NAME}.desktop - DESTINATION ${APPS_INSTALL_DIR} + DESTINATION ${XDG_APPS_INSTALL_DIR} ) diff --git a/po/Makefile.am b/po/Makefile.am deleted file mode 100644 index 76c5e28..0000000 --- a/po/Makefile.am +++ /dev/null @@ -1,4 +0,0 @@ -GMSGFMT = msgfmt -MSGFMT = msgfmt -POFILES = AUTO -POFILES = AUTO diff --git a/src/config.h.in b/src/config.h.in deleted file mode 100644 index f0c2ac9..0000000 --- a/src/config.h.in +++ /dev/null @@ -1,255 +0,0 @@ -/* src/config.h.in. Generated from configure.in by autoheader. */ - -/* Application version as integer */ -#undef APP_INT_VERSION - -/* Application name */ -#undef APP_NAME - -/* Application version as text */ -#undef APP_VERSION - -/* Define to 1 if you have the header file. */ -#undef HAVE_CARBON_CARBON_H - -/* Define if you have the CoreAudio API */ -#undef HAVE_COREAUDIO - -/* Define to 1 if you have the header file. */ -#undef HAVE_CRT_EXTERNS_H - -/* Defines if your system has the crypt function */ -#undef HAVE_CRYPT - -/* Define to 1 if you have the header file. */ -#undef HAVE_DLFCN_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_INTTYPES_H - -/* Define if you have libjpeg */ -#undef HAVE_LIBJPEG - -/* Define if you have libpng */ -#undef HAVE_LIBPNG - -/* Define if you have a working libpthread (will enable threaded code) */ -#undef HAVE_LIBPTHREAD - -/* Define if you have libz */ -#undef HAVE_LIBZ - -/* Define to 1 if you have the header file. */ -#undef HAVE_MEMORY_H - -/* Define if your system needs _NSGetEnviron to set up the environment */ -#undef HAVE_NSGETENVIRON - -/* Define if you have res_init */ -#undef HAVE_RES_INIT - -/* Define if you have the res_init prototype */ -#undef HAVE_RES_INIT_PROTO - -/* Define if you have a STL implementation by SGI */ -#undef HAVE_SGI_STL - -/* Define to 1 if you have the `snprintf' function. */ -#undef HAVE_SNPRINTF - -/* Define to 1 if you have the header file. */ -#undef HAVE_STDINT_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_STDLIB_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_STRINGS_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_STRING_H - -/* Define if you have strlcat */ -#undef HAVE_STRLCAT - -/* Define if you have the strlcat prototype */ -#undef HAVE_STRLCAT_PROTO - -/* Define if you have strlcpy */ -#undef HAVE_STRLCPY - -/* Define if you have the strlcpy prototype */ -#undef HAVE_STRLCPY_PROTO - -/* Define to 1 if you have the header file. */ -#undef HAVE_SYS_BITYPES_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_SYS_STAT_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_SYS_TYPES_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_UNISTD_H - -/* Define to 1 if you have the `vsnprintf' function. */ -#undef HAVE_VSNPRINTF - -/* Suffix for lib directories */ -#undef KDELIBSUFF - -/* Name of package */ -#undef PACKAGE - -/* Define to the address where bug reports for this package should be sent. */ -#undef PACKAGE_BUGREPORT - -/* Define to the full name of this package. */ -#undef PACKAGE_NAME - -/* Define to the full name and version of this package. */ -#undef PACKAGE_STRING - -/* Define to the one symbol short name of this package. */ -#undef PACKAGE_TARNAME - -/* Define to the version of this package. */ -#undef PACKAGE_VERSION - -/* The size of `char *', as computed by sizeof. */ -#undef SIZEOF_CHAR_P - -/* The size of `int', as computed by sizeof. */ -#undef SIZEOF_INT - -/* The size of `long', as computed by sizeof. */ -#undef SIZEOF_LONG - -/* The size of `short', as computed by sizeof. */ -#undef SIZEOF_SHORT - -/* The size of `size_t', as computed by sizeof. */ -#undef SIZEOF_SIZE_T - -/* The size of `unsigned long', as computed by sizeof. */ -#undef SIZEOF_UNSIGNED_LONG - -/* Define to 1 if you have the ANSI C header files. */ -#undef STDC_HEADERS - -/* use builtin chmlib */ -#undef USE_BUILTIN_CHMLIB - -/* use KDE support */ -#undef USE_KDE - -/* Version number of package */ -#undef VERSION - -/* Defined if compiling without arts */ -#undef WITHOUT_ARTS - -/* Define to 1 if the X Window System is missing or not being used. */ -#undef X_DISPLAY_MISSING - -/* - * jpeg.h needs HAVE_BOOLEAN, when the system uses boolean in system - * headers and I'm too lazy to write a configure test as long as only - * unixware is related - */ -#ifdef _UNIXWARE -#define HAVE_BOOLEAN -#endif - - - -/* - * AIX defines FD_SET in terms of bzero, but fails to include - * that defines bzero. - */ - -#if defined(_AIX) -#include -#endif - - - -#if defined(HAVE_NSGETENVIRON) && defined(HAVE_CRT_EXTERNS_H) -# include -# include -# define environ (*_NSGetEnviron()) -#endif - - - -#if !defined(HAVE_RES_INIT_PROTO) -#ifdef __cplusplus -extern "C" { -#endif -int res_init(void); -#ifdef __cplusplus -} -#endif -#endif - - - -#if !defined(HAVE_STRLCAT_PROTO) -#ifdef __cplusplus -extern "C" { -#endif -unsigned long strlcat(char*, const char*, unsigned long); -#ifdef __cplusplus -} -#endif -#endif - - - -#if !defined(HAVE_STRLCPY_PROTO) -#ifdef __cplusplus -extern "C" { -#endif -unsigned long strlcpy(char*, const char*, unsigned long); -#ifdef __cplusplus -} -#endif -#endif - - - -/* - * On HP-UX, the declaration of vsnprintf() is needed every time ! - */ - -#if !defined(HAVE_VSNPRINTF) || defined(hpux) -#if __STDC__ -#include -#include -#else -#include -#endif -#ifdef __cplusplus -extern "C" -#endif -int vsnprintf(char *str, size_t n, char const *fmt, va_list ap); -#ifdef __cplusplus -extern "C" -#endif -int snprintf(char *str, size_t n, char const *fmt, ...); -#endif - - - -#if defined(__SVR4) && !defined(__svr4__) -#define __svr4__ 1 -#endif - - -/* type to use in place of socklen_t if not defined */ -#undef kde_socklen_t - -/* type to use in place of socklen_t if not defined (deprecated, use - kde_socklen_t) */ -#undef ksize_t diff --git a/src/pics/Makefile.am b/src/pics/Makefile.am deleted file mode 100644 index d085bb3..0000000 --- a/src/pics/Makefile.am +++ /dev/null @@ -1,2 +0,0 @@ -# Install the icons into the global KDE directories -KDE_ICON = AUTO diff --git a/src/tde/kchmdcopiface_skel.cpp b/src/tde/kchmdcopiface_skel.cpp deleted file mode 100644 index be1e994..0000000 --- a/src/tde/kchmdcopiface_skel.cpp +++ /dev/null @@ -1,98 +0,0 @@ -/**************************************************************************** -** -** DCOP Skeleton generated by dcopidl2cpp from kchmdcopiface.kidl -** -** WARNING! All changes made in this file will be lost! -** -*****************************************************************************/ - -#include "./kchmdcopiface.h" - -#include - - -static const char* const KCHMDCOPIface_ftable[6][3] = { - { "void", "loadHelpFile(TQString,TQString)", "loadHelpFile(TQString filename,TQString url)" }, - { "void", "openPage(TQString)", "openPage(TQString url)" }, - { "void", "guiFindInIndex(TQString)", "guiFindInIndex(TQString word)" }, - { "void", "guiSearchQuery(TQString)", "guiSearchQuery(TQString query)" }, - { TQSTRINGLIST_OBJECT_NAME_STRING, "searchQuery(TQString)", "searchQuery(TQString query)" }, - { 0, 0, 0 } -}; -static const int KCHMDCOPIface_ftable_hiddens[5] = { - 0, - 0, - 0, - 0, - 0, -}; - -bool KCHMDCOPIface::process(const TQCString &fun, const TQByteArray &data, TQCString& replyType, TQByteArray &replyData) -{ - if ( fun == KCHMDCOPIface_ftable[0][1] ) { // void loadHelpFile(TQString,TQString) - TQString arg0; - TQString arg1; - TQDataStream arg( data, IO_ReadOnly ); - if (arg.atEnd()) return false; - arg >> arg0; - if (arg.atEnd()) return false; - arg >> arg1; - replyType = KCHMDCOPIface_ftable[0][0]; - loadHelpFile(arg0, arg1 ); - } else if ( fun == KCHMDCOPIface_ftable[1][1] ) { // void openPage(TQString) - TQString arg0; - TQDataStream arg( data, IO_ReadOnly ); - if (arg.atEnd()) return false; - arg >> arg0; - replyType = KCHMDCOPIface_ftable[1][0]; - openPage(arg0 ); - } else if ( fun == KCHMDCOPIface_ftable[2][1] ) { // void guiFindInIndex(TQString) - TQString arg0; - TQDataStream arg( data, IO_ReadOnly ); - if (arg.atEnd()) return false; - arg >> arg0; - replyType = KCHMDCOPIface_ftable[2][0]; - guiFindInIndex(arg0 ); - } else if ( fun == KCHMDCOPIface_ftable[3][1] ) { // void guiSearchQuery(TQString) - TQString arg0; - TQDataStream arg( data, IO_ReadOnly ); - if (arg.atEnd()) return false; - arg >> arg0; - replyType = KCHMDCOPIface_ftable[3][0]; - guiSearchQuery(arg0 ); - } else if ( fun == KCHMDCOPIface_ftable[4][1] ) { // TQStringList searchQuery(TQString) - TQString arg0; - TQDataStream arg( data, IO_ReadOnly ); - if (arg.atEnd()) return false; - arg >> arg0; - replyType = KCHMDCOPIface_ftable[4][0]; - TQDataStream _replyStream( replyData, IO_WriteOnly ); - _replyStream << searchQuery(arg0 ); - } else { - return DCOPObject::process( fun, data, replyType, replyData ); - } - return true; -} - -QCStringList KCHMDCOPIface::interfaces() -{ - QCStringList ifaces = DCOPObject::interfaces(); - ifaces += "KCHMDCOPIface"; - return ifaces; -} - -QCStringList KCHMDCOPIface::functions() -{ - QCStringList funcs = DCOPObject::functions(); - for ( int i = 0; KCHMDCOPIface_ftable[i][2]; i++ ) { - if (KCHMDCOPIface_ftable_hiddens[i]) - continue; - TQCString func = KCHMDCOPIface_ftable[i][0]; - func += ' '; - func += KCHMDCOPIface_ftable[i][2]; - funcs << func; - } - return funcs; -} - - diff --git a/stamp-h.in b/stamp-h.in deleted file mode 100644 index e69de29..0000000 diff --git a/subdirs b/subdirs deleted file mode 100644 index c73839a..0000000 --- a/subdirs +++ /dev/null @@ -1,4 +0,0 @@ -doc -lib -po -src