#
# unix/Common.mk.in  --
#
# Common macro definitions used by all include files.
#------------------------------------------------------------------------------
# Copyright 1995-1999 Karl Lehenbauer and Mark Diekhans.
#
# Permission to use, copy, modify, and distribute this software and its
# documentation for any purpose and without fee is hereby granted, provided
# that the above copyright notice appear in all copies.  Karl Lehenbauer and
# Mark Diekhans make no representations about the suitability of this
# software for any purpose.  It is provided "as is" without express or
# implied warranty.
#------------------------------------------------------------------------------
# $Id: Common.mk.in,v 8.14 2000/06/14 07:48:25 markd Exp $
#------------------------------------------------------------------------------
#

SHELL = /bin/sh

#------------------------------------------------------------------------------
# Tcl and Tk versions
#
TCL_VERSION      = @TCL_VERSION@
TK_VERSION       = @TK_VERSION@

#------------------------------------------------------------------------------
# TclX version information extracted from tclExtend.h.
#
TCLX_VERSION       = @TCLX_VERSION@
TCLX_FULL_VERSION  = @TCLX_FULL_VERSION@

TKX_VERSION        = @TKX_VERSION@
TKX_FULL_VERSION   = @TKX_FULL_VERSION@

#------------------------------------------------------------------------------
# Programs and options used by build
#
CC           = @CC@
CFLAGS       = @CFLAGS@ @TCL_CFLAGS_WARNING@ @TCL_EXTRA_CFLAGS@
SYSCFLAGS    = @SYSCFLAGS@
RANLIB       = @RANLIB@
AR           = ar
STRIP        = strip
LN_S         = ln -s

# tcl2c is part of the PlusPatches.
TCL2C        = ${TCL_BUILD}/unix/tcl2c

#------------------------------------------------------------------------------
# Extra flags that can be set manually.
#   o XCFLAGS - Extra compiler flags on all compiles and links
#   o XLDFLAGS - Extra compiler flags to specify at link time.
#   o XLDLIBS - Extra libraries to use at link time.

XCFLAGS=
XLDFLAGS=
XLDLIBS=

#------------------------------------------------------------------------------
# The following definition can be set to non-null for special systems
# like AFS with replication.  It allows the pathnames used for installation
# to be different than those used for actually reference files at
# run-time.  INSTALL_ROOT is prepended to $prefix and $exec_prefix
# when installing files.  This is normally passed on the command line.

INSTALL_ROOT =

#------------------------------------------------------------------------------
# Build and install directories.
srcbasedir   = @srcbasedir@
bldbasedir   = @bldbasedir@
prefix       = @prefix@
exec_prefix  = @exec_prefix@

TCLX_PREFIX="${prefix}"
TCLX_EXEC_PREFIX="${exec_prefix}"
TKX_PREFIX="${prefix}"
TKX_EXEC_PREFIX="${exec_prefix}"

#------------------------------------------------------------------------------
# TclX configuration information determined by configure.
#
TKX_BUILD    = @TKX_BUILD@
TCLX_DEFS    = @DEFS@
TCLX_LIBS    = @TCLX_LIBS@

#------------------------------------------------------------------------------
# Library names.
#
TCL_STLIB_NAME  = @TCL_STLIB_NAME@
TK_STLIB_NAME   = @TK_STLIB_NAME@

TCLX_SHLIB_NAME = @TCLX_SHLIB_NAME@
TCLX_STLIB_NAME = @TCLX_STLIB_NAME@
TCLX_LIB_NAME   = @TCLX_LIB_NAME@

TKX_SHLIB_NAME  = @TKX_SHLIB_NAME@
TKX_STLIB_NAME  = @TKX_STLIB_NAME@
TKX_LIB_NAME    = @TKX_LIB_NAME@

#------------------------------------------------------------------------------
# Compiler flag to use when generating shared object files.  Unixware cc will
# only output the name of the .c file, so we hack it.

