/*
 * Use any X11 parameters that are defined in the platform-specific .cf file.
 */
#if defined(CcCmd) && !defined(TIFFCDriver)
#define TIFFCDriver CcCmd
#endif

#if defined(OptimizedCDebugFlags) && !defined(TIFFOptimizeCFlags)
#define TIFFOptimizeCFlags OptimizedCDebugFlags
#endif

#if defined(DefaultCCOptions) && !defined(TIFFExtraCFlags)
#define TIFFExtraCFlags DefaultCCOptions
#endif

#if defined(StandardDefines) && !defined(TIFFExtraCDefines)
#define TIFFExtraCDefines StandardDefines
#endif

#if defined(StandardIncludes) && !defined(TIFFExtraCIncludes)
#define TIFFExtraCIncludes StandardIncludes
#endif

#if defined(ExtraLoadFlags) && !defined(TIFFExtraCLdFlags)
#define TIFFExtraCLdFlags ExtraLoadFlags
#endif

#if defined(ExtraLibraries) && !defined(TIFFExtraCLdLibs)
#define TIFFExtraCLdLibs ExtraLibraries
#endif

/*****************************************************************************/

/*
 * Define how to compile a TIFF file with the C driver.
 */
#ifndef TIFFCDriver
#define TIFFCDriver $(CC)
#endif

        TIFF_CDRIVER = TIFFCDriver

/*
 * Define all the flags passed to the C driver when we compile a TIFF file.
 */
#ifndef TIFFCFlags
#define TIFFCFlags $(TIFF_STD_CFLAGS) $(TIFF_EXTRA_CFLAGS)
#endif

#ifndef TIFFStdCFlags
#define TIFFStdCFlags \							@@\
	$(TIFF_SHARED_CFLAGS)\						@@\
	$(TIFF_CDEFINES)\						@@\
	$(TIFF_CINCLUDES)
#endif

#ifndef TIFFOptimizeCFlags
#define TIFFOptimizeCFlags -O
#endif

#ifndef TIFFSharedCFlags
#define TIFFSharedCFlags $(SHARED_CCFLAGS)
#endif

#ifndef TIFFExtraCFlags
#define TIFFExtraCFlags /**/
#endif

         TIFF_CFLAGS = TIFFCFlags
     TIFF_STD_CFLAGS = TIFFStdCFlags
  TIFF_SHARED_CFLAGS = TIFFSharedCFlags
   TIFF_EXTRA_CFLAGS = TIFFExtraCFlags
/* Imakefile's decision whether to use */
TIFF_OPTIMIZE_CFLAGS = TIFFOptimizeCFlags

/*
 * Define the defines passed to the C driver when we compile a TIFF file.
 */
#ifndef TIFFCDefines
#define TIFFCDefines $(TIFF_STD_CDEFINES) $(TIFF_EXTRA_CDEFINES)
#endif

/*
 * Library options:
 *	-DMMAP_SUPPORT (memory map read-only files)
 *	-DCOLORIMETRY_SUPPORT (6.0 colorimetry tags)
 *	-DJPEG_SUPPORT (JPEG tags and JPEG algorithms)
 *	-DYCBCB_SUPPORT (6.0 YCbCr tags)
 *	-DCMYK_SUPPORT (6.0 CMYK tags)
 *
 */
#ifndef TIFFStdCDefines
#if defined(SGIArchitecture)
#define TIFFStdCDefines \
    -DCOLORIMETRY_SUPPORT -DJPEG_SUPPORT -DYCBCR_SUPPORT -DCMYK_SUPPORT \
    -DMMAP_SUPPORT -DHAVE_IEEEFP=1 \
    -DUSE_VARARGS=0 -DUSE_PROTOTYPES=1 -DUSE_CONST=1 -ansi
#endif
#if defined(SunArchitecture)
#define TIFFStdCDefines \
    -DCOLORIMETRY_SUPPORT -DYCBCR_SUPPORT \
    -DHAVE_IEEEFP=1 -DUSE_VARARGS=1 -DUSE_PROTOTYPES=0
#endif
#if defined(AIXArchitecture)
#define TIFFStdCDefines \
    -DCOLORIMETRY_SUPPORT -DJPEG_SUPPORT -DYCBCR_SUPPORT -DCMYK_SUPPORT \
    -DHAVE_IEEEFP=1 -DUSE_VARARGS=0 -DUSE_PROTOTYPES=1 -DUSE_CONST=1
#endif
#if defined(HPArchitecture)
#define TIFFStdCDefines \
    -DCOLORIMETRY_SUPPORT -DYCBCR_SUPPORT \
    -DHAVE_IEEEFP=1 -DUSE_VARARGS=1 -DUSE_PROTOTYPES=0
