#!/bin/bash

#
# Build an OpenVPN plugin module on *nix.  The argument should
# be the base name of the C source file (without the .c).
#

# This directory is where we will look for openvpn-plugin.h
TOP="../.."

CFLAGS="-O2"
LFLAGS=""

gcc $CFLAGS -fPIC -c -Wall -I$TOP $1.c && \
gcc $LFLAGS -shared -Wl,-soname,$1.so.1 -o $1.so.1.0.1 $1.o -lc