CC_SHOBJ_FLAG = @CC_SHOBJ_FLAG@

#------------------------------------------------------------------------------
# Linker arguments to pick up TclX libraries.
#
TCLX_BUILD_LIB_SPEC  = @TCLX_BUILD_LIB_SPEC@
TKX_BUILD_LIB_SPEC   = @TKX_BUILD_LIB_SPEC@

#------------------------------------------------------------------------------
# Configuration information from tclConfig.sh.
#
TCL_BIN_DIR          = @TCL_BIN_DIR@
TCL_SRC_DIR          = @TCL_SRC_DIR@
TCL_LIB_DIR          = @TCL_BIN_DIR@
TCL_LIB_FILE         = @TCL_LIB_FILE@
TCL_DEFS             = @TCL_DEFS@
TCL_LIBS             = @TCL_LIBS@
TCL_EXEC_PREFIX      = @TCL_EXEC_PREFIX@
TCL_SHLIB_CFLAGS     = @TCL_SHLIB_CFLAGS@
TCL_LD_FLAGS         = @TCL_LD_FLAGS@
TCL_DL_LIBS          = @TCL_DL_LIBS@
TCL_SHLIB_LD         = @TCL_SHLIB_LD@
TCL_SHLIB_LD_LIBS    = @TCL_SHLIB_LD_LIBS@
TCL_DBGX             = @TCL_DBGX@
TCL_BUILD_LIB_SPEC   = @TCL_BUILD_LIB_SPEC@
TCL_LIB_SPEC         = @TCL_LIB_SPEC@
TCL_BUILD_STUB_LIB_SPEC   = @TCL_BUILD_STUB_LIB_SPEC@
TCL_STUB_LIB_SPEC         = @TCL_STUB_LIB_SPEC@
TCL_LD_SEARCH_FLAGS  = @TCL_LD_SEARCH_FLAGS@

TCL_GENERIC_DIR      = ${TCL_SRC_DIR}/generic
TCL_UNIX_DIR	     = ${TCL_SRC_DIR}/unix

#------------------------------------------------------------------------------
# Configuration information from tkConfig.sh.
#
TK_BIN_DIR           = @TK_BIN_DIR@
TK_SRC_DIR           = @TK_SRC_DIR@
TK_LIB_DIR           = @TK_BIN_DIR@
TK_LIB_FILE          = @TK_LIB_FILE@
TK_DEFS              = @TK_DEFS@
TK_LIBS              = @TK_LIBS@
TK_EXEC_PREFIX       = @TK_EXEC_PREFIX@
TK_XINCLUDES         = @TK_XINCLUDES@
TK_XLIBSW            = @TK_XLIBSW@
TK_DBGX              = @TK_DBGX@
TK_BUILD_LIB_SPEC    = @TK_BUILD_LIB_SPEC@
TK_LIB_SPEC          = @TK_LIB_SPEC@
TK_BUILD_STUB_LIB_SPEC    = @TK_BUILD_STUB_LIB_SPEC@
TK_STUB_LIB_SPEC          = @TK_STUB_LIB_SPEC@
TK_LD_SEARCH_FLAGS   = @TK_LD_SEARCH_FLAGS@

TK_GENERIC_DIR       = ${TK_SRC_DIR}/generic
TK_UNIX_DIR	     = ${TK_SRC_DIR}/unix

#------------------------------------------------------------------------------
# Location of directories in TclX source and build trees.
#
TCL_GENERIC_DIR    = ${TCL_SRC_DIR}/generic
TCL_UNIX_DIR       = ${TCL_SRC_DIR}/unix
TCL_LIBRARY_DIR    = ${TCL_SRC_DIR}/library
TK_GENERIC_DIR     = ${TK_SRC_DIR}/generic
TK_UNIX_DIR        = ${TK_SRC_DIR}/unix

