#
# bit_ntp,v 1.3 2002/10/14 12:46:33 joel Exp
#
BASE=`pwd`
prefix=/opt/rtems

if test X${RTEMS_MAKEFILE_PATH} = X ; then
  echo RTEMS_MAKEFILE_PATH is not set
  exit 1
fi

export CC=` make --no-print-directory -f ${BASE}/Makefile.rtems-sub print_cc`
export AR=` make --no-print-directory -f ${BASE}/Makefile.rtems-sub print_ar`
export RANLIB=` make --no-print-directory -f ${BASE}/Makefile.rtems-sub print_ranlib`
target=` make --no-print-directory -f ${BASE}/Makefile.rtems-sub print_target`

# Only when linking a final executable during testing.  This requires
# hacking configure.in to NOT use -r and -nostdlibs as LDFLAGS.  If using
# an RTEMS version with adjtime, you can delete the adjtime.c reference.
# export LDFLAGS=${BASE}/dummynetcfg.o ${BASE}/adjtime.c
# ${CC} -c ${BASE}/dummynetcfg.c -o ${BASE}/dummynetcfg.o
# ${CC} -c ${BASE}/adjtime.c -o ${BASE}/adjtime.o

rm -rf b-ntp
mkdir b-ntp
cd b-ntp
../ntp-4.1.1a/configure --prefix=${prefix} --target=${target} \
  --host=i686-pc-linux-gnu --disable-dependency-checking  --disable-all-clocks \
  --disable-des --disable-debugging --disable-md5

test $? -eq 0 && make

test $? -eq 0 && make install

test $? -eq 0 && rm -f ${prefix}/bin/${target}-ntp-wait

exit $?
