diff --git a/ChangeLog b/ChangeLog index f7caa64229..92974bf96c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2003-11-17 Derek Atkins + + * Makefile.am, Makefile.DEPS: + remove Makefile.DEPS because we don't support automake-1.4 anymore + * src/bin/Makefile.am, strsub.c: + remove strsub.c because we don't need it now that we've dropped 1.4 + Fixes #120207 + 2003-11-16 Derek Atkins * src/engine/test-core/test-engine-stuff.c: don't make a timespec diff --git a/Makefile.DEPS b/Makefile.DEPS deleted file mode 100644 index 505d682c84..0000000000 --- a/Makefile.DEPS +++ /dev/null @@ -1,151 +0,0 @@ -# Makefile.DEPS -# -# Automatically generate depends without actually building anything -# This is used for maintainers who won't or can't build all -# parts of a project before running make dist. -# -# Note this is only needed for automake 1.4 and requires gcc. -# If you're using automake 1.5, throw this monstrosity out! -# This is a gross hack, you really should NOT use this. -# -# YOU REALLY SHOULD NOT USE THIS -# -# Copyright 2003 John H. Pierce -# -# 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, or (at your option) -# any later version. -# -# As a special exception to the GNU General Public License, if you -# distribute this file as part of a program that contains a -# configuration script generated by Autoconf, you may include it under -# the same distribution terms that you use for the rest of that program. -# -# Have I mentioned YOU REALLY SHOULD NOT USE THIS? -# -# If you really must use this, add the following to the top level -# Makefile.am and see src/bin for strsub. -# -# Add to EXTRA_DIST Makefile.DEPS (this file) and "distdep-automake1.4-hack" -# Add these targets: -# -#distdep-automake1.4-hack: distdep -# -#distdep: -# $(MAKE) $(AM_MAKE_FLAGS) -f ${top_srcdir}/Makefile.DEPS \ -# all-distdep-recursive -# - -# If you're here trying to get rid of the delay comment out the next line -PAUSE = true - -include Makefile - -# override objects you don't want depended here -# This is needed for autogenerated sources you don't have the tools -# to build. -libgncswig_la_OBJECTS = - -ifeq ($(strip $(DIST_SUBDIRS)),) -DISTDEP_SUBDIRS = $(SUBDIRS) -else -DISTDEP_SUBDIRS = $(DIST_SUBDIRS) -endif - -# Filter out intl and po -ifeq ($(top_builddir), .) -DISTDEP_SUBDIRS := $(filter-out intl po, $(DISTDEP_SUBDIRS)) -endif - -# Get rid of -Werror because we don't get ANY deps then. -# Don't set CFLAGS or any other stuff in COMPILE after this. -COMPILE := $(filter-out -Werror, $(COMPILE)) - -STRSUB_PATH = $(top_builddir)/src/bin -STRSUB_BIN = strsub -STRSUB = $(STRSUB_PATH)/$(STRSUB_BIN) - -ifeq ($(shell $(AUTOMAKE) --version | \ - grep '(GNU automake) 1.4'), ) -DONT_USE_THIS = donotuseme ; -else -DONT_USE_THIS = distdep-recursive -endif - - -donotuseme: ; - @echo "*************************************************************" - @echo "You should NOT use this script with this version of automake." - @echo "Read the comments in Makefile.DEPS" - @echo "To continue without this pause run 'make PAUSE=false dist'" - @echo "*************************************************************" - @if test x$(PAUSE) = xtrue; then \ - echo -n "Pausing" ; \ - i=0; while test $$i -lt 60; do \ - echo -n . ; \ - sleep 1 ; \ - let "i=$$i+1" ; \ - done ; \ - echo "" ; \ - fi - - -$(STRSUB): - $(MAKE) $(AM_MAKEFLAGS) -C $(STRSUB_PATH) $(STRSUB_BIN) - -all: all-distdep-recursive ; - -all-distdep-recursive: $(DONT_USE_THIS) - -distdep-recursive: distdep-local - @full_tsdir=`cd ${top_srcdir} && pwd`; \ - for subdir in $(DISTDEP_SUBDIRS); do \ - if test "$$subdir" != "." && test -d "$$subdir"; then \ - $(MAKE) $(AM_MAKEFLAGS) -f "$$full_tsdir/Makefile.DEPS" \ - -C $$subdir all-distdep-recursive || exit 1; \ - fi \ - done - -distdep-local: $(STRSUB) $(OBJECTS) ; - -# sed plan -# turn: -# foo.o: bar.c ../blah.c \ -# /usr/include/stdio.h top_srcdir/our-incs/baz.h \ -# ../../src/built-header/built.h -# into -# foo.o : \ -# bar.c \ -# blah.c \ -# top_builddir/baz.h \ -# ../../src/built-header/built.h -# -# tr gets us 1 file per line -# s/^\\$// kill the trailing \'s -# s/^$/ kill empty lines -# /^\// d remove headers with absolute paths, they're system ones -# $(STRSUB) "$(top_srcdir)" "$(top_buildir)" -# make relative to build env -# VPATH takes care of non-srcdir build -# - Second sed invocation is to reset the line #'s -# 2,$s/^\(.*\)$/ \1 \\/ add leading space and \ to every line but 1 -# 1s/$/ \\/ add space and \ to line 1 -# $s/ \\$//' remove the space from the last line -%.o: %.c - @echo "creating .deps/$(*F).P" - @$(COMPILE) -MG -MM -o $@ $< | tr ' ' '\012' \ - | $(STRSUB) "$(top_srcdir)" "$(top_builddir)" \ - | sed -e 's/\\$$//' -e '/^$$/ d' -e '/^\// d' \ - | sed -e '2,$$s/^\(.*\)$$/ \1 \\/' -e '1s/$$/ \\/' -e '$$s/ \\$$//' \ - > .deps/$(*F).P || exit 1; - -%.lo: %.c - @echo "creating .deps/$(*F).P" - @$(COMPILE) -MG -MM -o $@ $< | tr ' ' '\012' \ - | $(STRSUB) "$(top_srcdir)" "$(top_builddir)" \ - | sed -e 's/\\$$//' -e '/^$$/ d' -e '/^\// d' \ - | sed -e '2,$$s/^\(.*\)$$/ \1 \\/' -e '1s/$$/ \\/' -e '$$s/ \\$$//' \ - > .deps/$(*F).P || exit 1; - - diff --git a/Makefile.am b/Makefile.am index 849d66dea3..fe8460b0bd 100644 --- a/Makefile.am +++ b/Makefile.am @@ -6,12 +6,6 @@ docdir = ${GNC_DOC_INSTALL_DIR} GNC_CTAGS_FILE = @GNC_CTAGS_FILE@ GNC_ETAGS_FILE = @GNC_ETAGS_FILE@ -if GNC_FALSE -noinst_PROGRAMS = dummy - -dummy_SOURCES = dummy.c -endif - noinst_DATA = make-gnucash-patch make-gnucash-potfiles doc_DATA = \ @@ -59,9 +53,7 @@ EXTRA_DIST = config.rpath \ po/glossary/txt-to-pot.sh \ intltool-extract.in \ intltool-merge.in \ - intltool-update.in \ - Makefile.DEPS \ - distdep-automake1.4-hack + intltool-update.in bin_SCRIPTS = gnucash-config @@ -134,27 +126,6 @@ ACLOCAL_AMFLAGS = -I m4 doc: $(MAKE) -C src/doc doc -.PHONY: distdep - -# -# All references to distdep-automake1.4-hack can be removed when -# Automake 1.4 is no longer used to compile gnucash. The files -# Makefile.DEPS and src/bin/strsub.c are also specific to AM 1.4 and -# can be removed at the same time. See the commit at 2003-01-15 00:45 -# UTC for more information. -# -distdep-automake1.4-hack: distdep - : > distdep-automake1.4-hack - -distdep: - test x"$(DEP_FILES)" = x || \ - $(MAKE) $(AM_MAKE_FLAGS) -f ${top_srcdir}/Makefile.DEPS \ - all-distdep-recursive - -dist-hook: - rm -f $(distdir)/distdep-automake1.4-hack - rm -f distdep-automake1.4-hack - distcleancheck_listfiles = \ find -type f -exec sh -c 'test -f ${srcdir}/{} || echo {}' ';' diff --git a/src/bin/Makefile.am b/src/bin/Makefile.am index bccb7cd678..a3fd205531 100644 --- a/src/bin/Makefile.am +++ b/src/bin/Makefile.am @@ -22,10 +22,6 @@ gnc_common_scripts = gnucash gnucash-env gnucash-run-script gnucash-make-guids bin_SCRIPTS = ${gnc_common_scripts} -noinst_PROGRAMS = strsub -strsub_SOURCES = strsub.c -strsub_LDADD = ${GLIB_LIBS} - # if you change gncoverridedir, make sure you change ./overrides/Makefile.am too. gncoverridesdir = ${GNC_LIBEXECDIR}/overrides diff --git a/src/bin/strsub.c b/src/bin/strsub.c deleted file mode 100644 index 75fde9e1c9..0000000000 --- a/src/bin/strsub.c +++ /dev/null @@ -1,115 +0,0 @@ -/* strsub.c -- Do literal line-by line string replacement. - * - * Copyright (c) 2003 John H. Pierce - * - * 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. - * - * See http://www.gnu.org/ for details. - * - * This is a very stupid program for the distdep target because I - * can't figure out an easy way to get sed to not interpret RE chars - * in the pattern space without complicated and error-prone escaping. - * - * Reads stdin line by line and replaces the first occurance of - * with and prints the resulting line to stdout. - * - * Lines which do not contain are printed unchanged. - */ - -#define _GNU_SOURCE 1 - -#include "config.h" - -#include -#include -#include -#include - -void do_subst(gchar *, gchar *); -gchar * getwholeline(FILE *); -void useage(void); - -void -useage(void) -{ - fprintf(stderr, - "Useage: strsub \n" - " Replaces the first occurance of str1 with str2 in each line.\n"); - exit(EXIT_FAILURE); -} - -int -main(int argc, char **argv) -{ - gchar *str1 = NULL; - gchar *str2 = NULL; - - if (argc != 3) - useage(); - - if (argv + 1) - str1 = (gchar *)*(argv + 1); - - if (argv + 2) - str2 = (gchar *)*(argv + 2); - - if (!str1 || !str2) - useage(); - - do_subst(str1, str2); - - exit(EXIT_SUCCESS); -} - -void -do_subst(gchar *s1, gchar *s2) -{ - gchar *inln; - gchar **split; - gchar *jstr; - - while ((inln = getwholeline(stdin))) - { - split = g_strsplit(inln, s1, 1); - g_assert(split != NULL); - jstr = g_strjoinv(s2, split); - printf(jstr); - g_free(jstr); - g_free(inln); - g_strfreev(split); - } -} - -/* read a whole line that may be really big. free return w/g_free() */ -gchar * -getwholeline(FILE *infile) -{ - GStringChunk *gs; - size_t retlen; - const gint strsize = 100; - gchar tmp[100]; - gchar *ostr = NULL; - gchar *ret; - - if ((gs = g_string_chunk_new(strsize))) - { - do - { - if(!fgets((char*)tmp, strsize, infile)) - break; - - ostr = g_string_chunk_insert(gs, tmp); - - retlen = strlen(ostr); - } while (retlen - 1 >= 0 && *(ostr + retlen - 1) != '\n'); - } - - - ret = g_strdup(ostr); - g_string_chunk_free(gs); - return ret; -} -