 +	if(!ioctl(mpc831x_netPath->eventSock, PTP_SET_CNT, &if_data))
 +	{
 +                //DBG( "mpc831x_set_curr_time board_time = %llu Hex (0x%llx)\n", board_time, board_time );
-+		DBG( "mpc831x_set_curr_time seconds (%d), nanoseconds (%d)\n", \
++		DBG( "mpc831x_set_curr_time %9.9d.%9.9d\n", \
 +			time->seconds, time->nanoseconds );
 +	} 
 +	else

+
+		time->seconds = BOARD_TIME_TO_SEC(board_time);
+		time->nanoseconds = BOARD_TIME_TO_NSEC(board_time, time->seconds);
+		DBG( "mpc831x_get_rx_time seconds (%d), nanoseconds (%d)\n", \
+			time->seconds, time->nanoseconds );
+	} 
+	else

+void mpc831x_adj_addend(Integer32 adj);
+
+#endif //MPC831X_H
+/* eof mpc831x.h */
Index: src/Makefile
===================================================================
--- src/Makefile	(revision 35)
+++ src/Makefile	(working copy)
@@ -4,12 +4,40 @@
 CFLAGS = -Wall
 #CPPFLAGS = -DPTPD_DBG -DPTPD_NO_DAEMON
 
+# In case this is an MPC831X system, define CONFIG_MPC831X
+CONFIG_MPC831X=1
+
 PROG = ptpd
 OBJ  = ptpd.o arith.o bmc.o probe.o protocol.o \
 	dep/msg.o dep/net.o dep/servo.o dep/startup.o dep/sys.o dep/timer.o
 HDR  = ptpd.h constants.h datatypes.h \
 	dep/ptpd_dep.h dep/constants_dep.h dep/datatypes_dep.h
 
+ifeq ($(CONFIG_MPC831X), 1)
+#
+# for full  debug messages define -DPTPD_DBGV below
+# for basic debug messages define -DPTPD_DBG  below
+# for no    debug messages remove the debug define
+#
+# -DCONFIG_MPC831X is defined to use MPC831X timestamping, 
+# otherwise system timer is used
+#
+CFLAGS = -Wall -DPTPD_DBGV -DCONFIG_MPC831X
+LDFLAGS = -static
+OBJ += mpc831x.o
+HDR += mpc831x.h
+#
+# Makefile from original patch for ptpd version 1b5 used CC 
+# as a specific gcc filename spec of powerpc-e300c3-linux-gcc.  
+# This does not work# with the LTIB environment, 
+# where you just use gcc (LTIB maps gcc to the right type and
+# version of the compiler for the target.
+#
+# original patch from Freescale was:      CC=powerpc-e300c3-linux-gcc
+# changed to work in an LTIB environment: CC=gcc
+#
+CC=gcc
+endif
 
 .c.o:
 	$(CC) -c $(CFLAGS) $(CPPFLAGS) -o $@ $<
