# -*- makefile -*-
#
# $Id$
#
# The file Setup is used by the makesetup script to construct the files
# Makefile and config.c, from Makefile.pre and config.c.in,
# respectively.  The file Setup itself is initially copied from
# Setup.in; once it exists it will not be overwritten, so you can edit
# Setup to your heart's content.  Note that Makefile.pre is created
# from Makefile.pre.in by the toplevel configure script.

# (VPATH notes: Setup and Makefile.pre are in the build directory, as
# are Makefile and config.c; the *.in files are in the source
# directory.)

# Each line in this file describes one or more optional modules.
# Comment out lines to suppress modules.
# Lines have the following structure:
#
# <module> ... [<sourcefile> ...] [<cpparg> ...] [<library> ...]
#
# <sourcefile> is anything ending in .c (.C, .cc, .c++ are C++ files)
# <cpparg> is anything starting with -I, -D, -U or -C
# <library> is anything ending in .a or beginning with -l or -L
# <module> is anything else but should be a valid Python
# identifier (letters, digits, underscores, beginning with non-digit)
#
# (As the makesetup script changes, it may recognize some other
# arguments as well, e.g. *.so and *.sl as libraries.  See the big
# case statement in the makesetup script.)
#
# Lines can also have the form
#
# <name> = <value>
#
# which defines a Make variable definition inserted into Makefile.in
#
# Finally, if a line contains just the word "*shared*" (without the
# quotes but with the stars), then the following modules will not be
# included in the config.c file, nor in the list of objects to be
# added to the library archive, and their linker options won't be
# added to the linker options, but rules to create their .o files and
# their shared libraries will still be added to the Makefile, and
# their names will be collected in the Make variable SHAREDMODS.  This
# is used to build modules as shared libraries.  (They must be
# installed using "make sharedinstall".)  (For compatibility,
# *noconfig* has the same effect as *shared*.)

# NOTE: As a standard policy, as many modules as can be supported by a
# platform should be present.  The distribution comes with all modules
# enabled that are supported by most platforms and don't require you
# to ftp sources from elsewhere.


# Example -- included for reference only:
# xx xxmodule.c

# This is for freeze to find the source of the included modules
*shared*
# dbm dbmmodule.c

# CFLAGS = $(OPT) -I$(INCLUDEPY) -I$(EXECINCLUDEPY) $(DEFS)
CFLAGS = $(OPT) -I$(INCLUDEPY) $(DEFS)

POSIX4=`if [ "_SunOS" = _$(MACH_OS) ]; then echo "-lposix4"; else echo ""; fi`

RT=`if [ "_OSF1" = _$(MACH_OS) ]; then echo "-lrt"; else echo ""; fi`

GEN=`if [ "_IRIX" = _$(MACH_OS) ]; then echo "-lgen"; else echo ""; fi`

#The following lines are for including the correct quotas header file(s).
SYS_QUOTA_H=`if [ -f /usr/include/sys/quota.h ]; then echo "-DHAVE_SYS_QUOTA_H"; else echo ""; fi`
XFS_XQM_H=`if [ -f /usr/include/xfs/xqm.h ]; then echo "-DHAVE_XFS_XQM_H"; elif [ -f $(ENSTORE_DEVEL_DIR)/xfsprogs-devel/usr/include/xfs/xqm.h ]; then echo "-DHAVE_XFS_XQM_H -I $(ENSTORE_DEVEL_DIR)/xfsprogs-devel/usr/include" ;else echo ""; fi`
SYS_FS_UFS_QUOTA_H=`if [ -f /usr/include/sys/fs/ufs_quota.h ]; then echo "-DHAVE_SYS_FS_UFS_QUOTA_H"; else echo ""; fi`

#Combine the quotas into one line.
QUOTAS=$(SYS_QUOTA_H) $(XFS_XQM_H) $(SYS_FS_UFS_QUOTA_H)

# EXfer EXfer.c  -D`uname` adler32.a $(POSIX4) $(RT)
EXfer EXfer.c  -I$(PYTHONINC) -D`uname` $(QUOTAS) adler32.a $(POSIX4) $(RT) $(GEN) $(BITS_FLAG)

# NOTE: "=" can not be on the same line with module definition
FTT_DEF=FTT_DIR=
MTX_LIB=`rpm -ql mtx | grep libmtx.so`


IPC IPC.c  -I$(PYTHONINC) $(BITS_FLAG)

Devcodes Devcodes.c  -I$(PYTHONINC) $(BITS_FLAG)

# The EMASS/aci_shadow modules are not built unless ACI_DIR is defined ; see Makefile
### 10-7-2009: Now that the ADIC is gone, we don't need these anymore.
#aci_shadowc aci_shadow_wrap.c  -I$(PYTHONINC) -I./SWIG -I$(ACI_DIR)/inc $ -Wl,-Bstatic -L$(ACI_DIR)/lib -laci -Wl,-Bdynamic $(BITS_FLAG)
#_aci_shadow aci_shadow_wrap.c  -I$(PYTHONINC) -I./SWIG -I$(ACI_DIR)/inc $ -Wl,-Bstatic -L$(ACI_DIR)/lib -laci -Wl,-Bdynamic $(BITS_FLAG)
#derrnoc derrno_wrap.c  -I$(PYTHONINC) -I$(ACI_DIR)/inc $(BITS_FLAG)
#_derrno derrno_wrap.c  -I$(PYTHONINC) -I$(ACI_DIR)/inc $(BITS_FLAG)

checksumc checksum_wrap_thread.c  -I$(PYTHONINC) adler32.a $(BITS_FLAG)
#_checksum checksum_wrap_thread.c  -I$(PYTHONINC) adler32.a $(BITS_FLAG)
mtxc mtx_wrap_thread.c  -I$(PYTHONINC) $(MTX_LIB) $(BITS_FLAG)

socket_extc socket_ext_wrap.c  -I$(PYTHONINC) $(BITS_FLAG)
#_socket_ext socket_ext_wrap.c  -I$(PYTHONINC) $(BITS_FLAG)

strbufferc strbuffer_wrap_thread.c  -I$(PYTHONINC) -D`uname` $(BITS_FLAG)
#_strbuffer strbuffer_wrap_thread.c  -I$(PYTHONINC) -D`uname` $(BITS_FLAG)

ftt2c ftt2_wrap_thread.c  -I$(PYTHONINC) -I$(FTT_DIR)/include -L$(FTT_DIR)/lib -lftt $(BITS_FLAG)
#_ftt2 ftt2_wrap_thread.c  -I$(PYTHONINC) -I$(FTT_DIR)/include -L$(FTT_DIR)/lib -lftt $(BITS_FLAG)

runonc runon_wrap.c runon.c -I$(PYTHONINC) $(BITS_FLAG)
#_runon runon_wrap.c runon.c -I$(PYTHONINC) $(BITS_FLAG)

enroutec enroute_wrap.c enroute.c -I$(PYTHONINC) $(BITS_FLAG)
#_enroute enroute_wrap.c enroute.c -I$(PYTHONINC) $(BITS_FLAG)

Interfaces Interfaces.c  -I$(PYTHONINC) $(BITS_FLAG)
#ExtendedAttributes ExtendedAttributes.c  -I$(PYTHONINC) $(BITS_FLAG)

#rawUDP rawUDP.c  -I$(PYTHONINC) $(QUOTAS) $(POSIX4) $(RT) $(GEN) $(BITS_FLAG)
