amiga-ntimed/configure

267 lines
4.9 KiB
Plaintext
Raw Normal View History

2015-07-26 08:45:18 +00:00
2014-12-21 22:31:18 +00:00
#!/bin/sh
#
2015-03-17 09:02:28 +00:00
# Copyright (c) 2015 Carsten Larsen
2014-12-21 22:31:18 +00:00
# Copyright (c) 2014 Poul-Henning Kamp
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# 2. Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
#
# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
# ARE DISCLAIMED. IN NO EVENT SHALL AUTHOR OR CONTRIBUTORS BE LIABLE
# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
# LIABILITY, 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.
2015-03-18 19:32:00 +00:00
#
2014-12-21 22:31:18 +00:00
set -e
HDRS='
2015-03-17 09:02:28 +00:00
compiler.h
2015-03-19 11:40:19 +00:00
mem.h
2014-12-21 22:31:18 +00:00
ntimed.h
ntimed_endian.h
2015-03-17 09:02:28 +00:00
ntimed_platform.h
2014-12-21 22:31:18 +00:00
ntimed_queue.h
ntimed_tricks.h
ntp.h
ntp_tbl.h
2015-03-19 11:40:19 +00:00
net_getaddrinfo.h
2014-12-21 22:31:18 +00:00
param_instance.h
param_tbl.h
udp.h
2015-03-11 21:10:43 +00:00
'
2014-12-21 22:31:18 +00:00
SRCS='
2015-03-18 15:21:16 +00:00
main_amiga_client.c
main_amiga_poll.c
2015-03-18 19:32:00 +00:00
main_amiga_sim.c
2015-03-19 13:41:38 +00:00
main_amiga_test.c
2015-03-18 15:21:16 +00:00
combine_delta.c
2015-03-19 11:40:19 +00:00
mem.c
net_getaddrinfo.c
2015-03-18 15:21:16 +00:00
ntp_filter.c
ntp_packet.c
ntp_peer.c
ntp_peerset.c
ntp_tools.c
ocx_stdio.c
param.c
pll_std.c
suckaddr.c
time_amiga.c
time_sim.c
time_stuff.c
2015-04-18 20:08:39 +00:00
time_unix.c
2015-03-18 15:21:16 +00:00
todo.c
udp.c
'
2015-03-18 19:32:00 +00:00
#################################################
2015-04-18 20:08:39 +00:00
2015-03-18 15:21:16 +00:00
SRCS1='
main_amiga_client.c
combine_delta.c
2015-03-19 11:40:19 +00:00
mem.c
net_getaddrinfo.c
2015-03-18 15:21:16 +00:00
ntp_filter.c
ntp_packet.c
ntp_peer.c
ntp_peerset.c
ntp_tools.c
ocx_stdio.c
param.c
pll_std.c
suckaddr.c
time_amiga.c
time_stuff.c
2015-04-18 20:08:39 +00:00
time_unix.c
2015-03-18 15:21:16 +00:00
todo.c
udp.c
'
SRCS2='
main_amiga_poll.c
2014-12-21 22:31:18 +00:00
combine_delta.c
2015-03-19 11:40:19 +00:00
mem.c
net_getaddrinfo.c
2014-12-21 22:31:18 +00:00
ntp_filter.c
ntp_packet.c
ntp_peer.c
ntp_peerset.c
ntp_tools.c
ocx_stdio.c
param.c
pll_std.c
suckaddr.c
2015-03-07 22:29:12 +00:00
time_amiga.c
2014-12-21 22:31:18 +00:00
time_stuff.c
2015-04-18 20:08:39 +00:00
time_unix.c
2014-12-21 22:31:18 +00:00
todo.c
udp.c
'
2015-03-18 19:32:00 +00:00
SRCS3='
main_amiga_sim.c
combine_delta.c
2015-03-19 11:40:19 +00:00
mem.c
net_getaddrinfo.c
2015-03-18 19:32:00 +00:00
ntp_filter.c
ntp_packet.c
ntp_peer.c
ntp_peerset.c
ntp_tools.c
ocx_stdio.c
param.c
pll_std.c
suckaddr.c
2015-04-18 20:08:39 +00:00
time_amiga.c
2015-03-18 19:32:00 +00:00
time_sim.c
time_stuff.c
todo.c
udp.c
'
2015-03-19 13:41:38 +00:00
SRCS4='
main_amiga_test.c
combine_delta.c
mem.c
net_getaddrinfo.c
ntp_filter.c
ntp_packet.c
ntp_peer.c
ntp_peerset.c
ntp_tools.c
ocx_stdio.c
param.c
pll_std.c
suckaddr.c
time_amiga.c
time_stuff.c
2015-04-18 20:08:39 +00:00
time_unix.c
2015-03-19 13:41:38 +00:00
todo.c
udp.c
'
2015-03-18 19:32:00 +00:00
#################################################
if make -v 2>&1 | grep GNU > /dev/null 2>&1 ; then
2015-03-18 19:32:00 +00:00
echo "make is GNU make."
2015-03-18 15:21:16 +00:00
VALID=true
2015-04-18 20:08:39 +00:00
#else
# echo "Wrong version of make."
# VALID=false
fi
2015-03-18 15:21:16 +00:00
if $VALID ; then
2014-12-21 22:31:18 +00:00
(
echo '# Portable Makefile generated by configure'
echo ''
2015-03-19 13:41:38 +00:00
echo 'all: ntimed ntimed-poll ntimed-sim ntimed-test'
2014-12-21 22:31:18 +00:00
echo ''
2015-03-11 21:10:43 +00:00
if [ -n "$1" ] && [ $1 = "AMIGA" ] ; then
2015-07-10 21:00:05 +00:00
echo 'CC = m68k-amigaos-gcc'
2015-07-25 21:11:11 +00:00
echo "CFLAGS = -O2 -noixemul -DAOS3 -DWITHTEST -I. -Iinclude -Wall -Werror"
echo "LDLIBS = -lm"
2015-03-11 21:10:43 +00:00
elif [ -n "$1" ] && [ $1 = "AROS" ] ; then
2015-04-18 20:08:39 +00:00
echo 'CC = gcc'
2015-07-26 08:45:18 +00:00
echo "CFLAGS = -O2 -DAROS -DWITHTEST -I. -Iinclude -Wall -Werror"
2015-07-13 16:53:05 +00:00
echo "LDLIBS = -lm"
2015-03-11 21:10:43 +00:00
else
2015-04-18 20:08:39 +00:00
echo "CFLAGS = -O2 -Wall -DWITHTEST -Werror"
echo "LDLIBS = -lm"
2015-03-11 21:10:43 +00:00
fi
2014-12-21 22:31:18 +00:00
echo ''
for f in ${HDRS}
do
b=`basename $f .h`
i=`sed -n -e '/#include.*"/{
s/"$//
s/.*"//
p
}' $f | sort -u`
if [ "x${i}" != "x" ] ; then
echo "${b}.h: " ${i}
echo " touch ${b}.h"
echo
fi
done
2015-04-18 20:08:39 +00:00
2014-12-21 22:31:18 +00:00
l=""
for f in ${SRCS}
do
b=`basename $f .c`
i=`sed -n -e '/#include.*"/{
s/"$//
s/.*"//
p
}' $f | sort -u`
echo "${b}.o: ${b}.c" ${i}
echo
l="${l} ${b}.o"
done
2015-03-18 19:32:00 +00:00
#################################################
2015-03-18 15:21:16 +00:00
BIN1=""
for f in ${SRCS1}
do
BIN1="${BIN1} `basename $f .c`.o"
done
2015-03-19 13:41:38 +00:00
2015-03-18 15:21:16 +00:00
BIN2=""
for f in ${SRCS2}
do
BIN2="${BIN2} `basename $f .c`.o"
done
2015-03-19 13:41:38 +00:00
2015-03-18 19:32:00 +00:00
BIN3=""
for f in ${SRCS3}
do
BIN3="${BIN3} `basename $f .c`.o"
done
2015-03-19 13:41:38 +00:00
BIN4=""
for f in ${SRCS4}
do
BIN4="${BIN4} `basename $f .c`.o"
done
2015-03-18 19:32:00 +00:00
#################################################
2015-03-18 15:21:16 +00:00
echo
echo "ntimed: ${BIN1}"
2015-04-18 20:08:39 +00:00
echo " \${CC} \${CFLAGS} -o ntimed ${BIN1} \${LDLIBS}"
2015-03-18 15:21:16 +00:00
echo
echo "ntimed-poll: ${BIN2}"
2015-04-18 20:08:39 +00:00
echo " \${CC} \${CFLAGS} -o ntimed-poll ${BIN2} \${LDLIBS}"
2014-12-21 22:31:18 +00:00
echo
2015-03-18 19:32:00 +00:00
echo "ntimed-sim: ${BIN3}"
2015-04-18 20:08:39 +00:00
echo " \${CC} \${CFLAGS} -o ntimed-sim ${BIN3} \${LDLIBS}"
2015-03-18 19:32:00 +00:00
echo
2015-03-19 13:41:38 +00:00
echo "ntimed-test: ${BIN4}"
2015-04-18 20:08:39 +00:00
echo " \${CC} \${CFLAGS} -o ntimed-test ${BIN4} \${LDLIBS}"
2015-03-19 13:41:38 +00:00
echo
2014-12-21 22:31:18 +00:00
echo "clean:"
2015-03-19 13:41:38 +00:00
echo " rm -f ${l} ntimed ntimed-poll ntimed-sim ntimed-test"
2014-12-21 22:31:18 +00:00
echo
echo "depend:"
echo " @echo Dependencies already done"
) > Makefile
2015-03-19 11:40:19 +00:00
echo "Makefile generated"
2014-12-21 22:31:18 +00:00
fi