2008-04-15 18:47:20 +02:00
|
|
|
Patch tint 0.03b to be usable as coreboot payload, linked against
|
2010-09-16 23:36:44 +02:00
|
|
|
the libpayload library.
|
2008-04-15 18:47:20 +02:00
|
|
|
|
|
|
|
Signed-off-by: Uwe Hermann <uwe@hermann-uwe.de>
|
|
|
|
|
2010-09-16 23:36:44 +02:00
|
|
|
|
|
|
|
Add default libpayload build, xcompile, and lpgcc setup to tint.
|
|
|
|
|
|
|
|
Signed-off-by: Marc Jones <marc.jones@gmail.com>
|
|
|
|
|
|
|
|
diff -rupN tintorig/Makefile tint/Makefile
|
|
|
|
--- tintorig/Makefile 2005-07-17 05:30:54.000000000 -0600
|
|
|
|
+++ tint/Makefile 2010-08-23 18:06:24.671875000 -0600
|
|
|
|
@@ -28,6 +28,65 @@
|
|
|
|
# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
|
|
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
|
|
|
|
|
|
+$(if $(wildcard .xcompile),,$(eval $(shell bash ./xcompile.sh &> .xcompile)))
|
|
|
|
+include .xcompile
|
|
|
|
+
|
|
|
|
+LIBCONFIG_PATH := ../libpayload
|
|
|
|
+LIBPAYLOAD_DIR := ./libpayloadbin
|
|
|
|
+LPCC := $(LIBPAYLOAD_DIR)/libpayload/bin/lpgcc
|
|
|
|
+LPAS := $(LIBPAYLOAD_DIR)/libpayload/bin/lpas
|
|
|
|
+HAVE_LIBPAYLOAD := $(wildcard $(LIBPAYLOAD_DIR)/libpayload/lib/libpayload.a)
|
|
|
|
+LIB_CONFIG ?= defconfig
|
|
|
|
+
|
|
|
|
+# CFLAGS := -Wall -Werror -Os
|
|
|
|
+CFLAGS := -Wall -g -Os
|
|
|
|
+TARGET := tint
|
|
|
|
+OBJS := $(TARGET).o engine.o io.o utils.o
|
|
|
|
+
|
|
|
|
+# Make is silent per default, but 'make V=1' will show all compiler calls.
|
|
|
|
+ifneq ($(V),1)
|
|
|
|
+Q := @
|
|
|
|
+endif
|
|
|
|
+
|
|
|
|
+all: $(TARGET).elf
|
|
|
|
+# printf" CC $(CC)\n"
|
|
|
|
+
|
|
|
|
+$(TARGET).elf: $(OBJS) libpayload
|
|
|
|
+ $(Q)printf " LPCC $(subst $(shell pwd)/,,$(@))\n"
|
|
|
|
+ $(Q)$(LPCC) -o $@ $(OBJS)
|
|
|
|
+ $(Q)$(OBJCOPY) --only-keep-debug $@ tint.debug
|
|
|
|
+ $(Q)$(OBJCOPY) --strip-debug $@
|
|
|
|
+ $(Q)$(OBJCOPY) --add-gnu-debuglink=tint.debug $@
|
|
|
|
+
|
|
|
|
+%.o: %.c libpayload
|
|
|
|
+ $(Q)printf " LPCC $(subst $(shell pwd)/,,$(@))\n"
|
|
|
|
+ $(Q)$(LPCC) $(CFLAGS) $(CPPFLAGS) -c -o $@ $<
|
|
|
|
+
|
|
|
|
+%.S.o: %.S libpayload
|
|
|
|
+ $(Q)printf " LPAS $(subst $(shell pwd)/,,$(@))\n"
|
|
|
|
+ $(Q)$(LPAS) $(ASFLAGS) --32 -o $@ $<
|
|
|
|
+
|
|
|
|
+ifneq ($(strip $(HAVE_LIBPAYLOAD)),)
|
|
|
|
+libpayload:
|
|
|
|
+ $(Q)printf "Found Libpayload $(LIBPAYLOAD_DIR).\n"
|
|
|
|
+else
|
|
|
|
+libpayload:
|
|
|
|
+ $(Q)printf "Building libpayload @ $(LIBCONFIG_PATH).\n"
|
|
|
|
+ $(Q)make -C $(LIBCONFIG_PATH) distclean
|
|
|
|
+ $(Q)make -C $(LIBCONFIG_PATH) $(LIB_CONFIG)
|
|
|
|
+ $(Q)make -C $(LIBCONFIG_PATH) DESTDIR=$(shell pwd)/$(LIBPAYLOAD_DIR) install
|
|
|
|
+endif
|
|
|
|
+
|
|
|
|
+clean:
|
|
|
|
+ $(Q)rm -f $(TARGET).elf $(TARGET).debug *.o
|
|
|
|
+ $(Q)rm .xcompile
|
|
|
|
+
|
|
|
|
+distclean: clean
|
|
|
|
+ $(Q)rm -rf $(LIBPAYLOAD_DIR)
|
|
|
|
+
|
|
|
|
+# Original tint targets
|
|
|
|
+ifdef $(UNUSED)
|
|
|
|
+
|
|
|
|
#CROSS = arm-linux-
|
|
|
|
|
|
|
|
bindir = $(DESTDIR)/usr/games
|
|
|
|
@@ -110,3 +169,4 @@ clean:
|
|
|
|
distclean: clean
|
|
|
|
$(MAKE) -C debian clean
|
|
|
|
|
|
|
|
+endif
|
|
|
|
diff -rupN tintorig/config.h tint/config.h
|
|
|
|
--- tintorig/config.h 2001-12-07 16:03:24.000000000 -0700
|
|
|
|
+++ tint/config.h 2010-01-27 13:59:18.000000000 -0700
|
2008-04-15 18:47:20 +02:00
|
|
|
@@ -29,7 +29,16 @@
|
|
|
|
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
|
|
*/
|
2010-09-16 23:36:44 +02:00
|
|
|
|
2008-04-15 18:47:20 +02:00
|
|
|
+#include <libpayload.h>
|
|
|
|
+#include <curses.h>
|
|
|
|
+#define random(x) rand(x)
|
|
|
|
+#define srandom(x) srand(x)
|
|
|
|
+#define curs_set(x)
|
2008-05-13 23:29:48 +02:00
|
|
|
+
|
2008-04-15 18:47:20 +02:00
|
|
|
+
|
|
|
|
/* Score file */
|
|
|
|
+#if 0
|
|
|
|
const char scorefile[] = SCOREFILE;
|
|
|
|
+#endif
|
2010-09-16 23:36:44 +02:00
|
|
|
|
2008-04-15 18:47:20 +02:00
|
|
|
#endif /* #ifndef CONFIG_H */
|
2010-09-16 23:36:44 +02:00
|
|
|
diff -rupN tintorig/engine.c tint/engine.c
|
|
|
|
--- tintorig/engine.c 2005-07-17 05:26:22.000000000 -0600
|
|
|
|
+++ tint/engine.c 2010-01-27 13:59:18.000000000 -0700
|
2008-04-15 18:47:20 +02:00
|
|
|
@@ -27,8 +27,12 @@
|
|
|
|
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
|
|
*/
|
2010-09-16 23:36:44 +02:00
|
|
|
|
2008-04-15 18:47:20 +02:00
|
|
|
+#include "config.h"
|
|
|
|
+
|
|
|
|
+#if 0
|
|
|
|
#include <stdlib.h>
|
|
|
|
#include <string.h>
|
|
|
|
+#endif
|
2010-09-16 23:36:44 +02:00
|
|
|
|
2008-04-15 18:47:20 +02:00
|
|
|
#include "typedefs.h"
|
|
|
|
#include "utils.h"
|
2010-09-16 23:36:44 +02:00
|
|
|
diff -rupN tintorig/io.c tint/io.c
|
|
|
|
--- tintorig/io.c 2001-12-07 08:48:20.000000000 -0700
|
|
|
|
+++ tint/io.c 2010-01-27 13:59:18.000000000 -0700
|
2008-04-15 18:47:20 +02:00
|
|
|
@@ -27,9 +27,13 @@
|
|
|
|
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
|
|
*/
|
2010-09-16 23:36:44 +02:00
|
|
|
|
2008-04-15 18:47:20 +02:00
|
|
|
+#include "config.h"
|
|
|
|
+
|
|
|
|
+#if 0
|
|
|
|
#include <stdarg.h> /* va_list(), va_start(), va_end() */
|
|
|
|
#include <sys/time.h> /* gettimeofday() */
|
|
|
|
#include <unistd.h> /* gettimeofday() */
|
|
|
|
+#endif
|
2010-09-16 23:36:44 +02:00
|
|
|
|
2008-04-15 18:47:20 +02:00
|
|
|
#include <curses.h>
|
2010-09-16 23:36:44 +02:00
|
|
|
|
|
|
|
@@ -70,7 +74,11 @@ static int in_timeleft;
|
2008-04-15 18:47:20 +02:00
|
|
|
/* Initialize screen */
|
|
|
|
void io_init ()
|
|
|
|
{
|
|
|
|
+ curses_enable_serial(0);
|
|
|
|
+ curses_enable_vga(1);
|
|
|
|
initscr ();
|
|
|
|
+ halfdelay(1);
|
|
|
|
+ timeout(1);
|
|
|
|
start_color ();
|
|
|
|
curs_set (CURSOR_INVISIBLE);
|
|
|
|
out_attr = A_NORMAL;
|
2010-09-16 23:36:44 +02:00
|
|
|
@@ -176,11 +184,17 @@ void out_beep ()
|
2008-04-15 18:47:20 +02:00
|
|
|
/* Read a character. Please note that you MUST call in_timeout() before in_getch() */
|
|
|
|
int in_getch ()
|
|
|
|
{
|
|
|
|
+#if 0
|
|
|
|
struct timeval starttv,endtv;
|
|
|
|
+#endif
|
|
|
|
int ch;
|
|
|
|
+#if 0
|
|
|
|
timeout (in_timeleft / 1000);
|
|
|
|
gettimeofday (&starttv,NULL);
|
|
|
|
+#endif
|
|
|
|
ch = getch ();
|
|
|
|
+ mdelay(150);
|
|
|
|
+#if 0
|
|
|
|
gettimeofday (&endtv,NULL);
|
|
|
|
/* Timeout? */
|
|
|
|
if (ch == ERR)
|
2010-09-16 23:36:44 +02:00
|
|
|
@@ -198,6 +212,7 @@ int in_getch ()
|
2008-04-15 18:47:20 +02:00
|
|
|
in_timeleft -= endtv.tv_usec;
|
|
|
|
if (in_timeleft <= 0) in_timeleft = in_timetotal;
|
|
|
|
}
|
|
|
|
+#endif
|
|
|
|
return ch;
|
|
|
|
}
|
2010-09-16 23:36:44 +02:00
|
|
|
|
|
|
|
diff -rupN tintorig/tint.c tint/tint.c
|
|
|
|
--- tintorig/tint.c 2005-07-17 05:26:43.000000000 -0600
|
|
|
|
+++ tint/tint.c 2010-08-23 18:13:53.281250000 -0600
|
|
|
|
@@ -1,4 +1,3 @@
|
|
|
|
-
|
|
|
|
/*
|
|
|
|
* Copyright (c) Abraham vd Merwe <abz@blio.net>
|
|
|
|
* All rights reserved.
|
|
|
|
@@ -27,6 +26,7 @@
|
2008-04-15 18:47:20 +02:00
|
|
|
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
|
|
*/
|
2010-09-16 23:36:44 +02:00
|
|
|
|
2008-04-15 18:47:20 +02:00
|
|
|
+#if 0
|
|
|
|
#include <stdlib.h>
|
|
|
|
#include <stdio.h>
|
|
|
|
#include <string.h>
|
2010-09-16 23:36:44 +02:00
|
|
|
@@ -34,6 +34,7 @@
|
2008-04-15 18:47:20 +02:00
|
|
|
#include <pwd.h>
|
|
|
|
#include <sys/types.h>
|
|
|
|
#include <unistd.h>
|
|
|
|
+#endif
|
2010-09-16 23:36:44 +02:00
|
|
|
|
2008-04-15 18:47:20 +02:00
|
|
|
#include "typedefs.h"
|
|
|
|
#include "utils.h"
|
2010-09-16 23:36:44 +02:00
|
|
|
@@ -321,6 +322,7 @@ typedef struct
|
2008-04-15 18:47:20 +02:00
|
|
|
time_t timestamp;
|
|
|
|
} score_t;
|
2010-09-16 23:36:44 +02:00
|
|
|
|
2008-04-15 18:47:20 +02:00
|
|
|
+#if 0
|
|
|
|
static void getname (char *name)
|
|
|
|
{
|
|
|
|
struct passwd *pw = getpwuid (geteuid ());
|
2010-09-16 23:36:44 +02:00
|
|
|
@@ -337,7 +339,9 @@ static void getname (char *name)
|
2008-04-15 18:47:20 +02:00
|
|
|
name[NAMELEN - 1] = '\0';
|
|
|
|
}
|
|
|
|
}
|
|
|
|
+#endif
|
2010-09-16 23:36:44 +02:00
|
|
|
|
2008-04-15 18:47:20 +02:00
|
|
|
+#if 0
|
|
|
|
static void err1 ()
|
|
|
|
{
|
|
|
|
fprintf (stderr,"Error creating %s\n",scorefile);
|
2010-09-16 23:36:44 +02:00
|
|
|
@@ -349,10 +353,11 @@ static void err2 ()
|
2008-04-15 18:47:20 +02:00
|
|
|
fprintf (stderr,"Error writing to %s\n",scorefile);
|
|
|
|
exit (EXIT_FAILURE);
|
|
|
|
}
|
|
|
|
+#endif
|
2010-09-16 23:36:44 +02:00
|
|
|
|
2008-04-15 18:47:20 +02:00
|
|
|
void showplayerstats (engine_t *engine)
|
|
|
|
{
|
|
|
|
- fprintf (stderr,
|
|
|
|
+ printf (
|
|
|
|
"\n\t PLAYER STATISTICS\n\n\t"
|
|
|
|
"Score %11d\n\t"
|
|
|
|
"Efficiency %11d\n\t"
|
2010-09-16 23:36:44 +02:00
|
|
|
@@ -360,6 +365,7 @@ void showplayerstats (engine_t *engine)
|
2008-04-15 18:47:20 +02:00
|
|
|
GETSCORE (engine->score),engine->status.efficiency,GETSCORE (engine->score) / getsum ());
|
|
|
|
}
|
2010-09-16 23:36:44 +02:00
|
|
|
|
2008-04-15 18:47:20 +02:00
|
|
|
+#if 0
|
|
|
|
static void createscores (int score)
|
|
|
|
{
|
|
|
|
FILE *handle;
|
2010-09-16 23:36:44 +02:00
|
|
|
@@ -394,7 +400,9 @@ static void createscores (int score)
|
2008-04-15 18:47:20 +02:00
|
|
|
fprintf (stderr,"%s",scoretitle);
|
|
|
|
fprintf (stderr,"\t 1* %7d %s\n\n",score,scores[0].name);
|
|
|
|
}
|
|
|
|
+#endif
|
2010-09-16 23:36:44 +02:00
|
|
|
|
2008-04-15 18:47:20 +02:00
|
|
|
+#if 0
|
|
|
|
static int cmpscores (const void *a,const void *b)
|
|
|
|
{
|
|
|
|
int result;
|
2010-09-16 23:36:44 +02:00
|
|
|
@@ -412,7 +420,9 @@ static int cmpscores (const void *a,cons
|
2008-04-15 18:47:20 +02:00
|
|
|
/* timestamps is equal */
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
+#endif
|
2010-09-16 23:36:44 +02:00
|
|
|
|
2008-04-15 18:47:20 +02:00
|
|
|
+#if 0
|
|
|
|
static void savescores (int score)
|
|
|
|
{
|
|
|
|
FILE *handle;
|
2010-09-16 23:36:44 +02:00
|
|
|
@@ -490,11 +500,13 @@ static void savescores (int score)
|
2008-04-15 18:47:20 +02:00
|
|
|
}
|
|
|
|
fprintf (stderr,"\n");
|
|
|
|
}
|
|
|
|
+#endif
|
2010-09-16 23:36:44 +02:00
|
|
|
|
2008-04-15 18:47:20 +02:00
|
|
|
/***************************************************************************/
|
|
|
|
/***************************************************************************/
|
|
|
|
/***************************************************************************/
|
2010-09-16 23:36:44 +02:00
|
|
|
|
2008-04-15 18:47:20 +02:00
|
|
|
+#if 0
|
|
|
|
static void showhelp ()
|
|
|
|
{
|
|
|
|
fprintf (stderr,"USAGE: tint [-h] [-l level] [-n]\n");
|
2010-09-16 23:36:44 +02:00
|
|
|
@@ -504,9 +516,11 @@ static void showhelp ()
|
2008-04-15 18:47:20 +02:00
|
|
|
fprintf (stderr," -d Draw vertical dotted lines\n");
|
|
|
|
exit (EXIT_FAILURE);
|
|
|
|
}
|
|
|
|
+#endif
|
2010-09-16 23:36:44 +02:00
|
|
|
|
2008-04-15 18:47:20 +02:00
|
|
|
static void parse_options (int argc,char *argv[])
|
|
|
|
{
|
|
|
|
+#if 0
|
|
|
|
int i = 1;
|
|
|
|
while (i < argc)
|
|
|
|
{
|
2010-09-16 23:36:44 +02:00
|
|
|
@@ -536,10 +550,12 @@ static void parse_options (int argc,char
|
2008-04-15 18:47:20 +02:00
|
|
|
}
|
|
|
|
i++;
|
|
|
|
}
|
|
|
|
+#endif
|
|
|
|
}
|
2010-09-16 23:36:44 +02:00
|
|
|
|
2008-04-15 18:47:20 +02:00
|
|
|
static void choose_level ()
|
|
|
|
{
|
|
|
|
+#if 0
|
|
|
|
char buf[NAMELEN];
|
2010-09-16 23:36:44 +02:00
|
|
|
|
2008-04-15 18:47:20 +02:00
|
|
|
do
|
2010-09-16 23:36:44 +02:00
|
|
|
@@ -549,6 +565,8 @@ static void choose_level ()
|
2008-04-15 18:47:20 +02:00
|
|
|
buf[strlen (buf) - 1] = '\0';
|
|
|
|
}
|
|
|
|
while (!str2int (&level,buf) || level < MINLEVEL || level > MAXLEVEL);
|
|
|
|
+#endif
|
|
|
|
+ level = 1;
|
|
|
|
}
|
2010-09-16 23:36:44 +02:00
|
|
|
|
2008-04-15 18:47:20 +02:00
|
|
|
/***************************************************************************/
|
2010-09-16 23:36:44 +02:00
|
|
|
@@ -663,8 +681,15 @@ int main (int argc,char *argv[])
|
2008-04-15 18:47:20 +02:00
|
|
|
if (ch != 'q')
|
|
|
|
{
|
|
|
|
showplayerstats (&engine);
|
|
|
|
+#if 0
|
|
|
|
savescores (GETSCORE (engine.score));
|
|
|
|
+#endif
|
|
|
|
}
|
2010-09-16 23:36:44 +02:00
|
|
|
+ printf("Bye.\n");
|
2008-04-15 18:47:20 +02:00
|
|
|
+ refresh();
|
2010-09-16 23:36:44 +02:00
|
|
|
+ for(;;); //halt();
|
2008-04-15 18:47:20 +02:00
|
|
|
+#if 0
|
|
|
|
exit (EXIT_SUCCESS);
|
|
|
|
+#endif
|
|
|
|
}
|
2010-09-16 23:36:44 +02:00
|
|
|
|
|
|
|
diff -rupN tintorig/utils.c tint/utils.c
|
|
|
|
--- tintorig/utils.c 2001-12-07 08:49:19.000000000 -0700
|
|
|
|
+++ tint/utils.c 2010-01-27 13:59:18.000000000 -0700
|
2008-04-15 18:47:20 +02:00
|
|
|
@@ -27,9 +27,13 @@
|
|
|
|
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
|
|
*/
|
2010-09-16 23:36:44 +02:00
|
|
|
|
2008-04-15 18:47:20 +02:00
|
|
|
+#include "config.h"
|
|
|
|
+
|
|
|
|
+#if 0
|
|
|
|
#include <stdlib.h>
|
|
|
|
#include <time.h>
|
|
|
|
#include <limits.h>
|
|
|
|
+#endif
|
2010-09-16 23:36:44 +02:00
|
|
|
|
2008-04-15 18:47:20 +02:00
|
|
|
#include "typedefs.h"
|
2010-09-16 23:36:44 +02:00
|
|
|
|
|
|
|
@@ -41,8 +45,11 @@ void rand_init ()
|
2008-04-15 18:47:20 +02:00
|
|
|
#ifdef USE_RAND
|
|
|
|
srand (time (NULL));
|
|
|
|
#else
|
|
|
|
+#if 0
|
|
|
|
srandom (time (NULL));
|
|
|
|
#endif
|
|
|
|
+ srandom (123);
|
|
|
|
+#endif
|
|
|
|
}
|
2010-09-16 23:36:44 +02:00
|
|
|
|
2008-04-15 18:47:20 +02:00
|
|
|
/*
|
2010-09-16 23:36:44 +02:00
|
|
|
@@ -61,6 +68,7 @@ int rand_value (int range)
|
2008-04-15 18:47:20 +02:00
|
|
|
* Convert an str to long. Returns TRUE if successful,
|
|
|
|
* FALSE otherwise.
|
|
|
|
*/
|
|
|
|
+#if 0
|
|
|
|
bool str2int (int *i,const char *str)
|
|
|
|
{
|
|
|
|
char *endptr;
|
2010-09-16 23:36:44 +02:00
|
|
|
@@ -69,3 +77,4 @@ bool str2int (int *i,const char *str)
|
2008-04-15 18:47:20 +02:00
|
|
|
return TRUE;
|
|
|
|
}
|
2010-09-16 23:36:44 +02:00
|
|
|
|
2008-04-15 18:47:20 +02:00
|
|
|
+#endif
|
2010-09-16 23:36:44 +02:00
|
|
|
diff -rupN tintorig/xcompile.sh tint/xcompile.sh
|
|
|
|
--- tintorig/xcompile.sh 1969-12-31 17:00:00.000000000 -0700
|
|
|
|
+++ tint/xcompile.sh 2010-03-10 15:34:51.421875000 -0700
|
|
|
|
@@ -0,0 +1,76 @@
|
|
|
|
+#!/bin/bash
|
|
|
|
+
|
|
|
|
+CONFIG=defconfig
|
|
|
|
+SCRIPT_DIR=`dirname "$0"`
|
|
|
|
+
|
|
|
|
+for make in make gmake gnumake; do
|
|
|
|
+ if [ "`$make --version 2>/dev/null | grep -c GNU`" -gt 0 ]; then
|
|
|
|
+ MAKE=$make
|
|
|
|
+ break
|
|
|
|
+ fi
|
|
|
|
+done
|
|
|
|
+
|
|
|
|
+GCCPREFIX=invalid
|
|
|
|
+for gccprefixes in `pwd`/$SCRIPT_DIR/../../util/crossgcc/xgcc/bin/i386-elf- i386-elf- ""; do
|
|
|
|
+ TMP=`mktemp /tmp/temp.XXXX`
|
|
|
|
+ echo "mov %eax, %eax" > ${TMP}.s
|
|
|
|
+ printf "\x7fELF" > ${TMP}.compare
|
|
|
|
+ if which ${gccprefixes}as 2>/dev/null >/dev/null; then
|
|
|
|
+ printf ""
|
|
|
|
+ else
|
|
|
|
+ continue
|
|
|
|
+ fi
|
|
|
|
+ if ${gccprefixes}as --32 -o ${TMP}.o ${TMP}.s; then
|
|
|
|
+ dd bs=4 count=1 if=${TMP}.o > ${TMP}.test 2>/dev/null
|
|
|
|
+ if cmp ${TMP}.test ${TMP}.compare; then
|
|
|
|
+ GCCPREFIX=$gccprefixes
|
|
|
|
+ rm -f $TMP ${TMP}.s ${TMP}.o ${TMP}.compare ${TMP}.test
|
|
|
|
+ break
|
|
|
|
+ fi
|
|
|
|
+ fi
|
|
|
|
+ rm -f $TMP ${TMP}.s ${TMP}.o ${TMP}.compare ${TMP}.test
|
|
|
|
+done
|
|
|
|
+
|
|
|
|
+if [ "$GCCPREFIX" = "invalid" ]; then
|
|
|
|
+ echo no suitable gcc found
|
|
|
|
+ exit 1
|
|
|
|
+fi
|
|
|
|
+
|
|
|
|
+#MAKEFLAGS=" \
|
|
|
|
+# AS=\"${GCCPREFIX}as --32\" \
|
|
|
|
+# CC=\"${GCCPREFIX}gcc -m32\" \
|
|
|
|
+# AR=\"${GCCPREFIX}ar\" \
|
|
|
|
+# LD=\"${GCCPREFIX}ld -b elf32-i386\" \
|
|
|
|
+# STRIP=\"${GCCPREFIX}strip\" \
|
|
|
|
+# NM=\"${GCCPREFIX}nm\" \
|
|
|
|
+# HOSTCC=gcc \
|
|
|
|
+# -j \
|
|
|
|
+#"
|
|
|
|
+
|
|
|
|
+cat << afteroptions
|
|
|
|
+export AS:=${GCCPREFIX}as --32
|
|
|
|
+export CC:=${GCCPREFIX}gcc -m32
|
|
|
|
+export CPP:=${GCCPREFIX}cpp
|
|
|
|
+export AR:=${GCCPREFIX}ar
|
|
|
|
+export LD:=${GCCPREFIX}ld -b elf32-i386
|
|
|
|
+export STRIP:=${GCCPREFIX}strip
|
|
|
|
+export NM:=${GCCPREFIX}nm
|
|
|
|
+export OBJCOPY:=${GCCPREFIX}objcopy
|
|
|
|
+export OBJDUMP:=${GCCPREFIX}objdump
|
|
|
|
+export HOSTCC:=gcc
|
|
|
|
+afteroptions
|
|
|
|
+
|
|
|
|
+# Should we let the payload build libpayload or do it for them?
|
|
|
|
+#test -d ./build || (
|
|
|
|
+# BUILDDIR=$PWD
|
|
|
|
+# cd ../libpayload
|
|
|
|
+# $MAKE distclean
|
|
|
|
+# cp configs/$CONFIG .config
|
|
|
|
+# $MAKE oldconfig
|
|
|
|
+# eval $MAKE $MAKEFLAGS
|
|
|
|
+# eval $MAKE $MAKEFLAGS DESTDIR=$BUILDDIR/build install
|
|
|
|
+# cd ..
|
|
|
|
+#)
|
|
|
|
+
|
|
|
|
+# eval $MAKE -C $SCRIPT_DIR $MAKEFLAGS
|
|
|
|
+
|