From 1a5be1047036468cf73d3c989ff4490dd1ae559f Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Henrik=20Grubbstr=C3=B6m=20=28Grubba=29?=
 <grubba@grubba.org>
Date: Mon, 3 Nov 1997 04:15:29 +0100
Subject: [PATCH] Added kluge to allow interpret.o to be compiled with lower
 optimization than the rest of pike.

Rev: src/Makefile.in:1.43
---
 src/Makefile.in | 32 ++++++++++++++++++++++----------
 1 file changed, 22 insertions(+), 10 deletions(-)

diff --git a/src/Makefile.in b/src/Makefile.in
index 70218b6338..21ee90bf8c 100644
--- a/src/Makefile.in
+++ b/src/Makefile.in
@@ -34,6 +34,11 @@ YFLAGS=-d -v
 PROFIL=
 #PROFIL=-pg
 
+#
+# OS dependant flags
+#
+OSFLAGS=
+
 #
 #Enable warnings from the compiler, if wanted.
 #
@@ -59,7 +64,8 @@ LDFLAGS=$(CFLAGS) @LDFLAGS@ @LINKFORSHARED@
 
 RUNPIKE=$(TMP_BUILDDIR)/pike -m $(TMP_LIBDIR)/master.pike $(PIKEOPTS)
 
-MAKE_FLAGS = "prefix=$(prefix)" "exec_prefix=$(exec_prefix)" "CC=$(CC)" "OTHERFLAGS=$(OTHERFLAGS)" "TMP_BINDIR=$(TMP_BINDIR)" "DEFINES=$(DEFINES)" "TMP_LIBDIR=$(TMP_LIBDIR)" "RUNPIKE=$(RUNPIKE)" "INSTALL=$(INSTALL)"
+MOST_MAKE_FLAGS = "prefix=$(prefix)" "exec_prefix=$(exec_prefix)" "CC=$(CC)" "TMP_BINDIR=$(TMP_BINDIR)" "DEFINES=$(DEFINES)" "TMP_LIBDIR=$(TMP_LIBDIR)" "RUNPIKE=$(RUNPIKE)" "INSTALL=$(INSTALL)"
+MAKE_FLAGS = $(MOST_MAKE_FLAGS) "OTHERFLAGS=$(OTHERFLAGS)" 
 
 # Add alloca.o if you don't have alloca() on your machine.
 # Add ualarm.o if you don't have ualarm() on your machine.
@@ -81,7 +87,6 @@ OBJ= \
  fsort.o \
  gc.o \
  hashtable.o \
- interpret.o \
  las.o \
  lex.o \
  multiset.o \
@@ -113,24 +118,31 @@ OBJ= \
 all: module_objects
 	$(MAKE) $(MAKE_FLAGS) pike
 
-pike: $(OBJ) modules/linker_options
+pike: $(OBJ) compile_interpret modules/linker_options
 	-@mv pike pike.old 2>/dev/null || true
-	$(LD) $(LDFLAGS) $(OBJ) `cat modules/linker_options` $(LIBS) -o pike
+	$(LD) $(LDFLAGS) $(OBJ) interpret.o `cat modules/linker_options` $(LIBS) -o pike
 
 # purify
-pure: $(OBJ) module_objects
+pure: $(OBJ) compile_interpret module_objects
 	-@mv pike pike.old 2>/dev/null || true
-	purify -free-queue-length=500 -inuse-at-exit=yes -chain-length=12 gcc $(LDFLAGS) $(OBJ) `cat modules/linker_options` $(LIBS) -o pike
+	purify -free-queue-length=500 -inuse-at-exit=yes -chain-length=12 gcc $(LDFLAGS) $(OBJ) interpret.o `cat modules/linker_options` $(LIBS) -o pike
 
 # purecov
-cover: $(OBJ) module_objects
+cover: $(OBJ) compile_interpret module_objects
 	-@mv pike pike.old 2>/dev/null || true
-	purecov purify -free-queue-length=500 -inuse-at-exit=yes -chain-length=12 gcc $(LDFLAGS) $(OBJ) `cat modules/linker_options` $(LIBS) -o pike
+	purecov purify -free-queue-length=500 -inuse-at-exit=yes -chain-length=12 gcc $(LDFLAGS) $(OBJ) interpret.o `cat modules/linker_options` $(LIBS) -o pike
 
 # quantify
-quant: $(OBJ) module_objects
+quant: $(OBJ) compile_interpret module_objects
 	-@mv pike pike.old 2>/dev/null || true
-	quantify gcc $(LDFLAGS) $(OBJ) `cat modules/linker_options` $(LIBS) -o pike
+	quantify gcc $(LDFLAGS) $(OBJ) interpret.o `cat modules/linker_options` $(LIBS) -o pike
+
+# Several optimizers have problems with interpret.c
+# First try compiling with optimization and if that doesn't work, without.
+compile_interpret : force
+	$(MAKE) $(MAKE_FLAGS) interpret.o || NO_ULIMIT=yes $(MAKE) $(MOST_MAKE_FLAGS) "OPTIMIZE=" interpret.o
+
+force :
 
 # install
 install:
-- 
GitLab