blob: 9aac4c35fd557c9c2752a4e82a75c46707d924d4 [file] [log] [blame]
gdta3214b72005-12-29 15:40:49 +00001#!/bin/sh
2
Greg Troxelb65c6392010-03-10 14:03:54 -05003# $QuaggaId: Format:%an, %ai, %h$ $
gdta3214b72005-12-29 15:40:49 +00004
5# This file is helpful for building quagga from cvs on NetBSD, and
6# probably on any system using pkgsrc.
7# One should have readline installed already (pkgsrc/devel/readline).
8
Greg Troxel85c49682010-04-20 12:44:21 -04009MAKE=make
Greg Troxel14838192007-08-02 13:38:38 +000010# Quagga is currently documented not to require GNU make, but sometimes
11# BSD make fails. Enable this if statement as a workaround.
12if false; then
Greg Troxel37ccd142007-08-02 13:23:57 +000013 MAKE=gmake
Greg Troxel14838192007-08-02 13:38:38 +000014 echo "WARNING: using gmake to work around nonportable makefiles"
Greg Troxel37ccd142007-08-02 13:23:57 +000015fi
16
Greg Troxel85c49682010-04-20 12:44:21 -040017# Use /usr/quagga to be independent, and /usr/pkg to overwrite pkgsrc.
18PREFIX=/usr/pkg
19
gdta3214b72005-12-29 15:40:49 +000020case $1 in
21
22 build)
Greg Troxel409d8e42007-02-02 17:03:03 +000023 ./bootstrap.sh
gdta3214b72005-12-29 15:40:49 +000024 LDFLAGS="-L/usr/pkg/lib -R/usr/pkg/lib" CPPFLAGS="-I/usr/pkg/include" \
Greg Troxel85c49682010-04-20 12:44:21 -040025 ./configure --prefix=${PREFIX} \
gdta3214b72005-12-29 15:40:49 +000026 --sysconfdir=/etc/zebra --localstatedir=/var/run/zebra \
Greg Troxel85c49682010-04-20 12:44:21 -040027 --enable-exampledir=${PREFIX}/share/examples/zebra \
28 --enable-pkgsrcrcdir=${PREFIX}/etc/rc.d \
gdta3214b72005-12-29 15:40:49 +000029 --enable-opaque-lsa --enable-vtysh
Greg Troxel85c49682010-04-20 12:44:21 -040030 ${MAKE}
gdta3214b72005-12-29 15:40:49 +000031 ;;
32
33 install)
Greg Troxel85c49682010-04-20 12:44:21 -040034 ${MAKE} install
gdta3214b72005-12-29 15:40:49 +000035 ;;
36
37 clean)
Greg Troxel85c49682010-04-20 12:44:21 -040038 ${MAKE} clean
Greg Troxel14838192007-08-02 13:38:38 +000039 ;;
40
41 *)
Greg Troxel85c49682010-04-20 12:44:21 -040042 echo "Usage: README.NetBSD (build|install|clean)"
Greg Troxel14838192007-08-02 13:38:38 +000043 exit 1
44 ;;
gdta3214b72005-12-29 15:40:49 +000045
46esac