* 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


git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@9689 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
Derek Atkins 2003-11-18 03:05:58 +00:00
parent 416fd6bb48
commit 358c37da08
5 changed files with 9 additions and 300 deletions

View File

@ -1,3 +1,11 @@
2003-11-17 Derek Atkins <derek@ihtfp.com>
* 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 <derek@ihtfp.com>
* src/engine/test-core/test-engine-stuff.c: don't make a timespec

View File

@ -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 <john@killterm.org>
#
# 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;

View File

@ -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 {}' ';'

View File

@ -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

View File

@ -1,115 +0,0 @@
/* strsub.c -- Do literal line-by line string replacement.
*
* Copyright (c) 2003 John H. Pierce <john@killterm.org>
*
* 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
* <str1> with <str2> and prints the resulting line to stdout.
*
* Lines which do not contain <str1> are printed unchanged.
*/
#define _GNU_SOURCE 1
#include "config.h"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <glib.h>
void do_subst(gchar *, gchar *);
gchar * getwholeline(FILE *);
void useage(void);
void
useage(void)
{
fprintf(stderr,
"Useage: strsub <str1> <str2>\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;
}