# Generated automatically from Makefile.global.in by configure.
#
# The contents of this file are subject to the AOLserver Public License
# Version 1.1 (the "License"); you may not use this file except in
# compliance with the License. You may obtain a copy of the License at
# http://aolserver.com/.
#
# Software distributed under the License is distributed on an "AS IS"
# basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
# the License for the specific language governing rights and limitations
# under the License.
#
# The Original Code is AOLserver Code and related documentation
# distributed by AOL.
# 
# The Initial Developer of the Original Code is America Online,
# Inc. Portions created by AOL are Copyright (C) 1999 America Online,
# Inc. All Rights Reserved.
#
# Alternatively, the contents of this file may be used under the terms
# of the GNU General Public License (the "GPL"), in which case the
# provisions of GPL are applicable instead of those above.  If you wish
# to allow use of your version of this file only under the terms of the
# GPL and not to allow others to use your version of this file under the
# License, indicate your decision by deleting the provisions above and
# replace them with the notice and other provisions required by the GPL.
# If you do not delete the provisions above, a recipient may use your
# version of this file under either the License or the GPL.
# 
#
# $Header: /cvsroot/aolserver/aolserver/include/Makefile.global.in,v 1.16.2.1 2004/11/20 01:49:54 dossy Exp $
#

#
# Makefile.global.in --
#
#	Common and platform-specific make variables to be included
#	by other makefiles.
#

AOLSERVER	= /usr/local/aolserver
srcdir		= /work/a/ports/www/aolserver/work/aolserver-4.0.10

RM           	= /bin/rm -f
MKDIR		= /bin/mkdir -p

ifdef NSBUILD
    INSTALL_SH	= $(srcdir)/install-sh -c
else
    INSTALL_SH	= $(INSTBIN)/install-sh -c
endif
INSTALL_DATA	= $(INSTALL_SH) -m 644

RANLIB	     	= ranlib
LIBEXT		= .so
TCL_EXEC_PREFIX	= /usr/local
LIB_RUNTIME_DIR =
LDLIB		= ld -shared -x
LDSO		= $(LDLIB)
CCRFLAG         = -Wl,-rpath,${LIB_RUNTIME_DIR}
LDRFLAG         = -rpath ${LIB_RUNTIME_DIR}
CCRPATH         += $(CCRFLAG)$(INSTLIB) $(CCRFLAG)$(TCL_EXEC_PREFIX)/lib
LDRPATH         += $(LDRFLAG)$(INSTLIB) $(LDRFLAG)$(TCL_EXEC_PREFIX)/lib
CC		= $(PURIFY) cc -pipe
CFLAGS_DEBUG	= -g
CFLAGS_OPTIMIZE = -O
CFLAGS_WARNING	= -Wall -Wno-implicit-int -fno-strict-aliasing
CFLAGS_INCLUDE	= -I$(INCDIR) -I/usr/local/include/tcl8.4
CFLAGS_EXTRA	= -fPIC -O2 -fno-strict-aliasing -pipe  -pthread
DEFS      	= -DNO_CONST  -DTCL_THREADS=1 -DUSE_THREAD_ALLOC=1 -D_REENTRANT=1 -D_THREAD_SAFE=1 -DHAVE_PTHREAD_ATTR_SETSTACKSIZE=1 -DHAVE_PTHREAD_ATFORK=1 -DHAVE_READDIR_R=1 -DHAVE_THREE_ARG_READDIR_R=1 -DTCL_WIDE_INT_IS_LONG=1 -DHAVE_GETCWD=1 -DHAVE_OPENDIR=1 -DHAVE_STRSTR=1 -DHAVE_STRTOL=1 -DHAVE_STRTOLL=1 -DHAVE_STRTOULL=1 -DHAVE_TMPNAM=1 -DHAVE_WAITPID=1 -DNO_VALUES_H=1 -DHAVE_LIMITS_H=1 -DHAVE_UNISTD_H=1 -DHAVE_SYS_PARAM_H=1 -DHAVE_SYS_TIME_H=1 -DTIME_WITH_SYS_TIME=1 -DHAVE_TM_ZONE=1 -DHAVE_GMTIME_R=1 -DHAVE_LOCALTIME_R=1 -DHAVE_TM_GMTOFF=1 -DHAVE_ST_BLKSIZE=1 -DSTDC_HEADERS=1 -DNO_UNION_WAIT=1 -DHAVE_SIGNED_CHAR=1 -DHAVE_PUTENV_THAT_COPIES=1 -DHAVE_LANGINFO=1 -DHAVE_SYS_IOCTL_H=1 -DHAVE_SYS_FILIO_H=1   -DTCL_CFG_OPTIMIZED=1 -DTCL_CFG_DEBUG=1 -DHAVE_INTTYPES_H=1 -DHAVE_TIMEGM=1 -DHAVE_POLL=1 -DHAVE_DRAND48=1 -DHAVE_RANDOM=1 -DHAVE_CMMSG=1 -DHAVE_GETADDRINFO=1 -DHAVE_GETNAMEINFO=1 -DHAVE_ZLIB_H=1 -DHAVE_LIBZ=1 
CFLAGS		+= $(CFLAGS_OPTIMIZE) $(CFLAGS_WARNING) $(CFLAGS_EXTRA) $(CFLAGS_INCLUDE)  $(DEFS)

ifndef NSBUILD
    LDFLAGS	+= -L$(AOLSERVER)/lib
    LIBS	+= -lnsthread -lnsd
    INCDIR	= $(AOLSERVER)/include
else
    LDFLAGS	+= -L../nsthread -L../nsd
    INCDIR	= ../include
    ifneq (nsthread,$(LIB))
    	LIBS	+= -lnsthread
    	ifneq (nsd,$(LIB))
            ifneq (nsthreadtest,$(PGM))
                LIBS	+= -lnsd
            endif
    	endif
    endif
endif

LIBS		+= -L/usr/local/lib -ltcl84   -lm  -lz 
CCLIBS		= $(LIBS)  -pthread

# Install directories
INSTBIN		= $(AOLSERVER)/bin
INSTLIB		= $(AOLSERVER)/lib
INSTMOD		= $(AOLSERVER)/modules
INSTTCL		= $(AOLSERVER)/modules/tcl
INSTSRV		= $(AOLSERVER)/servers/server1
INSTSRVMOD	= $(INSTSRV)/modules
INSTSRVPAG	= $(INSTSRV)/pages

# Platform-specific options.
uname = $(shell uname -a)

# Solaris 2.6+
ifneq (,$(findstring SunOS,$(uname)))
    ifneq (,$(findstring 5.6,$(uname)))
        LIBS+=-lthread -lposix4
    else
        LIBS+=-lrt
    endif
endif

# Add dynamic library entry point flags.
ifdef LIBINIT
    ifneq (,$(findstring Darwin,$(uname)))
	LDLIB	+= -init _$(LIBINIT)
    else
	CFLAGS	+= -D$(LIBINIT)=_init
    endif
endif
 
#
# For static linking on Darwin, link modules 
# against server image.
#

ifneq (,$(findstring Darwin,$(uname)))
    ifeq ($(STATIC_BUILD), 1)
        ifdef NSBUILD
            LDSO += -bundle_loader $(srcdir)/nsd/nsd
        else
            LDSO += -bundle_loader $(AOLSERVER)/bin/nsd
        endif
    endif
endif
