#******************************************************************************
#
#       Copyright:      2005-2010 Paul Obermeier (obermeier@tcl3d.org)
#
#                       See the file "Tcl3D_License.txt" for information on
#                       usage and redistribution of this file, and for a
#                       DISCLAIMER OF ALL WARRANTIES.
#
#       Module:         Tcl3D
#       Filename:       config_Linux
#
#       Author:         Paul Obermeier
#
#       Description:    Configuration file for Linux based systems using
#                       the GNU C++ compiler gcc.
#                       This file is included from the global Makefile.
#                       The syntax is based on GNU make.
#
#******************************************************************************

# Set the following variable to 1, if compiling with stubs.
WITH_STUBS = 1

# Set the following variable to 1, if compiling with debugging information.
# WITH_DEBUG = 1

INSTDIR = /usr/local
TCLDIR  = /usr
TKDIR   = /usr

TCLMAJOR     = 8
TCLMINOR     = 5

INSTBIN  = $(INSTDIR)/bin
INSTLIB  = $(INSTDIR)/lib
INSTINC  = $(INSTDIR)/include

# Do not print out unused variables or functions, as this occurs very often
# in the auto-generated SWIG code.
WARNINGS = -Wall -Wno-unused-variable -Wno-unused-function

ifdef WITH_DEBUG
OPT = -g  -mieee-fp -ffloat-store $(WARNINGS) -fPIC
DEBUG_SUFFIX=d
else
OPT = -O2 -mieee-fp -ffloat-store $(WARNINGS) -fPIC -Wuninitialized -DNDEBUG
DEBUG_SUFFIX=
endif

PPSTUBS   = -DUSE_TCL_STUBS -DUSE_TK_STUBS
PPNOSTUBS = -D$(KERNEL) -D$(OS_TYPE)

CC           = gcc -c 
CXX          = g++ -c 
MAKE         = gmake
LD           = gcc -rdynamic 
LDOUT        = -o 
SHLIB_LD     = gcc -shared 
SHLIB_LDXX   = g++ -shared 
SHLIB_CFLAGS = -fPIC

OBJEXT   = .o
LIBEXT   = .a
SHLIBEXT = .so
BINEXT   =
DSEP     = /

GLLIBS = -lGLU -lGL -lXmu

SYSLIBS = -L/usr/X11/lib -lX11 -lXext -lXi -ldl -lm

TCLVERSION   = $(TCLMAJOR).$(TCLMINOR)
TCLINCDIR    = $(TCLDIR)/include
TKINCDIR     = $(TKDIR)/include
TCLLIBDIR    = $(TCLDIR)/lib
TKLIBDIR     = $(TKDIR)/lib
TCLSTUBLIBS  = $(TKLIBDIR)/libtkstub$(TCLVERSION)$(LIBEXT) $(TCLLIBDIR)/libtclstub$(TCLVERSION)$(LIBEXT)
TCLSTDLIBS   = $(TKLIBDIR)/libtk$(TCLVERSION)$(LIBEXT) $(TCLLIBDIR)/libtcl$(TCLVERSION)$(LIBEXT)
TCLSH        = tclsh$(TCLVERSION)

RM           = rm -f
RMDIR        = rm -rf
CP           = cp -p
CPDIR        = csh -f cpdir
MKDIR        = mkdir -p

INCL   = -I. -I$(TCLINCDIR)

ifdef WITH_STUBS
TCLLIBS = $(TCLSTUBLIBS)
PPDEFS  = $(PPNOSTUBS) $(PPSTUBS)
else
TCLLIBS = $(TCLSTDLIBS)
PPDEFS  = $(PPNOSTUBS)
endif
PPDEFS += -DTOGL_X11
PPDEFS += -D__linux__

# Additional debugging options

# Debug tcl3dVector allocation and destruction.
# PPDEFS += -DDEBUG_VECTOR=1