#endif
#if defined(UltrixArchitecture)
#define TIFFStdCDefines \
    -DCOLORIMETRY_SUPPORT -DYCBCR_SUPPORT \
    -DHAVE_IEEEFP=1 -DUSE_VARARGS=1 -DUSE_PROTOTYPES=0
#endif
#if defined(AlphaArchitecture)
#define TIFFStdCDefines \
    -DCOLORIMETRY_SUPPORT -DYCBCR_SUPPORT \
    -DHAVE_IEEEFP=1 -DUSE_VARARGS=1 -DUSE_PROTOTYPES=0
#endif
#if defined(NeXTArchitecture)
#define TIFFStdCDefines \
    -DCOLORIMETRY_SUPPORT -DJPEG_SUPPORT -DYCBCR_SUPPORT -DCMYK_SUPPORT \
    -DHAVE_IEEEFP=1 -DUSE_VARARGS=1 -DUSE_PROTOTYPES=0
#endif
#if defined(ApolloArchitecture)
#define TIFFStdCDefines \
    -DCOLORIMETRY_SUPPORT -DYCBCR_SUPPORT \
    -DHAVE_IEEEFP=1 -DUSE_VARARGS=1 -DUSE_PROTOTYPES=0 -A nansi
#endif
#endif
#if defined(LinuxArchitecture)
#define TIFFStdCDefines \
    -DCOLORIMETRY_SUPPORT -DJPEG_SUPPORT -DYCBCR_SUPPORT -DCMYK_SUPPORT \
    -DHAVE_IEEEFP=1 -DUSE_VARARGS=0 -DUSE_PROTOTYPES=1 -DUSE_CONST=1
#endif

#ifndef TIFFExtraCDefines
#if SystemV
#define TIFFExtraCDefines -DSYSV
#else
#if SystemV4
#define TIFFExtraCDefines -DSVR4
#else
#define TIFFExtraCDefines /**/
#endif
#endif
#endif

/*
 * Compression options:
 *	-DCCITT_SUPPORT
 *	-DPACKBITS_SUPPORT
 *	-DLZW_SUPPORT
 *	-DTHUNDER_SUPPORT
 *	-DNEXT_SUPPORT
 */
#ifndef TIFFCompressionCDefines
#define TIFFCompressionCDefines \					@@\
	-DPACKBITS_SUPPORT\						@@\
	-DLZW_SUPPORT
#endif

       TIFF_CDEFINES = TIFFCDefines
   TIFF_STD_CDEFINES = TIFFStdCDefines
 TIFF_EXTRA_CDEFINES = TIFFExtraCDefines
TIFF_CPRESS_CDEFINES = TIFFCompressionCDefines

/*
 * Define the includes passed to the C driver when we compile a TIFF file.
 */
#ifndef TIFFCIncludes
#define TIFFCIncludes $(TIFF_STD_CINCLUDES) $(TIFF_EXTRA_CINCLUDES)
#endif

#ifndef TIFFStdCIncludes
#ifdef TIFFUseInstalled
#define TIFFStdCIncludes -I$(INCDIR)/TIFF
#else
#define TIFFStdCIncludes -I$(INCSRC)/TIFF
#endif
#endif

#ifndef TIFFExtraCIncludes
#define TIFFExtraCIncludes /**/
#endif

      TIFF_CINCLUDES = TIFFCIncludes
  TIFF_STD_CINCLUDES = TIFFStdCIncludes
TIFF_EXTRA_CINCLUDES = TIFFExtraCIncludes

/*
 * Define all the flags passed to the C driver when we link a TIFF program.
 */
#ifndef TIFFCLdFlags
#define TIFFCLdFlags\
 $(TIFF_CFLAGS) $(TIFF_EXTRA_CLDFLAGS) $(TIFF_EXTRA_CLDLIBS)
#endif

#ifndef TIFFExtraCLdFlags
#define TIFFExtraCLdFlags /**/
#endif

#ifndef TIFFExtraCLdLibs
#define TIFFExtraCLdLibs /**/
#endif

       TIFF_CLDFLAGS = TIFFCLdFlags
 TIFF_EXTRA_CLDFLAGS = TIFFExtraCLdFlags
  TIFF_EXTRA_CLDLIBS = TIFFExtraCLdLibs

/*
 * Make a TIFF object file.
 */
#ifndef MakeTIFFCObjectRule
#define MakeTIFFCObjectRule(dst,src,flags)				@@\
$(AOUT): dst.o								@@\
dst.o: src.c								@@\
	@$(RM) dst.o							@@\
	$(TIFF_CDRIVER) $(TIFF_CFLAGS) flags -c src.c
#endif
