spim-8.0-r1-respect_env.patch 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184
  1. --- spim/Makefile 2010-08-01 22:14:53.352906061 +0200
  2. +++ spim/Makefile 2010-08-01 22:15:00.994905920 +0200
  3. @@ -66,13 +66,13 @@
  4. # Full path for the directory that will hold the executable files:
  5. -BIN_DIR = /usr/local/bin
  6. +BIN_DIR = $(DESTDIR)/usr/bin
  7. # Full path for the directory that will hold the exception handler:
  8. -EXCEPTION_DIR = /usr/local/lib/spim
  9. +EXCEPTION_DIR = $(DESTDIR)/var/lib/spim
  10. # Full path for the directory that will hold the man files:
  11. -MAN_DIR = /usr/local/man/en
  12. +MAN_DIR = $(DESTDIR)/usr/share/man
  13. # If you have flex, use it instead of lex. If you use flex, define this
  14. @@ -104,11 +104,10 @@
  15. DEFINES = $(ENDIAN) $(MEM_SIZES) -DDEFAULT_EXCEPTION_HANDLER="\"$(EXCEPTION_DIR)/exceptions.s\"" -DSPIM_VERSION="\"`cat ../VERSION`\""
  16. -CC = gcc
  17. -CFLAGS = -I. -I$(CPU_DIR) $(DEFINES) -g -Wall
  18. +CC ?= gcc
  19. +CFLAGS += -I. -I$(CPU_DIR) $(DEFINES) -Wall
  20. YFLAGS = -d --file-prefix=y
  21. YCFLAGS =
  22. -LDFLAGS = -lm
  23. CSH = bash
  24. # lex.yy.c is usually compiled with -O to speed it up.
  25. @@ -122,10 +121,10 @@
  26. spim: force
  27. - make -f Makefile spim2
  28. + $(MAKE) -f Makefile spim2
  29. spim2: $(OBJS) spim.o
  30. - $(CC) -g $(OBJS) spim.o $(LDFLAGS) -o spim -lm
  31. + $(CC) $(OBJS) spim.o $(LDFLAGS) -o spim -lm
  32. force: configuration
  33. @@ -143,19 +142,19 @@
  34. @echo
  35. @echo "Testing tt.bare.s:"
  36. $(CSH) -c "./spim -delayed_branches -delayed_loads -noexception -file $(TEST_DIR)/tt.bare.s >& test.out"
  37. - @tail -2 test.out
  38. + @tail -n2 test.out
  39. @echo
  40. @echo
  41. @echo "Testing tt.core.s:"
  42. $(CSH) -c "./spim -ef $(CPU_DIR)/exceptions.s -file $(TEST_DIR)/tt.core.s < $(TEST_DIR)/tt.in >& test.out"
  43. - @tail -2 test.out
  44. + @tail -n2 test.out
  45. @echo
  46. @echo
  47. @echo "Testing tt.endian.s:"
  48. $(CSH) -c "./spim -ef $(CPU_DIR)/exceptions.s -file $(TEST_DIR)/tt.endian.s >& test.out"
  49. - @tail -2 test.out
  50. + @tail -n2 test.out
  51. @echo
  52. @echo
  53. @@ -166,13 +165,13 @@
  54. @echo
  55. @echo "Testing tt.alu.bare.s:"
  56. $(CSH) -c "./spim -bare -noexception -file $(TEST_DIR)/tt.alu.bare.s >& test.out"
  57. - @tail -2 test.out
  58. + @tail -n2 test.out
  59. @echo
  60. @echo
  61. @echo "Testing tt.fpt.bare.s:"
  62. $(CSH) -c "./spim -bare -noexception -file $(TEST_DIR)/tt.fpu.bare.s >& test.out"
  63. - @tail -2 test.out
  64. + @tail -n2 test.out
  65. @echo
  66. @echo
  67. @@ -192,8 +191,6 @@
  68. install -m 0444 $(CPU_DIR)/exceptions.s $(EXCEPTION_DIR)/exceptions.s
  69. install-man:
  70. - install -d $(MAN_DIR)
  71. - install -m 0444 $(DOC_DIR)/spim.man $(MAN_DIR)
  72. very-clean: clean
  73. rm -f configuration
  74. --- xspim/Makefile 2010-08-01 22:14:53.351905921 +0200
  75. +++ xspim/Makefile 2010-08-01 22:26:08.361917058 +0200
  76. @@ -169,18 +169,18 @@
  77. VARDBDIR = $(VARDIR)/lib
  78. - AR = ar clq
  79. + AR = $(AR) clq
  80. # Nice try but useless: make will inherit BOOTSTRAPCFLAGS
  81. # from top Makefile
  82. BOOTSTRAPCFLAGS =
  83. - CC = gcc -m32
  84. - AS = gcc -m32 -c -x assembler
  85. + CC ?= gcc -m32
  86. + AS ?= gcc -m32 -c -x assembler
  87. .SUFFIXES: .cc
  88. - CXX = c++ -m32
  89. + CXX ?= c++ -m32
  90. CXXFILT = c++filt
  91. @@ -199,14 +199,14 @@
  92. COMPRESS = compress
  93. GZIPCMD = gzip
  94. - CPP = cpp $(STD_CPP_DEFINES)
  95. - RAWCPP = cpp -undef $(STD_CPP_OPTIONS)
  96. - PREPROCESSCMD = gcc -m32 -E $(STD_CPP_DEFINES)
  97. + CPP = $(CPP) $(STD_CPP_DEFINES)
  98. + RAWCPP = $(CPP) -undef $(STD_CPP_OPTIONS)
  99. + PREPROCESSCMD = $(CC) -E $(STD_CPP_DEFINES)
  100. INSTALL = install
  101. INSTALLFLAGS = -c
  102. - LD = gcc -m32 -nostdlib
  103. + LD ?= $(CC) -nostdlib
  104. LEX = flex -l
  105. M4 = m4
  106. @@ -270,18 +270,18 @@
  107. COL = col
  108. COLFLAGS = -b
  109. - MODCC = gcc -m32
  110. + MODCC ?= $(CC)
  111. - MODCPP = cpp
  112. + MODCPP = $(CPP)
  113. MODCFLAGS = $(CFLAGS)
  114. - MODAS = gcc -m32 -c -x assembler
  115. + MODAS ?= $(CC) -c -x assembler
  116. MODASFLAGS =
  117. - MODLD = gcc -m32 -nostdlib
  118. + MODLD ?= $(CC) -nostdlib
  119. MODLDFLAGS =
  120. MODLDCOMBINEFLAGS = -r
  121. - MODAR = ar clq
  122. + MODAR ?= $(AR) clq
  123. MODRANLIB = ranlib
  124. @@ -330,7 +330,7 @@
  125. ALLINCLUDES = $(INCLUDES) $(EXTRA_INCLUDES) $(TOP_INCLUDES) $(INSTALLED_INCLUDES) $(STD_INCLUDES)
  126. ALLDEFINES = $(ALLINCLUDES) $(STD_DEFINES) $(PROTO_DEFINES) $(THREADS_DEFINES) $(MODULE_DEFINES) $(DEFINES) $(EXTRA_DEFINES)
  127. - CFLAGS = $(CDEBUGFLAGS) $(CCOPTIONS) $(THREADS_CFLAGS) $(MODULE_CFLAGS) $(ALLDEFINES)
  128. + CFLAGS += $(CCOPTIONS) $(THREADS_CFLAGS) $(MODULE_CFLAGS) $(ALLDEFINES)
  129. LINTFLAGS = $(LINTOPTS) -DLINT $(ALLDEFINES) $(DEPEND_DEFINES)
  130. LDPRELIB = $(INSTALLED_LIBS)
  131. LDPOSTLIB =
  132. @@ -339,9 +339,9 @@
  133. LDLIBS = $(LDPOSTLIBS) $(THREADS_LIBS) $(SYS_LIBRARIES) $(EXTRA_LIBRARIES)
  134. - CCLINK = $(CC)
  135. + CCLINK = $(CC) $(LDFLAGS)
  136. - CXXLINK = $(CXX)
  137. + CXXLINK = $(CXX) $(LDFLAGS)
  138. LDSTRIPFLAGS = -x
  139. LDCOMBINEFLAGS = -r