#define DoNormalLib  NO
#define DoSharedLib  YES
#define DoDebugLib   NO
#define DoProfileLib NO
#define CplusplusSource YES
#ifdef CCsuf
#undef CCsuf
#endif
#define CCsuf cpp
#define IncSubdir   mas

#ifndef HasCplusplus
#error "Must have a C++ compiler.  Check your system's site.def file."
#else  /* the rest of this file  */

#include <Library.tmpl>

XCOMM ################ Architecture dependent ###########################

#ifdef MAS_WE_ARE_BIG_ENDIAN
RTP_ENDIANNESS_STRING = -DRTP_BIG_ENDIAN
#else
RTP_ENDIANNESS_STRING = 
#endif

#if defined(LinuxArchitecture) || defined(FreeBSDArchitecture)
#if HasLibstdcplusplus
ARCHREQUIREDLIBS = -lstdc++
#endif
        ARCHDEFS = -DRTP_SOCKLENTYPE_UINT
        ARCHOBJS = 
        ARCHSRCS = 
#endif

#ifdef SunArchitecture
ARCHREQUIREDLIBS = -R/usr/ucblib:/opt/SUNWspro/lib -L/usr/ucblib -L/opt/SUNWspro/lib  -lucb -lresolv -lelf -lmp -lCrun
        ARCHDEFS = -DRTP_HAVE_SYS_FILIO
        ARCHOBJS = 
        ARCHSRCS = 
#endif

XCOMM ## We use PIC because although we're linking this in static, it
XCOMM ## still has to be position independent 

XCOMM ## CXXOPTIONS = $(CXXPICFLAGS)
XCOMM ## CCOPTIONS = $(PICFLAGS)

XCOMM ################ END Architecture dependent ########################

        INCLUDES = -I./ -I$(BUILDINCDIR)
CXXEXTRA_DEFINES = $(RTP_ENDIANNESS_STRING) $(ARCHDEFS) -DRTP_STREAM_TRANSPORT

            OBJS = rtpconnection.o rtpcontributingsources.o rtpdestlist.o \
                   rtperror.o rtpiptable.o rtppacket.o rtppacketprocessor.o \
                   rtprandom.o rtprtcpmodule.o rtpsession.o rtpsourcedata.o \
                   rtpsourcedescription.o rtpsources.o rtpsrclist.o rtptimeutil.o \
                   rtplocalinfo.o rtphandlers.o rtpdebug.o rtpmcasttable.o \
                   rtp_api.o rtp_transport_stream.o $(ARCHOBJS)
            SRCS = rtpconnection.cpp rtpcontributingsources.cpp rtpdestlist.cpp \
                   rtperror.cpp rtpiptable.cpp rtppacket.cpp rtppacketprocessor.cpp \
                   rtprandom.cpp rtprtcpmodule.cpp rtpsession.cpp rtpsourcedata.cpp \
                   rtpsourcedescription.cpp rtpsources.cpp rtpsrclist.cpp \
                   rtptimeutil.cpp rtplocalinfo.cpp rtphandlers.cpp rtpdebug.cpp \
                   rtpmcasttable.cpp rtp_api.cpp rtp_transport_stream.c $(ARCHSRCS)

 LOCAL_LIBRARIES = 
   SYS_LIBRARIES =
         DEPLIBS =
    REQUIREDLIBS = $(ARCHREQUIREDLIBS) $(EXTRA_LIBRARIES)

         HEADERS = rtp_api.h rtp_transport.h rtp_transport_stream.h rtpconfig.h \
                   rtpconfig_unix.h rtpconnection.h \
                   rtpcontributingsources.h rtpdebug.h rtpdefines.h rtpdestlist.h \
                   rtperror.h rtpexceptionstructs.h rtphandlers.h rtpiptable.h \
                   rtplocalinfo.h rtpmcasttable.h rtppacket.h rtppacketprocessor.h\
                   rtprandom.h rtprtcpmodule.h rtpsession.h rtpsourcedata.h \
                   rtpsourcedescription.h rtpsources.h rtpsrclist.h rtpstructs.h \
                   rtptimeutil.h rtp_pt.h

LibraryObjectRule()

#if DoNormalLib
NormalLibraryTarget(mas_jrtp,$(OBJS))
InstallLibrary(mas_jrtp,$(LIBDIR))
#endif

#if DoDebugLib
DebuggedLibraryTarget(mas_jrtp,$(OBJS))
InstallLibrary(mas_jrtp_d,$(LIBDIR))
#endif

#if DoProfileLib
ProfiledLibraryTarget(mas_jrtp,$(OBJS))
InstallLibrary(mas_jrtp_p,$(LIBDIR))
#endif

#if DoSharedLib && !DoNormalLib
SharedLibraryTarget(mas_jrtp,2.5,$(OBJS),.,.)
InstallSharedLibrary(mas_jrtp,2.5,$(LIBDIR))
#endif

BuildIncludes($(HEADERS),IncSubdir,..)
InstallMultipleFlags($(HEADERS),$(INCDIR)/IncSubdir,$(INSTINCFLAGS))

DependTarget()

#endif /* else HasCplusplus compiler */
