#!/bin/sh
#
# FILE NAME:  bsd/makepros
#
# Script to make a BSD printer driver for an Axis print server using the PROS
# protocol.
#
# (C) Copyright 1993, Axis Communications AB, LUND, SWEDEN.
#
# Version 1.3 Jul 20, 1993 RW
#
# This script compiles the source code 'prosbsd.c' to the BSD printer
# driver (input/output filter), default 'prosbsd'.
#
# Make sure you have assigned your print server a logical name in the file
# 'etc/hosts'.
# 
# 1. Change HOSTNAME to the name of the host you will install the
#    printer on.
#
HOSTNAME=some_host
#
# 2. Change BOXNAME to the name you have assigned your print server in 
#    /etc/hosts.
#    
BOXNAME=some_print_server
#
# 3. Change LOGPR to the logical printer you wish to use on the print server.
#    'pr1' means that print jobs will be sent to the logical printer pr1
#    on the print server. This logical printer is by default associated with
#    the parallel port. Any logical printer 'pr1' to 'pr8' is valid for
#    LOGPR.
#
LOGPR=pr1
#
# 4. If you are going to have more than one printer definition using
#    the PROS protocol, then you have to change OUTPUT_FILTER_NAME to
#    a unique name, _or_ copy the compiled result (default prosbsd)
#    to another file name. Remember also to change BOXNAME and LOGPR above
#    if the definitions refer to different print servers and/or different
#    logical printers.
#
OUTPUT_FILTER_NAME=prosbsd
#
# 5. If you want PROS to expand LF into CRLF comment out the first instead
#    of the second line below:
#
CRLFEXP=
#CRLFEXP=-DCRLFEXP
#
# 6. Setting FEEDBACK_FILE_NAME to a file name, as in the example, will
#    cause data received from the printer on the serial port to be
#    stored in the specified file.
#
FEEDBACK_FILE_NAME=
#FEEDBACK_FILE_NAME=/tmp/pfeedback
#
# -- end of instructions --
#
if test -z "$FEEDBACK_FILE_NAME"
then
  cc -o $OUTPUT_FILTER_NAME -DTRY_FOREVER $CRLFEXP -DHOSTNAME=\"$HOSTNAME\" -DBOXNAME=\"$BOXNAME\" -DPRINTERNAME=\"$LOGPR\" prosbsd.c
else
  cc -o $OUTPUT_FILTER_NAME -DTRY_FOREVER $CRLFEXP -DHOSTNAME=\"$HOSTNAME\" -DBOXNAME=\"$BOXNAME\" -DPRINTERNAME=\"$LOGPR\" -DFEEDBACK=\"$FEEDBACK_FILE_NAME\" prosbsd.c
fi