TCLX_GENERIC_DIR   = ${srcbasedir}/tcl/generic
TCLX_UNIX_SRC_DIR  = ${srcbasedir}/tcl/unix
TCLX_UNIX_BLD_DIR  = ${bldbasedir}/tcl/unix
TCLX_BIN_DIR       = ${bldbasedir}/tcl/unix
TCLX_LIB_DIR       = ${bldbasedir}/tcl/unix
TCLX_RUNTIME_DIR   = ${bldbasedir}/tcl/unix

TCLX_TOOLS_SRC_DIR = ${srcbasedir}/unix/tools
TCLX_TOOLS_BIN_DIR = ${bldbasedir}/unix/tools
TCLX_DOC_DIR       = ${srcbasedir}/doc

TKX_GENERIC_DIR    = ${srcbasedir}/tk/generic
TKX_UNIX_SRC_DIR   = ${srcbasedir}/tk/unix
TKX_UNIX_BLD_DIR   = ${bldbasedir}/tk/unix
TKX_BIN_DIR        = ${bldbasedir}/tk/unix
TKX_LIB_DIR        = ${bldbasedir}/tk/unix
TKX_RUNTIME_DIR    = ${bldbasedir}/tk/unix

COMPAT_DIR         = ${srcbasedir}/tcl/compat

#------------------------------------------------------------------------------
# Installation directories.

TCLX_INST_RUNTIME  = ${TCLX_PREFIX}/lib/tclX${TCLX_VERSION}
TKX_INST_RUNTIME   = ${TKX_PREFIX}/lib/tkX${TKX_VERSION}
TCLX_LIBRARY_PATH  = ${TCLX_INST_RUNTIME}
TKX_LIBRARY_PATH   = ${TKX_INST_RUNTIME}

TCLX_EXEC_RUNTIME  = ${TCLX_EXEC_PREFIX}/lib/tclX${TCLX_VERSION}
TKX_EXEC_RUNTIME   = ${TKX_EXEC_PREFIX}/lib/tkX${TKX_VERSION}

TCLX_INST_BIN      = ${TCLX_EXEC_PREFIX}/bin
TKX_INST_BIN       = ${TKX_EXEC_PREFIX}/bin

TCLX_INST_LIB      = ${TCLX_EXEC_PREFIX}/lib
TKX_INST_LIB       = ${TKX_EXEC_PREFIX}/lib

TCLX_INST_INCL     = ${TCLX_PREFIX}/include

TCLX_INST_MAN         = ${TCLX_PREFIX}/man
TCLX_MAN_CMD_SECTION  = n
TCLX_MAN_FUNC_SECTION = 3
MAN_DIR_SEPARATOR     = @MAN_DIR_SEPARATOR@

#------------------------------------------------------------------------------
# Internal programs used run during the build.
#
TCLX_DBGX	   = @TCLX_DBGX@
DBGX		   = @TCLX_DBGX@
TCLX_TMP_RUNTIME   = ${bldbasedir}/tcl/unix
TKX_TMP_RUNTIME    = ${bldbasedir}/tk/unix

RUNTCL             = ${bldbasedir}/unix/runtcl
RUNWISHX           = ${bldbasedir}/unix/runwishx
GENTNDX            = ${RUNTCL} ${TCLX_TOOLS_SRC_DIR}/genindex.tcl
BLDMANHELP         = ${RUNTCL} ${TCLX_TOOLS_BIN_DIR}/bldmanhelp
CONVERTLIB         = ${RUNTCL} ${TCLX_TOOLS_SRC_DIR}/libconvert.tcl
INSTCOPY           = ${RUNTCL} ${TCLX_TOOLS_BIN_DIR}/instcopy
CPMANPAGES         = ${RUNTCL} ${TCLX_TOOLS_BIN_DIR}/cpmanpages

#------------------------------------------------------------------------------
# For conversion of a tcl-script into C-strings.  Used in standalone binaries.
# Requires Tcl PlusPatch.
#
.SUFFIXES: .tcl $(SUFFIXES)

.tcl.c:
	${TCL2C} -o $@ -a -n $@ $<
