From: Michal H. <ms...@gm...> - 2008-09-10 02:36:25
|
Hi, This very small patch set is some cleanup for TODOs from unified makefiles unfinished stuff. patch 1: Changes which files in the source tree root are generated. This also fixes warning and potential problem of the qmake complaining about ifed() ... endif construct in the included Makefile.flags. patch 2: Consolidates configurable variables from configure which affects installation process. I strongly suggest applying this patch even if the second one doesn't find its way to the CVS. See more details in the patch description. patch 3: Adds possibility to make fake install which means that all steps like with the normal installation are done when doing make install, but no real file/directories are created and all steps are logged instead. This is configurable by ./configure --with-fake-install=YES I think it can be rather handy for us and it doesn't add any further complexity to our configuration. Please let me know what do you think about that. I would like to hear especially from Martin. Changelog v1 -> v2 ================== * Patch1 added for configure-generated files cleanup -- Michal Hocko |
From: Michal H. <ms...@gm...> - 2008-09-10 02:36:24
|
This patch adds tools/fake_install_tools.sh script which aimed to replace all tools which are used during {un}installation process. Its only purpose is to fake operation given as the first argument and log this operation with all parameters to the file. This can be very handy when we want to check install targets and want to make sure that nothing is broken (I was hit several times during my experiments). How it works? To enable these fake tools, we just need to give --with-fake-install=YES parameter to the configure and that's it. It will inject all variables holding tools for installation with $(ROOT)/tools/fake_install_tools.sh script and nothing more has to be done. * configure.in - --with-fake-install parameter added (NO by default) * tools/fake_install_tools.sh - script added Index: pdfedit-patches/tools/fake_install_tools.sh =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 +++ pdfedit-patches/tools/fake_install_tools.sh 2008-09-09 19:37:55.000000000 -0600 @@ -0,0 +1,33 @@ +#!/bin/sh + +LOGFILE=/tmp/fake_install_tools.log + +function usage() +{ + echo -e "\ + `basename $0` command [params] \n\ + where\n\ + \tcommand - name of the command to emulate\n\ + \t[params] - parameters for command" + exit 1 +} + +if [ $# -lt 1 ] +then + echo Command expected + usage +fi + +CMD=$1 +shift + +echo -n $CMD: >> "$LOGFILE" + +# Some command should contain additional info +case $CMD in + # Get current directory to know where we are erasing + DEL_* ) echo -n "`pwd`:" >> "$LOGFILE" ;; +esac + +echo $* >> "$LOGFILE" +exit 0 Index: pdfedit-patches/configure.in =================================================================== --- pdfedit-patches.orig/configure.in 2008-09-09 19:31:14.000000000 -0600 +++ pdfedit-patches/configure.in 2008-09-09 19:37:55.000000000 -0600 @@ -55,6 +55,35 @@ then AC_MSG_ERROR(Boost IOStreams is required by PDFedit) fi +dnl fake-install-tools can be used to installation tools (COPY, DEL_*, +dnl SYMLINK, etc) by those which are safe for testing - don't touch +dnl anything and instead logs all actions - tools/fake_install_tools.sh +dnl script with the first parameter as original operation +AC_ARG_WITH([fake-install], + AS_HELP_STRING([--with-fake-install=YES|NO], + [Only log actions that would be done during make + {un}install, instead of doing them (to the + /tmp/fake_install_tools.log). This is only + for testing purposes.] + ), + [ + fake_install="$withval" + ], + [fake_install="NO"] + ) +if test "x$fake_install" = "xYES" +then + AC_MSG_NOTICE("Using fake-install-tools.") + COPY='sh $(ROOT)/tools/fake_install_tools.sh COPY' + DEL_FILE='sh $(ROOT)/tools/fake_install_tools.sh DEL_FILE' + DEL_FORCE_DIR='sh $(ROOT)/tools/fake_install_tools.sh DEL_FORCE_DIR' + DEL_DIR='sh $(ROOT)/tools/fake_install_tools.sh DEL_DIR' + SYMLINK='sh $(ROOT)/tools/fake_install_tools.sh SYMLINK' + MKDIR='sh $(ROOT)/tools/fake_install_tools.sh MKDIR' + CHK_DIR_EXISTS='sh $(ROOT)/tools/fake_install_tools.sh CHK_DIR_EXISTS' +fi + + dnl Default (and configurable) values for files/directories manipulation dnl programs (you can overwrite them by ./configure NAME=value) CHK_OR_DEFINE_VAR(COPY, "cp -f") -- Michal Hocko |
From: Michal H. <ms...@gm...> - 2008-09-10 02:36:25
|
This patch simply changes configure-generated files in the root source directory so they are more logical: - Makefile.in -> Makefile is no longer needed, because only [UN]INSTALL_TARGET are substitued. IMO this is not worth file generation and moreover all install targets for doc are placed in Makefile.flags.in so it is more consistent to define these variables there - Makefile.rules.in -> Makefile.rules was added for make related configurable stuff (like MAKEFLAGS). This way, we have Makefile.flags for project stuff global configuration Makefile.rules for build stuff global configuration * Makefile.in removed and replaced by Makefile - @[UN]INSTALL_TARGET@ replaced by variables defined in Makefile.flags - distclean updated * Makefile.rules removed and replaced by Makeflags.rules.in - configurable MAKEFLAGS added * Makeflags.flags.in - MAKEFLAGS removed from here because it caused qmake complains which doesn't recognise ifeq() ... endif sequence. It is also more logical to have it in the rules file which controls building process rather than project related configuration * dist-exclude - generated files are excluded from installation Index: pdfedit-patches/Makefile =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 +++ pdfedit-patches/Makefile 2008-09-09 20:07:16.000000000 -0600 @@ -0,0 +1,105 @@ +# top-level makefile for PDF editor + +.PHONY: distclean clean doc-dist source install install-no all uninstall \ + uninstall-no install-gui uninstall-gui doc-dist-install \ + doc-dist-uninstall check-configure + +# includes basic building rules +include Makefile.rules + +# make PDF editor - source and documentation +all: check-configure source + +check-configure: configure + +configure: configure.in + @echo configure script is outdated. You should do autoconf and + @echo rerun ./configure script + exit 1 + +# Common install target. It depends on configuration which specific +# installation target will be used. +install: $(INSTALL_TARGET) doc-dist-install + +install-no: + @echo There is no installation target defined!!! You probably have + @echo not configured PDFedit with installation target. + exit 1 + +# Installs gui part +install-gui: source + cd $(GUIROOT) && $(MAKE) -f Makefile.gui install + +# TODO - maybe we can create install-dev target too later when we can +# extract also some functionality from gui (e.g. scripting layer) + +# Installs core development package consisting of header files and +# configuration script for 3rd party applications depending on kernel +# (non-GUI) functionality +install-core-dev: pdfedit-core-dev + $(MKDIR) $(INSTALL_ROOT)$(INCLUDE_PATH) + $(MKDIR) $(INSTALL_ROOT)$(LIB_PATH) + cd $(XPDFROOT) && $(MAKE) install-dev + cd $(UTILSROOT) && $(MAKE) install-dev + cd $(KERNELROOT) && $(MAKE) install-dev + cd $(OSROOT) && $(MAKE) install-dev + + +# Common uninstall target. It depends on configuration which specific +# uninstallation target will be used +uninstall: $(UNINSTALL_TARGET) uninstall-gui doc-dist-uninstall + +uninstall-no: + @echo There is no uninstallation target defined!!! You probably have + @echo not configured PDFedit with installation target so that + @echo uninstallation is neither evailable. + exit 1 + +# Uninstalls gui part +uninstall-gui: + cd $(GUIROOT) && $(MAKE) -f Makefile.gui uninstall + +# TODO - maybe we can create uninstall-dev target too later when we can +# extract also some functionality from gui (e.g. scripting layer) + +# Uninstalls core dev packages +uninstall-core-dev: + cd $(XPDFROOT) && $(MAKE) uninstall-dev + cd $(UTILSROOT) && $(MAKE) uninstall-dev + cd $(KERNELROOT) && $(MAKE) uninstall-dev + cd $(OSROOT) && $(MAKE) uninstall-dev + $(DEL_DIR) $(INSTALL_ROOT)$(INCLUDE_PATH) + $(DEL_DIR) $(INSTALL_ROOT)$(LIB_PATH) + +# Target for distributed documentation. +doc-dist: + cd $(DOCROOT) && $(MAKE) doc_dist + +# Target for distributed documentation (un)installation +doc-dist-install: doc-dist + cd $(DOCROOT) && $(MAKE) doc_dist_install + +doc-dist-uninstall: + cd $(DOCROOT) && $(MAKE) doc_dist_uninstall + +# make application +source: + cd $(SRCROOT) && $(MAKE) + +# make all static libraries for pdfedit-core-dev package +pdfedit-core-dev: + cd $(SRCROOT) && $(MAKE) pdfedit-core-dev + +# cleanup +clean: + cd $(DOCROOT) && $(MAKE) clean || true + cd $(SRCROOT) && $(MAKE) clean || true + $(DEL_FILE) config.log + +# dist cleanup +distclean: + cd $(DOCROOT) && $(MAKE) clean || true + cd $(SRCROOT) && $(MAKE) distclean || true + $(DEL_FILE) config.status config.log Makefile.flags Makefile.rules|| true + $(DEL_FILE) autom4te.cache/* || true + $(DEL_DIR) autom4te.cache || true Index: pdfedit-patches/Makefile.in =================================================================== --- pdfedit-patches.orig/Makefile.in 2008-09-09 20:06:44.000000000 -0600 +++ /dev/null 1970-01-01 00:00:00.000000000 +0000 @@ -1,105 +0,0 @@ -# top-level makefile for PDF editor - -.PHONY: distclean clean doc-dist source install install-no all uninstall \ - uninstall-no install-gui uninstall-gui doc-dist-install \ - doc-dist-uninstall check-configure - -# includes basic building rules -include Makefile.rules - -# make PDF editor - source and documentation -all: check-configure source - -check-configure: configure - -configure: configure.in - @echo configure script is outdated. You should do autoconf and - @echo rerun ./configure script - exit 1 - -# Common install target. It depends on configuration which specific -# installation target will be used. -install: @INSTALL_TARGET@ doc-dist-install - -install-no: - @echo There is no installation target defined!!! You probably have - @echo not configured PDFedit with installation target. - exit 1 - -# Installs gui part -install-gui: source - cd $(GUIROOT) && $(MAKE) -f Makefile.gui install - -# TODO - maybe we can create install-dev target too later when we can -# extract also some functionality from gui (e.g. scripting layer) - -# Installs core development package consisting of header files and -# configuration script for 3rd party applications depending on kernel -# (non-GUI) functionality -install-core-dev: pdfedit-core-dev - $(MKDIR) $(INSTALL_ROOT)$(INCLUDE_PATH) - $(MKDIR) $(INSTALL_ROOT)$(LIB_PATH) - cd $(XPDFROOT) && $(MAKE) install-dev - cd $(UTILSROOT) && $(MAKE) install-dev - cd $(KERNELROOT) && $(MAKE) install-dev - cd $(OSROOT) && $(MAKE) install-dev - - -# Common uninstall target. It depends on configuration which specific -# uninstallation target will be used -uninstall: @UNINSTALL_TARGET@ doc-dist-uninstall - -uninstall-no: - @echo There is no uninstallation target defined!!! You probably have - @echo not configured PDFedit with installation target so that - @echo uninstallation is neither evailable. - exit 1 - -# Uninstalls gui part -uninstall-gui: - cd $(GUIROOT) && $(MAKE) -f Makefile.gui uninstall - -# TODO - maybe we can create uninstall-dev target too later when we can -# extract also some functionality from gui (e.g. scripting layer) - -# Uninstalls core dev packages -uninstall-core-dev: - cd $(XPDFROOT) && $(MAKE) uninstall-dev - cd $(UTILSROOT) && $(MAKE) uninstall-dev - cd $(KERNELROOT) && $(MAKE) uninstall-dev - cd $(OSROOT) && $(MAKE) uninstall-dev - $(DEL_DIR) $(INSTALL_ROOT)$(INCLUDE_PATH) - $(DEL_DIR) $(INSTALL_ROOT)$(LIB_PATH) - -# Target for distributed documentation. -doc-dist: - cd $(DOCROOT) && $(MAKE) doc_dist - -# Target for distributed documentation (un)installation -doc-dist-install: doc-dist - cd $(DOCROOT) && $(MAKE) doc_dist_install - -doc-dist-uninstall: - cd $(DOCROOT) && $(MAKE) doc_dist_uninstall - -# make application -source: - cd $(SRCROOT) && $(MAKE) - -# make all static libraries for pdfedit-core-dev package -pdfedit-core-dev: - cd $(SRCROOT) && $(MAKE) pdfedit-core-dev - -# cleanup -clean: - cd $(DOCROOT) && $(MAKE) clean || true - cd $(SRCROOT) && $(MAKE) clean || true - $(DEL_FILE) config.log - -# dist cleanup -distclean: - cd $(DOCROOT) && $(MAKE) clean || true - cd $(SRCROOT) && $(MAKE) distclean || true - $(DEL_FILE) Makefile config.status config.log Makefile.flags || true - $(DEL_FILE) autom4te.cache/* || true - $(DEL_DIR) autom4te.cache || true Index: pdfedit-patches/Makefile.rules =================================================================== --- pdfedit-patches.orig/Makefile.rules 2008-09-09 20:06:44.000000000 -0600 +++ /dev/null 1970-01-01 00:00:00.000000000 +0000 @@ -1,30 +0,0 @@ -################################################################################ -# This file contains general building rules with configuration info -# -# Include this file to the each subdirectory makefile. Note that REL_ADDR -# variable has to be defined if we are in deeper subdirectory. -# -# If you need only configuration data, use Makefile.flags instead -################################################################################ - -include $(REL_ADDR)Makefile.flags - -####### Implicit rules - -.SUFFIXES: .c .o .cpp .cc .cxx .C - -.cpp.o: - $(CXX) -c $(CXXFLAGS) $(MANDATORY_INCPATH) -o $@ $< - -.cc.o: - $(CXX) -c $(CXXFLAGS) $(MANDATORY_INCPATH) -o $@ $< - -.cxx.o: - $(CXX) -c $(CXXFLAGS) $(MANDATORY_INCPATH) -o $@ $< - -.C.o: - $(CXX) -c $(CXXFLAGS) $(MANDATORY_INCPATH) -o $@ $< - -.c.o: - $(CC) -c $(CFLAGS) $(MANDATORY_INCPATH) -o $@ $< - Index: pdfedit-patches/Makefile.rules.in =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 +++ pdfedit-patches/Makefile.rules.in 2008-09-09 20:17:57.000000000 -0600 @@ -0,0 +1,36 @@ +################################################################################ +# This file contains general building rules with configuration info +# +# Include this file to the each subdirectory makefile. Note that REL_ADDR +# variable has to be defined if we are in deeper subdirectory. +# +# If you need only project configuration data, use Makefile.flags instead +################################################################################ + +# Define MAKEFLAGS only for top level makes as this variable is inherited +# down in recursion +ifeq ($(MAKELEVEL),0) +MAKEFLAGS += @parallel_make@ +endif + +include $(REL_ADDR)Makefile.flags + +####### Implicit rules + +.SUFFIXES: .c .o .cpp .cc .cxx .C + +.cpp.o: + $(CXX) -c $(CXXFLAGS) $(MANDATORY_INCPATH) -o $@ $< + +.cc.o: + $(CXX) -c $(CXXFLAGS) $(MANDATORY_INCPATH) -o $@ $< + +.cxx.o: + $(CXX) -c $(CXXFLAGS) $(MANDATORY_INCPATH) -o $@ $< + +.C.o: + $(CXX) -c $(CXXFLAGS) $(MANDATORY_INCPATH) -o $@ $< + +.c.o: + $(CC) -c $(CFLAGS) $(MANDATORY_INCPATH) -o $@ $< + Index: pdfedit-patches/configure.in =================================================================== --- pdfedit-patches.orig/configure.in 2008-09-09 20:06:44.000000000 -0600 +++ pdfedit-patches/configure.in 2008-09-09 20:07:16.000000000 -0600 @@ -483,7 +483,7 @@ then dnl TODO: if xsltproc and stylesheet is missing, docbook2html from jade can be used fi -AC_CONFIG_FILES([Makefile Makefile.flags]) +AC_CONFIG_FILES([Makefile.flags Makefile.rules]) dnl dnl XPDF specific stuff taken from the original xpdf distribution Index: pdfedit-patches/dist-exclude =================================================================== --- pdfedit-patches.orig/dist-exclude 2008-09-09 20:06:44.000000000 -0600 +++ pdfedit-patches/dist-exclude 2008-09-09 20:07:16.000000000 -0600 @@ -7,6 +7,8 @@ maintains dist-exclude makedist testset +Makefile.flags +Makefile.rules doc/doxygen.warnings doc/navrh doc/programmer Index: pdfedit-patches/Makefile.flags.in =================================================================== --- pdfedit-patches.orig/Makefile.flags.in 2008-09-09 20:07:20.000000000 -0600 +++ pdfedit-patches/Makefile.flags.in 2008-09-09 20:20:01.000000000 -0600 @@ -1,3 +1,12 @@ +################################################################################ +# This file contains project global configuration for building and installation +# process. +# +# Don't include this file to the Makefiles directly unless you need only project +# specific configuration data (like in the QT project files) and include +# Makefile.rules instead +################################################################################ + E_RELEASE= @enable_release@ QMAKE = @QMAKE@ LRELEASE = @LRELEASE@ @@ -83,12 +92,6 @@ INCLUDE_PATH = $(includedir) # Flags definition ############################################# -# Define MAKEFLAGS only for top level makes as this variable is inherited -# down in recursion -ifeq ($(MAKELEVEL),0) -MAKEFLAGS += @parallel_make@ -endif - # Debug options DEBUG = @DEBUG@ # Optimization options @@ -252,3 +255,7 @@ ADVANCED_DOC_INSTALL_TARGET = @ADVANCED_ # configure parameter --enable-user-manual USER_MANUAL_TARGET = @USER_MANUAL_TARGET@ USER_MANUAL_INSTALL_TARGET = @USER_MANUAL_INSTALL_TARGET@ + +# installation rules +INSTALL_TARGET = @INSTALL_TARGET@ +UNINSTALL_TARGET = @UNINSTALL_TARGET@ -- Michal Hocko |
From: Michal H. <ms...@gm...> - 2008-09-10 02:36:25
|
It is rather long time since I have started Unified makefiles patchset and there were several things I was lazy work on those days. Most of them were marked as "TODO from autoconf" and the main motivation was to make almost everything configurable from configure script rather than having them hard-coded. This patch sets all those variable (in Makefile.flags.in) from configure. In the result it means that we can modify them during configuration when necessary (e.g. ./configure COPY="something else than cp" will use given "something else than cp" instead of default "cp -f". The second important thing which is done here, is the consolidation of all these variables with those coming out of qmake when it generates makefile. Qmake has its own idea about COPY, MKDIR, ... variables and we have to force it to use our configured values. I have used the same trick which is already used for unification of compiler - make all configurable variables used by qmake 2 layered: CONFIG_NAME is set by configured and used in pro file and NAME used in our makefiles is initialized from CONFIG_NAME. * config/env.m4 - CHK_OR_DEFINE_VAR(PARAM1, PARAM2) macro added - PARAM1 stands for variable we want to check and set - PARAM2 default value if PARAM1 isn't defined yet - it should be used for all configurable variables because we can push such a variable by ./configure NAME=value or from configure itself when needed (just define such variable) -TODO - maybe we could include also AC_SUBST into this macro. Any idea how Martin? (I have tried AC_SUBS($[]$1 but it didn't work) * configure.in - all hard-coded variables from Makefile.flags.in defined by CHK_OR_DEFINE_VAR * Makefile.flags.in - all hard-coded variables are set from configure now (except for C*FLAGS and our headers and libraries paths * gui/pdfedit.pro, kpdf-kde-3.3.2/qoutputdevices.pro - All variables which might affect installation replaced initialized from CONFIG_* equivalents - TODO I wasn't able to force SYMLINK initialization QMAKE_SYMLINK = $(CONFIG_SYMLINK) doesn't seem to work - I have tried even SYMLINK = $(CONFIG_SYMLINK) withou success * README - information about compilation flags added Changelog v1 -> v2 ================== * ARCH, C{XX}_FLAGS, EXTRA_*C{XX}FLAGS set from configurable by configure parameters in the same way like all others - hopefully no more hardcoded variables in the Makefile.flags.in * README updated to contain information about compilation flags Index: pdfedit-patches/Makefile.flags.in =================================================================== --- pdfedit-patches.orig/Makefile.flags.in 2008-09-09 20:20:01.000000000 -0600 +++ pdfedit-patches/Makefile.flags.in 2008-09-09 20:26:37.000000000 -0600 @@ -22,31 +22,37 @@ CONFIG_LINK = $(CONFIG_CXX) CC = $(CONFIG_CC) CXX = $(CONFIG_CXX) LINK = $(CONFIG_LINK) -# TODO from autoconf -AR = ar cqs +CONFIG_AR = @AR@ +AR = $(CONFIG_AR) CONFIG_RANLIB = @RANLIB@ RANLIB = $(CONFIG_RANLIB) -# TODO from autoconf -COPY = cp -f -COPY_FILE= $(COPY) -COPY_DIR = $(COPY) -r -INSTALL_FILE= $(COPY_FILE) -INSTALL_DIR = $(COPY_DIR) -# TODO from autoconf -DEL_FILE = rm -f -# TODO from autoconf -SYMLINK = ln -sf -# TODO from autoconf -DEL_DIR = rmdir -DEL_FORCE_DIR = rm -rf -MOVE = mv -f -# TODO from autoconf -CHK_DIR_EXISTS= test -d -MKDIR = mkdir -p -SHELL = @SHELL@ +CONFIG_COPY = @COPY@ +COPY = $(CONFIG_COPY) +CONFIG_COPY_FILE = $(COPY) +COPY_FILE= $(CONFIG_COPY_FILE) +CONFIG_COPY_DIR = $(COPY) -r +COPY_DIR = $(CONFIG_COPY_DIR) +CONFIG_INSTALL_FILE = $(COPY_FILE) +INSTALL_FILE= $(CONFIG_INSTALL_FILE) +CONFIG_INSTALL_DIR = $(COPY_DIR) +INSTALL_DIR = $(CONFIG_INSTALL_DIR) +CONFIG_DEL_FILE= @DEL_FILE@ +DEL_FILE = $(CONFIG_DEL_FILE) +CONFIG_SYMLINK = @SYMLINK@ +SYMLINK = $(CONFIG_SYMLINK) +CONFIG_DEL_DIR = @DEL_DIR@ +DEL_DIR = $(CONFIG_DEL_DIR) +CONFIG_DEL_FORCE_DIR = @DEL_FORCE_DIR@ +DEL_FORCE_DIR = $(CONFIG_DEL_FORCE_DIR) +CONFIG_MOVE = @MOVE@ +MOVE = $(MOVE) +CONFIG_CHK_DIR_EXISTS = @CHK_DIR_EXISTS@ +CHK_DIR_EXISTS = $(CONFIG_CHK_DIR_EXISTS) +CONFIG_MKDIR = @MKDIR@ +MKDIR = $(CONFIG_MKDIR) +SHELL = @SHELL@ DOXYGEN_BIN = @DOXYGEN_BIN@ -# TODO from autoconf ? -LIBPREFIX = lib +LIBPREFIX = @LIBPREFIX@ ########################################### # Installation directories @@ -97,17 +103,13 @@ DEBUG = @DEBUG@ # Optimization options OPTIM = @OPTIM@ # Architecture specific options -# TODO how to find out? -ARCH = +ARCH = @ARCH@ # Warning options WARN = @WARN@ -# TODO check whether this is ok also for other platforms -C_EXTRA = -fmessage-length=0 -D_FORTIFY_SOURCE=2 \ - -fno-strict-aliasing +C_EXTRA = @C_EXTRA@ # Note that this value will be used also for pdfedit-core-dev CFLAGS # (so don't put any debug, optimization or architecture specific options here) -CXX_EXTRA = -fmessage-length=0 -D_FORTIFY_SOURCE=2 \ - -fno-strict-aliasing -fexceptions +CXX_EXTRA = @CXX_EXTRA@ ####################################### # Optional C parameters @@ -115,9 +117,9 @@ CXX_EXTRA = -fmessage-length=0 -D_FORTIF # In fact we are not using many pure C files, so this will be usually out of your concern ####################################### -EXTRA_UTILS_CFLAGS = -EXTRA_KERNEL_CFLAGS = -EXTRA_TESTS_CFLAGS = +EXTRA_UTILS_CFLAGS = @EXTRA_UTILS_CFLAGS@ +EXTRA_KERNEL_CFLAGS = @EXTRA_KERNEL_CFLAGS@ +EXTRA_TESTS_CFLAGS = @EXTRA_TESTS_CFLAGS@ ####################################### @@ -128,10 +130,10 @@ EXTRA_TESTS_CFLAGS = # from autoconf --enable-observer-debug OBSERVER_CXXFLAGS = @OBSERVER_CXXFLAGS@ -EXTRA_UTILS_CXXFLAGS = -EXTRA_KERNEL_CXXFLAGS = -EXTRA_TESTS_CXXFLAGS = -EXTRA_GUI_CXXFLAGS = -D CONFIG_DATA_PATH="$(DATA_PATH)" +EXTRA_UTILS_CXXFLAGS = @EXTRA_UTILS_CXXFLAGS@ +EXTRA_KERNEL_CXXFLAGS = @EXTRA_KERNEL_CXXFLAGS@ +EXTRA_TESTS_CXXFLAGS = @EXTRA_TESTS_CXXFLAGS@ +EXTRA_GUI_CXXFLAGS = @EXTRA_GUI_CXXFLAGS@ -D CONFIG_DATA_PATH="$(DATA_PATH)" # same like for compiler stuff we also define 2 levels # CONFIG_{NAME} can be used for qmake direct {NAME} can be used Index: pdfedit-patches/config/env.m4 =================================================================== --- pdfedit-patches.orig/config/env.m4 2008-09-09 19:39:13.000000000 -0600 +++ pdfedit-patches/config/env.m4 2008-09-09 20:26:37.000000000 -0600 @@ -14,3 +14,12 @@ AC_DEFUN(CHK_ENV_VAR_NOTICE,[ fi ]) +AC_DEFUN(CHK_OR_DEFINE_VAR, [ + if test -z "$[]$1" + then + $1=$2 + AC_MSG_NOTICE(Using default $1=$2) + else + AC_MSG_NOTICE(Using provided $1=$[]$1) + fi + ]) Index: pdfedit-patches/configure.in =================================================================== --- pdfedit-patches.orig/configure.in 2008-09-09 20:07:16.000000000 -0600 +++ pdfedit-patches/configure.in 2008-09-09 20:26:37.000000000 -0600 @@ -55,6 +55,46 @@ then AC_MSG_ERROR(Boost IOStreams is required by PDFedit) fi +dnl Default (and configurable) values for files/directories manipulation +dnl programs (you can overwrite them by ./configure NAME=value) +CHK_OR_DEFINE_VAR(COPY, "cp -f") +CHK_OR_DEFINE_VAR(DEL_FILE, "rm -f") +CHK_OR_DEFINE_VAR(DEL_DIR, "rmdir") +CHK_OR_DEFINE_VAR(DEL_FORCE_DIR, "rm -rf") +CHK_OR_DEFINE_VAR(SYMLINK, "ln -s") +CHK_OR_DEFINE_VAR(MOVE, "mv -f") +CHK_OR_DEFINE_VAR(CHK_DIR_EXISTS, "tets -d") +CHK_OR_DEFINE_VAR(MKDIR, "mkdir -p") +AC_SUBST(COPY) +AC_SUBST(DEL_FILE) +AC_SUBST(DEL_DIR) +AC_SUBST(DEL_FORCE_DIR) +AC_SUBST(SYMLINK) +AC_SUBST(MOVE) +AC_SUBST(CHK_DIR_EXISTS) +AC_SUBST(MKDIR) + + +dnl compiler options which might be set by environment viariable +dnl TODO check whether this is ok also for other platforms +CHK_OR_DEFINE_VAR(ARCH, "") +CHK_OR_DEFINE_VAR(C_EXTRA, "-fmessage-length=0 -D_FORTIFY_SOURCE=2 -fno-strict-aliasing") +CHK_OR_DEFINE_VAR(EXTRA_UTILS_CFLAGS, "") +CHK_OR_DEFINE_VAR(EXTRA_KERNEL_CFLAGS, "") +CHK_OR_DEFINE_VAR(EXTRA_TESTS_CFLAGS, "") +CHK_OR_DEFINE_VAR(CXX_EXTRA, "-fmessage-length=0 -D_FORTIFY_SOURCE=2 -fno-strict-aliasing -fexceptions") +CHK_OR_DEFINE_VAR(EXTRA_UTILS_CXXFLAGS, "") +CHK_OR_DEFINE_VAR(EXTRA_KERNEL_CXXFLAGS, "") +CHK_OR_DEFINE_VAR(EXTRA_TESTS_CXXFLAGS, "") +CHK_OR_DEFINE_VAR(EXTRA_GUI_CXXFLAGS, "") + +dnl Default (and configurable) values for libraries +CHK_OR_DEFINE_VAR(AR, "ar cqs") +CHK_OR_DEFINE_VAR(LIBPREFIX, "lib") +AC_SUBST(AR) +AC_SUBST(LIBPREFIX) + + AC_ARG_ENABLE(stack-protector, [AS_HELP_STRING([--enable-stack-protector], [Turn on stack protector (disabled by default)])], Index: pdfedit-patches/src/gui/pdfedit.pro =================================================================== --- pdfedit-patches.orig/src/gui/pdfedit.pro 2008-09-09 19:39:13.000000000 -0600 +++ pdfedit-patches/src/gui/pdfedit.pro 2008-09-09 20:26:37.000000000 -0600 @@ -229,12 +229,23 @@ exists( .menu-trans.h ) { HEADERS += .menu-trans.h } -# Force configure compiler +# Force configure compiler and all other programs used for installation QMAKE_CC = $(CONFIG_CC) QMAKE_CXX = $(CONFIG_CXX) QMAKE_LINK = $(CONFIG_LINK) QMAKE_LINK_SHLIB = $(CONFIG_LINK) QMAKE_RANLIB = $(CONFIG_RANLIB) +QMAKE_AR = $(CONFIG_AR) +QMAKE_COPY = $(CONFIG_COPY) +QMAKE_COPY_FILE = $(CONFIG_COPY_FILE) +QMAKE_COPY_DIR = $(CONFIG_COPY_DIR) +QMAKE_DEL_FILE = $(CONFIG_DEL_FILE) +# qmake doesn't like QMAKE_SYMLINK and ignores it +QMAKE_SYMLINK = $(CONFIG_SYMLINK) +QMAKE_DEL_DIR = $(CONFIG_DEL_DIR) +QMAKE_MOVE = $(CONFIG_MOVE) +QMAKE_CHK_DIR_EXISTS = $(CONFIG_CHK_DIR_EXISTS) +QMAKE_MKDIR = $(CONFIG_MKDIR) # QSA include INCPATH += $(QSAPATH) Index: pdfedit-patches/src/kpdf-kde-3.3.2/qoutputdevices.pro =================================================================== --- pdfedit-patches.orig/src/kpdf-kde-3.3.2/qoutputdevices.pro 2008-09-09 19:39:13.000000000 -0600 +++ pdfedit-patches/src/kpdf-kde-3.3.2/qoutputdevices.pro 2008-09-09 20:26:37.000000000 -0600 @@ -40,11 +40,23 @@ INCPATH += $(MANDATORY_PATHS) # Flags from configuration QMAKE_CXXFLAGS += $(CONFIG_CXXFLAGS) -# Force configure compiler +# Force configure compiler and all other programs used for installation QMAKE_CC = $(CONFIG_CC) -QMAKE_CPP = $(CONFIG_CXX) +QMAKE_CXX = $(CONFIG_CXX) QMAKE_LINK = $(CONFIG_LINK) QMAKE_LINK_SHLIB = $(CONFIG_LINK) +QMAKE_RANLIB = $(CONFIG_RANLIB) +QMAKE_AR = $(CONFIG_AR) +QMAKE_COPY = $(CONFIG_COPY) +QMAKE_COPY_FILE = $(CONFIG_COPY_FILE) +QMAKE_COPY_DIR = $(CONFIG_COPY_DIR) +QMAKE_DEL_FILE = $(CONFIG_DEL_FILE) +# qmake doesn't like QMAKE_SYMLINK and ignores it +QMAKE_SYMLINK = $(CONFIG_SYMLINK) +QMAKE_DEL_DIR = $(CONFIG_DEL_DIR) +QMAKE_MOVE = $(CONFIG_MOVE) +QMAKE_CHK_DIR_EXISTS = $(CONFIG_CHK_DIR_EXISTS) +QMAKE_MKDIR = $(CONFIG_MKDIR) #QOutputDevices source files HEADERS += QOutputDevPixmap.h Index: pdfedit-patches/README =================================================================== --- pdfedit-patches.orig/README 2008-09-09 20:27:03.000000000 -0600 +++ pdfedit-patches/README 2008-09-09 20:33:53.000000000 -0600 @@ -330,6 +330,20 @@ vary on different systems - this one is Note that CFLAGS and CXXFLAGS which can be standardly passed to configure are ignored by our configure script. +However you can influence compiler parameters with the following variables: + - ARCH for architecture specific parameters + - C_EXTRA for CC flags + (-fmessage-length=0 -D_FORTIFY_SOURCE=2 -fno-strict-aliasing will + be used if not defined) + - CXX_EXTRA for CXX flags + (-fmessage-length=0 -D_FORTIFY_SOURCE=2 -fno-strict-aliasing -fexceptions + will be used if not defined) + - EXTRA_UTILS_CFLAGS, EXTRA_KERNEL_CFLAGS, EXTRA_TESTS_CFLAGS used + for CC flags for utils resp. kernel resp. tests directory (only + for internal/developers usage) + - EXTRA_UTILS_CXXFLAGS, EXTRA_KERNEL_CXXFLAGS, EXTRA_TESTS_CXXFLAGS, + EXTRA_GUI_CXXFLAGS same like the above for CXX + Installation ============ To install editor, run -- Michal Hocko |
From: Michal H. <ms...@gm...> - 2008-09-10 04:13:33
Attachments:
add_configurable_variables.patch
|
On Tue, Sep 09, 2008 at 08:35:17PM -0600, Michal Hocko wrote: > It is rather long time since I have started Unified makefiles patchset and > there were several things I was lazy work on those days. Most of them were > marked as "TODO from autoconf" and the main motivation was to make almost > everything configurable from configure script rather than having them > hard-coded. > > This patch sets all those variable (in Makefile.flags.in) from configure. > In the result it means that we can modify them during configuration when > necessary (e.g. ./configure COPY="something else than cp" will use given > "something else than cp" instead of default "cp -f". > > The second important thing which is done here, is the consolidation of all > these variables with those coming out of qmake when it generates makefile. > Qmake has its own idea about COPY, MKDIR, ... variables and we have to force > it to use our configured values. > > I have used the same trick which is already used for unification of > compiler - make all configurable variables used by qmake 2 layered: > CONFIG_NAME is set by configured and used in pro file and NAME used in our > makefiles is initialized from CONFIG_NAME. > > * config/env.m4 > - CHK_OR_DEFINE_VAR(PARAM1, PARAM2) macro added > - PARAM1 stands for variable we want to check and set > - PARAM2 default value if PARAM1 isn't defined yet > - it should be used for all configurable variables because > we can push such a variable by ./configure NAME=value or > from configure itself when needed (just define such > variable) > -TODO - maybe we could include also AC_SUBST into this > macro. Any idea how Martin? (I have tried AC_SUBS($[]$1 but > it didn't work) > * configure.in > - all hard-coded variables from Makefile.flags.in defined by CHK_OR_DEFINE_VAR > * Makefile.flags.in > - all hard-coded variables are set from configure now (except for > C*FLAGS and our headers and libraries paths > * gui/pdfedit.pro, kpdf-kde-3.3.2/qoutputdevices.pro > - All variables which might affect installation replaced initialized > from CONFIG_* equivalents > - TODO I wasn't able to force SYMLINK initialization > QMAKE_SYMLINK = $(CONFIG_SYMLINK) doesn't seem to work - I have tried > even SYMLINK = $(CONFIG_SYMLINK) withou success > * README > - information about compilation flags added > > Changelog v1 -> v2 > ================== > * ARCH, C{XX}_FLAGS, EXTRA_*C{XX}FLAGS set from configurable by configure > parameters in the same way like all others - hopefully no more hardcoded > variables in the Makefile.flags.in Ups, it seems that I have forgot to add AC_SUBST for all these variables. Fixed patch is attached -- Michal Hocko |
From: Michal H. <ms...@gm...> - 2008-09-10 02:53:38
Attachments:
um-cleanup-v2.tar.gz
|
Tarball with patchset is attached -- Michal Hocko |
From: Michal H. <ms...@gm...> - 2008-10-30 12:31:35
|
On Tue, Sep 09, 2008 at 08:35:15PM -0600, Michal Hocko wrote: > Hi, > > This very small patch set is some cleanup for TODOs from unified makefiles > unfinished stuff. > > patch 1: > Changes which files in the source tree root are generated. This also fixes > warning and potential problem of the qmake complaining about ifed() ... endif > construct in the included Makefile.flags. > > patch 2: > Consolidates configurable variables from configure which affects > installation process. I strongly suggest applying this patch even if the > second one doesn't find its way to the CVS. See more details in the patch > description. > > > patch 3: > Adds possibility to make fake install which means that all steps like with > the normal installation are done when doing make install, but no real > file/directories are created and all steps are logged instead. This is > configurable by ./configure --with-fake-install=YES > I think it can be rather handy for us and it doesn't add any further > complexity to our configuration. > > Please let me know what do you think about that. I would like to hear > especially from Martin. Martin, some update here? I would like to commit ASAP. > > > Changelog v1 -> v2 > ================== > * Patch1 added for configure-generated files cleanup -- Michal Hocko |
From: Michal H. <ms...@gm...> - 2008-11-12 12:43:03
|
As there is no feedback for really long time, I will commit the patchset tomorrow. Speak loudly if you have some objections! I consider it not being harmfull and it enables to handle bug 262 in the clean way, so it is even helpfull. I don't expect problems, but it still needs some testing in cygwin and *BSD systems. Martin? On Thu, Oct 30, 2008 at 01:31:28PM +0100, Michal Hocko wrote: > On Tue, Sep 09, 2008 at 08:35:15PM -0600, Michal Hocko wrote: > > Hi, > > > > This very small patch set is some cleanup for TODOs from unified makefiles > > unfinished stuff. > > > > patch 1: > > Changes which files in the source tree root are generated. This also fixes > > warning and potential problem of the qmake complaining about ifed() ... endif > > construct in the included Makefile.flags. > > > > patch 2: > > Consolidates configurable variables from configure which affects > > installation process. I strongly suggest applying this patch even if the > > second one doesn't find its way to the CVS. See more details in the patch > > description. > > > > > > patch 3: > > Adds possibility to make fake install which means that all steps like with > > the normal installation are done when doing make install, but no real > > file/directories are created and all steps are logged instead. This is > > configurable by ./configure --with-fake-install=YES > > I think it can be rather handy for us and it doesn't add any further > > complexity to our configuration. > > > > Please let me know what do you think about that. I would like to hear > > especially from Martin. > > Martin, some update here? I would like to commit ASAP. > > > > > > > Changelog v1 -> v2 > > ================== > > * Patch1 added for configure-generated files cleanup -- Michal Hocko |
From: Michal H. <ms...@gm...> - 2008-11-13 14:10:53
|
Commited. On Wed, Nov 12, 2008 at 01:42:51PM +0100, Michal Hocko wrote: > As there is no feedback for really long time, I will commit the patchset > tomorrow. Speak loudly if you have some objections! > > I consider it not being harmfull and it enables to handle bug 262 in the > clean way, so it is even helpfull. I don't expect problems, but it still > needs some testing in cygwin and *BSD systems. Martin? > > On Thu, Oct 30, 2008 at 01:31:28PM +0100, Michal Hocko wrote: > > On Tue, Sep 09, 2008 at 08:35:15PM -0600, Michal Hocko wrote: > > > Hi, > > > > > > This very small patch set is some cleanup for TODOs from unified makefiles > > > unfinished stuff. > > > > > > patch 1: > > > Changes which files in the source tree root are generated. This also fixes > > > warning and potential problem of the qmake complaining about ifed() ... endif > > > construct in the included Makefile.flags. > > > > > > patch 2: > > > Consolidates configurable variables from configure which affects > > > installation process. I strongly suggest applying this patch even if the > > > second one doesn't find its way to the CVS. See more details in the patch > > > description. > > > > > > > > > patch 3: > > > Adds possibility to make fake install which means that all steps like with > > > the normal installation are done when doing make install, but no real > > > file/directories are created and all steps are logged instead. This is > > > configurable by ./configure --with-fake-install=YES > > > I think it can be rather handy for us and it doesn't add any further > > > complexity to our configuration. > > > > > > Please let me know what do you think about that. I would like to hear > > > especially from Martin. > > > > Martin, some update here? I would like to commit ASAP. > > > > > > > > > > > Changelog v1 -> v2 > > > ================== > > > * Patch1 added for configure-generated files cleanup > > -- > Michal Hocko > > ------------------------------------------------------------------------- > This SF.Net email is sponsored by the Moblin Your Move Developer's challenge > Build the coolest Linux based applications with Moblin SDK & win great prizes > Grand prize is a trip for two to an Open Source event anywhere in the world > http://moblin-contest.org/redirect.php?banner_id=100&url=/ > _______________________________________________ > Pdfedit-devel mailing list > Pdf...@li... > https://lists.sourceforge.net/lists/listinfo/pdfedit-devel -- Michal Hocko |