--- ref-0.78/sigd/atmsigd.c +++ atm-0.78-cross/sigd/atmsigd.c Mon Feb 26 19:39:34 2001 @@ -9,7 +9,7 @@ #include #include #include -#include +#include #include #include "atm.h" --- ref-0.78/qgen/Makefile +++ atm-0.78-cross/qgen/Makefile Mon Feb 26 19:40:04 2001 @@ -1,8 +1,15 @@ LIBS=-lfl # lex may want -ll here OBJS=common.o file.o first.o lex.yy.o qgen.o second.o third.o y.tab.o +ifeq ($(CC),$(HOSTCC)) +HOSTOBJS=$(OBJS) +HOSTQGEN=qgen +else +HOSTOBJS=$(OBJS:.o=.host.o) +HOSTQGEN=qgen.host +endif TRASH=q.out.h q.out.c q.test.c qd.out.h qd.out.c qd.test.c qd.dump.c default.nl # q40.out.h q40.out.c q40.test.c -PGMS=qgen q.out.o qd.dump.o q.dump #qtest +PGMS=qgen $(HOSTQGEN) q.out.o qd.dump.o q.dump #qtest # q40.out.o NLS=atm_ai_msg atm_ai_ie atm_loc atm_cv atm_pu atm_na atm_cond atm_ie atm_msg \ atm_np atm_ton atm_sat atm_prs atm_scrn atm_vpa atm_poe q2931_cs atm_td \ @@ -15,11 +22,17 @@ NOLIBATMDEP=yes include ../Rules.make +%.host.o: %.c + $(HOSTCC) $(HOSTCFLAGS) $(HOSTLDFLAGS) -c -o $@ $< + qgen: $(OBJS) $(CC) $(LDFLAGS) -o qgen $(OBJS) $(LIBS) -q.out.h q.out.c q.test.c: qgen msg.fmt default.nl - $(CC) $(STANDARDS) -E - /dev/null) +ifeq ($(LIBRESOLV),) ATM_OBJS += ans.o +else +ATM_OBJS += ans_l.o endif ATMD_OBJS=common.o diag.o kptr.o text2ip.o timer.o unix.o PGMS=#test @@ -18,12 +21,13 @@ ../lib/libatm.a: libatm.a libatm.a: $(ATM_OBJS) - ar rcs libatm.a $(ATM_OBJS) + $(AR) rcs libatm.a $(ATM_OBJS) ../lib/libatmd.a: libatmd.a libatmd.a: $(ATMD_OBJS) - ar rcs libatmd.a $(ATMD_OBJS) + $(AR) rcs libatmd.a $(ATMD_OBJS) ans_l.o: ans.o - ld -r -o ans_l.o ans.o -L/usr/lib -lresolv + $(LD) -r -o ans_l.o ans.o $(LIBRESOLV) +# $(LD) -r -o ans_l.o ans.o -L$(shell dirname $(LIBRESOLV)) -l$(RESOLV) --- ref-0.78/lib/stdint.h +++ /dev/null Tue May 5 22:32:27 1998 @@ -1,31 +0,0 @@ -/* stdint.h - provides uintXX_t until glibc does */ - -#ifndef _STDINT_H - -#include - -#if __GLIBC__ >= 2 && __GLIBC_MINOR__ >= 1 - -#include "/usr/include/stdint.h" - -#elif __GLIBC__ >= 2 - -/* Works for i386 and Alpha */ - -typedef unsigned char uint8_t; -typedef unsigned short uint16_t; -typedef unsigned int uint32_t; - -#else - -#ifndef _LINUX_TYPES_H -#include -#endif - -#endif - -#ifndef _STDINT_H -#define _STDINT_H -#endif - -#endif --- ref-0.78/Rules.make +++ atm-0.78-cross/Rules.make Mon Feb 26 19:39:34 2001 @@ -47,9 +47,24 @@ TOPDIR=.. endif -CC=cc -CFLAGS_NOWARN=-g -DVERSION=\"`cat $(TOPDIR)/VERSION`\" \ +HOSTCC=gcc +HOSTCFLAGS=-Wall -O2 -Wstrict-prototypes +HOSTLDFLAGS= + +CROSS_COMPILE= +CROSS_INCLUDE= +CROSS_LIB= + +CC=$(CROSS_COMPILE)gcc +LD=$(CROSS_COMPILE)ld +AR=$(CROSS_COMPILE)ar + +VERSION=\"$(shell cat $(TOPDIR)/VERSION)\" +CFLAGS_NOWARN=-g -DVERSION=$(VERSION) \ $(INCLUDES) -I$(TOPDIR)/lib +ifneq ($(CROSS_INCLUDE),) +CFLAGS_NOWARN+=-I$(CROSS_INCLUDE) +endif CFLAGS_NOOPT=$(CFLAGS_NOWARN) -Wall -Wshadow -Wpointer-arith \ -Wwrite-strings -Wstrict-prototypes # -Wcast-align (clashes with socketbits.h of glibc 2 on Alphas) @@ -61,6 +76,9 @@ CFLAGS_LEX=$(CFLAGS_NOWARN) $(CFLAGS_OPT) CFLAGS_YACC=$(CFLAGS_NOWARN) $(CFLAGS_OPT) -DYY_USE_CONST LDFLAGS= +ifneq ($(CROSS_LIB),) +LDFLAGS+=-L$(CROSS_LIB) -s --static +endif LDLIBS += -L$(TOPDIR)/lib -latm LIBDEPS += $(TOPDIR)/lib/libatm.a YACC=bison -y -d #-v @@ -88,6 +106,9 @@ process 0644 $(INSTMAN4) $(MAN4); \ process 0644 $(INSTMAN7) $(MAN7); \ process 0644 $(INSTMAN8) $(MAN8) + +export CROSS_COMPILE HOSTCC HOSTCCFLAGS +export CC LD AR # # Enable memory debugging if MPR is installed