blob: 6bbc680b95e9d80d831d7f531bffd95f5a73cdba [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 Troxelfe0a1a42011-06-28 15:05:05 -040023 # Omitted because it is now default:
24 # --enable-opaque-lsa
Greg Troxel409d8e42007-02-02 17:03:03 +000025 ./bootstrap.sh
gdta3214b72005-12-29 15:40:49 +000026 LDFLAGS="-L/usr/pkg/lib -R/usr/pkg/lib" CPPFLAGS="-I/usr/pkg/include" \
Greg Troxel85c49682010-04-20 12:44:21 -040027 ./configure --prefix=${PREFIX} \
gdta3214b72005-12-29 15:40:49 +000028 --sysconfdir=/etc/zebra --localstatedir=/var/run/zebra \
Greg Troxel85c49682010-04-20 12:44:21 -040029 --enable-exampledir=${PREFIX}/share/examples/zebra \
30 --enable-pkgsrcrcdir=${PREFIX}/etc/rc.d \
Greg Troxelfe0a1a42011-06-28 15:05:05 -040031 --enable-vtysh
Greg Troxel85c49682010-04-20 12:44:21 -040032 ${MAKE}
gdta3214b72005-12-29 15:40:49 +000033 ;;
34
35 install)
Greg Troxel85c49682010-04-20 12:44:21 -040036 ${MAKE} install
gdta3214b72005-12-29 15:40:49 +000037 ;;
38
39 clean)
Greg Troxel85c49682010-04-20 12:44:21 -040040 ${MAKE} clean
Greg Troxel14838192007-08-02 13:38:38 +000041 ;;
42
43 *)
Greg Troxel85c49682010-04-20 12:44:21 -040044 echo "Usage: README.NetBSD (build|install|clean)"
Greg Troxel14838192007-08-02 13:38:38 +000045 exit 1
46 ;;
gdta3214b72005-12-29 15:40:49 +000047
48esac