####################################################################
# Microwindows and Nano-X configuration file
#
# This package can be configured to run on Linux (MIPS, ARM, POWERPC or x86)
# UNIX, ELKS, DJGPP, or RTEMS.
# On Linux, we've got drivers for Linux 2.x framebuffers, X11, or,
# svgalib for VGA hardware.
# In addition, a gpm or direct serial mouse driver can be configured.
# On ELKS, the bios screen driver and serial mouse driver are always used.
#
# Either Microwindows and/or Nano-X can be built.
# Microwindows and Nano-X have several demos.
#
# For MSDOS makes, see mcmwin.mak and mcnanox.mak
####################################################################

####################################################################
#
# build target platform
#
# Valid ARCH values are:
#
# LINUX-NATIVE
# LINUX-TCC
# LINUX-ARM
# LINUX-MIPS
# LINUX-POWERPC (BIGENDIAN=Y)
# LINUX-SPARC (BIGENDIAN=Y)
# LINUX-SH
# FREEBSD-X86
# SOLARIS (BIGENDIAN=Y)
# TRIMEDIA
# RTEMS
# DJGPP
# ELKS
#
# note: ELKS can't build client/server nano-X, nor widget lib
#
####################################################################
ifeq ($(CONFIG_CLEOPATRA), y)
ARCH                     = CLEOPATRA
BIGENDIAN                = Y
else
CONFIG_UCLINUX           = 1
ARCH                     = uClinux
ifneq ($(CONFIG_M68KNOMMU)$(CONFIG_CPU_BIG_ENDIAN),)
BIGENDIAN                = Y
else
BIGENDIAN                = N
endif
endif
ARMTOOLSPREFIX           = arm-linux-
MIPSTOOLSPREFIX          = mipsel-linux-
POWERPCTOOLSPREFIX       = powerpc-linux-
SHTOOLSPREFIX            = sh-linux-gnu
RTEMSTOOLSPREFIX         = i386-rtemself-

####################################################################
#
# Compiling options
#
####################################################################

ifdef NOT_DEFINED_EVER
OPTIMIZE                 = Y
DEBUG                    = Y
VERBOSE                  = N
THREADSAFE               = Y
GPROF                    = N
else
OPTIMIZE                 = $(subst y,Y,$(CONFIG_USER_MICROWIN_OPTIMIZE))
DEBUG                    = $(subst y,Y,$(CONFIG_USER_MICROWIN_DEBUG))
VERBOSE                  = $(subst y,Y,$(CONFIG_USER_MICROWIN_VERBOSE))
VERBOSE                  = $(subst y,Y,$(CONFIG_USER_MICROWIN_THREADSAFE))
VERBOSE                  = $(subst y,Y,$(CONFIG_USER_MICROWIN_GPROF))
endif

####################################################################
#
# Libraries to build: microwin, nano-X, nanowidget, object frameworks
#
####################################################################

ifdef NOT_DEFINED_EVER
MICROWIN                 = Y
NANOX                    = Y
SHAREDLIBS               = N
OBJFRAMEWORK             = N
else
MICROWIN                 = $(subst y,Y,$(CONFIG_USER_MICROWIN_MICROWIN))
NANOX                    = $(subst y,Y,$(CONFIG_USER_MICROWIN_NANOX))
SHAREDLIBS               = $(subst y,Y,$(CONFIG_USER_MICROWIN_SHAREDLIBS))
OBJFRAMEWORK             = $(subst y,Y,$(CONFIG_USER_MICROWIN_OBJFRAMEWORK))
endif

####################################################################
#
# Demos to build
#
####################################################################

MICROWINDEMO             = $(subst y,Y,$(CONFIG_USER_MICROWIN_MICROWINDEMO))
NANOXDEMO                = $(subst y,Y,$(CONFIG_USER_MICROWIN_NANOXDEMO))

####################################################################
#
# Applications to build
#
####################################################################

NANOWM                   = $(subst y,Y,$(CONFIG_USER_MICROWIN_NANOWM))

####################################################################
#
# The pixeltype of the native hardware or underlying graphics library.
# This definition defines the PIXELVAL to be 32, 16 or 8 bits wide.
# If using Linux framebuffer, set to MWPF_TRUECOLOR0888, and use fbset.
# It also enables GdArea/GrArea for this particular pixel packing format.
#
# define MWPF_PALETTE       /* pixel is packed 8 bits 1, 4 or 8 pal index*/
# define MWPF_TRUECOLOR8888 /* pixel is packed 32 bits 8/8/8/8 truecolor w/alpha*/
# define MWPF_TRUECOLOR0888 /* pixel is packed 32 bits 8/8/8 truecolor*/
# define MWPF_TRUECOLOR888  /* pixel is packed 24 bits 8/8/8 truecolor*/
# define MWPF_TRUECOLOR565  /* pixel is packed 16 bits 5/6/5 truecolor*/
# define MWPF_TRUECOLOR555  /* pixel is packed 16 bits 5/5/5 truecolor*/
# define MWPF_TRUECOLOR332  /* pixel is packed 8 bits 3/3/2 truecolor*/
#
####################################################################

ifeq ($(CONFIG_USER_MICROWIN_MWPF_PALETTE),y)
  SCREEN_PIXTYPE         = MWPF_PALETTE
endif
ifeq ($(CONFIG_USER_MICROWIN_MWPF_TRUECOLOR0888),y)
  SCREEN_PIXTYPE         = MWPF_TRUECOLOR0888
endif
ifeq ($(CONFIG_USER_MICROWIN_MWPF_TRUECOLOR888),y)
  SCREEN_PIXTYPE         = MWPF_TRUECOLOR888
endif
ifeq ($(CONFIG_USER_MICROWIN_MWPF_TRUECOLOR565),y)
  SCREEN_PIXTYPE         = MWPF_TRUECOLOR565
endif
ifeq ($(CONFIG_USER_MICROWIN_MWPF_TRUECOLOR555),y)
  SCREEN_PIXTYPE         = MWPF_TRUECOLOR555
endif
ifeq ($(CONFIG_USER_MICROWIN_MWPF_TRUECOLOR332),y)
  SCREEN_PIXTYPE         = MWPF_TRUECOLOR332
endif

####################################################################
#
# NanoX: Put Y to the following line to link the nano-X application
# with the server.  This is required for ELKS, if no network is present,
# or for speed or debugging.  This affects the nano-X server only.
#
####################################################################

LINK_APP_INTO_SERVER     = $(subst y,Y,$(CONFIG_USER_MICROWIN_LINK_APP_INTO_SERVER))

####################################################################
# Shared memory support for Nano-X client/server protocol speedup
####################################################################

ifdef NOT_DEFINED_EVER
HAVE_SHAREDMEM_SUPPORT   = N
else
HAVE_SHAREDMEM_SUPPORT   = $(subst y,Y,$(CONFIG_USER_MICROWIN_HAVE_SHAREDMEM_SUPPORT))
endif

####################################################################
#
# File I/O support
# Supporting either below drags in libc stdio, which may not be wanted
#
####################################################################

HAVE_FILEIO              = $(subst y,Y,$(CONFIG_USER_MICROWIN_HAVE_FILEIO))

####################################################################
# BMP, GIF reading support
####################################################################

HAVE_BMP_SUPPORT         = $(subst y,Y,$(CONFIG_USER_MICROWIN_HAVE_BMP_SUPPORT))
HAVE_GIF_SUPPORT         = $(subst y,Y,$(CONFIG_USER_MICROWIN_HAVE_GIF_SUPPORT))
HAVE_PNM_SUPPORT         = $(subst y,Y,$(CONFIG_USER_MICROWIN_HAVE_PNM_SUPPORT))
HAVE_XPM_SUPPORT         = $(subst y,Y,$(CONFIG_USER_MICROWIN_HAVE_XPM_SUPPORT))

####################################################################
# JPEG support through libjpeg, see README.txt in contrib/jpeg
####################################################################

ifdef NOT_DEFINED_EVER
HAVE_JPEG_SUPPORT        = Y
INCJPEG                  = .
LIBJPEG                  = /usr/lib/libjpeg.a
else
HAVE_JPEG_SUPPORT        = $(subst y,Y,$(CONFIG_USER_MICROWIN_HAVE_JPEG_SUPPORT))
LIBJPEG                  = -ljpeg
endif

####################################################################
# PNG support via libpng and libz
####################################################################

ifdef NOT_DEFINED_EVER
HAVE_PNG_SUPPORT         = N
INCPNG                   = /usr/include
LIBPNG                   = /usr/lib/libpng.a
LIBZ                     = /usr/lib/libz.a
else
HAVE_PNG_SUPPORT         = $(subst y,Y,$(CONFIG_USER_MICROWIN_HAVE_PNG_SUPPORT))
# INCPNG                   = .
LIBPNG                   = -lpng
LIBZ                     = -lz
endif

####################################################################
# TIFF support through libtiff
####################################################################
HAVE_TIFF_SUPPORT        = N
INCTIFF                  = /usr/include
LIBTIFF                  = /usr/lib/libtiff.a

####################################################################
# native .fnt loadable font support
####################################################################
HAVE_FNT_SUPPORT         = Y
HAVE_FNTGZ_SUPPORT       = N
FNT_FONT_DIR             = "fonts/bdf"

####################################################################
# T1 adobe type1 font support thru t1lib
####################################################################

HAVE_T1LIB_SUPPORT       = $(subst y,Y,$(CONFIG_USER_MICROWIN_HAVE_T1LIB_SUPPORT))
# INCT1LIB                 = /usr/include
# LIBT1LIB                 = /usr/lib/libt1.a

####################################################################
# TrueType font support thru FreeType 1.x
####################################################################

ifdef NOT_DEFINED_EVER
HAVE_FREETYPE_SUPPORT    = Y
INCFTLIB                 = /usr/include
LIBFTLIB                 = /usr/lib/libttf.so
FREETYPE_FONT_DIR        = "fonts/truetype"
else
HAVE_FREETYPE_SUPPORT    = $(subst y,Y,$(CONFIG_USER_MICROWIN_HAVE_FREETYPE_SUPPORT))
# INCFTLIB                 = /usr/include
# LIBFTLIB                 = /usr/lib/libttf.so
FREETYPE_FONT_DIR        = "/usr/local/microwin/fonts"
endif

####################################################################
# Support for many kinds of font thru FreeType 2.x
# Must also set FREETYPE_FONT_DIR in the Freetype 1.x section
####################################################################
HAVE_FREETYPE_2_SUPPORT  = N
INCFT2LIB                = /usr/include
LIBFT2LIB                = /usr/lib/libfreetype.a

####################################################################
# PCF font support 
# Selecting HAVE_PCFGZ_SUPPORT will allow you to directly read
# .pcf.gz files, but it will add libz to the size of the server
####################################################################

HAVE_PCF_SUPPORT         = Y
HAVE_PCFGZ_SUPPORT       = Y
PCF_FONT_DIR             = "fonts/pcf"

####################################################################
# Chinese Han Zi Ku loadable font support
####################################################################

HAVE_HZK_SUPPORT         = $(subst y,Y,$(CONFIG_USER_MICROWIN_HAVE_HZK_SUPPORT))
HZK_FONT_DIR             = "fonts/chinese"

####################################################################
# Chinese BIG5 compiled in font support (big5font.c)
####################################################################

HAVE_BIG5_SUPPORT        = $(subst y,Y,$(CONFIG_USER_MICROWIN_HAVE_BIG5_SUPPORT))

####################################################################
# Chinese GB2312 compiled in font support (gb2312font.c)
####################################################################

HAVE_GB2312_SUPPORT      = $(subst y,Y,$(CONFIG_USER_MICROWIN_HAVE_GB2312_SUPPORT))

####################################################################
# Japanese JISX0213 compiled in font support (jisx0213-12x12.c)
####################################################################
HAVE_JISX0213_SUPPORT    = N

####################################################################
# Korean HANGUL font support (jo16x16.c)
####################################################################
HAVE_KSC5601_SUPPORT     = N

####################################################################
# Japanese EUC-JP support using loadable MGL font
####################################################################
HAVE_EUCJP_SUPPORT       = N
EUCJP_FONT_DIR           = "fonts/japanese"

####################################################################
# Generate screen driver interface only with no fonts or clipping
####################################################################

NOFONTSORCLIPPING        = $(subst y,Y,$(CONFIG_USER_MICROWIN_NOFONTSORCLIPPING))

####################################################################
#
# Window move algorithms for Microwindows
# Change for tradeoff between cpu speed and looks
# ERASEMOVE repaints only backgrounds while window dragging, quicker.
# Otherwise an XOR redraw is used for window moves only after button up,
# quickest (should set for ELKS)
# UPDATEREGIONS paints in update clipping region only for better look and feel
#
####################################################################

ERASEMOVE                = $(subst y,Y,$(CONFIG_USER_MICROWIN_ERASEMOVE))
UPDATEREGIONS            = $(subst y,Y,$(CONFIG_USER_MICROWIN_UPDATEREGIONS))

####################################################################
#
# Link with Gray Palette (valid only for 4bpp modes)
#
####################################################################

GRAYPALETTE              = $(subst y,Y,$(CONFIG_USER_MICROWIN_GRAYPALETTE))

####################################################################
#
# If the platform is running UNIX, Linux or RTEMS...
#
####################################################################

# X Window screen, mouse and kbd drivers
X11                      = $(subst y,Y,$(CONFIG_USER_MICROWIN_X11))

ifeq ($(X11), Y)
# startup screen width, height, (depth for palette mode only)
SCREEN_WIDTH             = 640
SCREEN_HEIGHT            = 480
SCREEN_DEPTH             = 4

# You may want to turn this on for XFree86 4.x or if your backing store
# isn't functioning properly
USE_EXPOSURE		 = Y

endif

# framebuffer screen driver (linear and/or vga 4 planes)
# set VTSWITCH to include virtual terminal switch code
# set FBREVERSE to reverse bit orders in 1,2,4 bpp
# set FBVGA=N for all systems without VGA hardware (for MIPS must=N)

ifdef NOT_DEFINED_EVER
FRAMEBUFFER              = Y
FBVGA                    = Y
VTSWITCH                 = Y
FBREVERSE                = N
else
FRAMEBUFFER              = $(subst y,Y,$(CONFIG_USER_MICROWIN_FRAMEBUFFER))
FBVGA                    = $(subst y,Y,$(CONFIG_USER_MICROWIN_FBVGA))
VTSWITCH                 = $(subst y,Y,$(CONFIG_USER_MICROWIN_VTSWITCH))
FBREVERSE                = $(subst y,Y,$(CONFIG_USER_MICROWIN_FBREVERSE))
endif

# set HAVETEXTMODE=Y for systems that can switch between text & graphics.
# On a graphics-only embedded system, such as Osprey and Embedded
# Planet boards, set HAVETEXTMODE=N
HAVETEXTMODE             = Y

# svgalib screen driver
VGALIB                   = $(subst y,Y,$(CONFIG_USER_MICROWIN_VGALIB))

# direct VGA hardware access screen driver
HWVGA                    = $(subst y,Y,$(CONFIG_USER_MICROWIN_HWVGA))

#Cleopatra VGA
CLEOVGA                  = $(subst y,Y,$(CONFIG_USER_MICROWIN_CLEOVGA))
####################################################################
# Mouse drivers
# GPMMOUSE	gpm mouse
# SERMOUSE	serial Microsoft, PC, Logitech, PS/2 mice (/dev/psaux)
# SUNMOUSE	Sun Workstation mouse (/dev/sunmouse)
# NOMOUSE	no mouse driver
#
# Touchscreen drivers
# IPAQMOUSE	Compaq iPAQ, Intel Assabet (/dev/h3600_tsraw)
# ZAURUSMOUSE	Sharp Zaurus (/dev/sharp_ts)
# TUXMOUSE	TuxScreen (/dev/ucb1x00-ts)
# ADSMOUSE	Applied Data Systems GC+ (/dev/ts)
# ADS7846MOUSE	        ADS7846 chip, PSI OMAP Innovator (/dev/innnovator_ts)
# EPMOUSE	Embedded Planet (/dev/tpanel)
# VHMOUSE	Vtech Helio (/dev/tpanel)
# MTMOUSE	MicroTouch serial (/dev/ttyS1)
# PSIONMOUSE	Psion 5 (/dev/touch_psion)
# YOPYMOUSE	Yopy (/dev/yopy-ts)
# HARRIERMOUSE	NEC Harrier (/dev/tpanel)
####################################################################

ifdef NO_DEFINED_EVER
GPMMOUSE                 = Y
SERMOUSE                 = N
SUNMOUSE                 = N
NOMOUSE                  = N
IPAQMOUSE                = N
ZAURUSMOUSE              = N
TUXMOUSE                 = N
ADSMOUSE                 = N
ADS7846MOUSE             = N
EPMOUSE                  = N
VHMOUSE                  = N
MTMOUSE                  = N
PSIONMOUSE               = N
YOPYMOUSE                = N
HARRIERMOUSE             = N
else
GPMMOUSE                 = $(subst y,Y,$(CONFIG_USER_MICROWIN_GPMMOUSE))
SERMOUSE                 = $(subst y,Y,$(CONFIG_USER_MICROWIN_SERMOUSE))
SUNMOUSE                 = $(subst y,Y,$(CONFIG_USER_MICROWIN_SUNMOUSE))
NOMOUSE                  = $(subst y,Y,$(CONFIG_USER_MICROWIN_NOMOUSE))
IPAQMOUSE                = $(subst y,Y,$(CONFIG_USER_MICROWIN_IPAQMOUSE))
ZAURUSMOUSE              = $(subst y,Y,$(CONFIG_USER_MICROWIN_ZAURUSMOUSE))
TUXMOUSE                 = $(subst y,Y,$(CONFIG_USER_MICROWIN_TUXMOUSE))
ADSMOUSE                 = $(subst y,Y,$(CONFIG_USER_MICROWIN_ADSMOUSE))
ADS7846MOUSE             = $(subst y,Y,$(CONFIG_USER_MICROWIN_ADS7846MOUSE))
EPMOUSE                  = $(subst y,Y,$(CONFIG_USER_MICROWIN_EPMOUSE))
VHMOUSE                  = $(subst y,Y,$(CONFIG_USER_MICROWIN_VHMOUSE))
MTMOUSE                  = $(subst y,Y,$(CONFIG_USER_MICROWIN_MTMOUSE))
PSIONMOUSE               = $(subst y,Y,$(CONFIG_USER_MICROWIN_PSIONMOUSE))
YOPYMOUSE                = $(subst y,Y,$(CONFIG_USER_MICROWIN_YOPYMOUSE))
UCTSMOUSE                = $(subst y,Y,$(CONFIG_USER_MICROWIN_UCTSMOUSE))
DE2TSMOUSE               = $(subst y,Y,$(CONFIG_USER_MICROWIN_DE2TSMOUSE))
CLEOMOUSE                = $(subst y,Y,$(CONFIG_USER_MICROWIN_CLEOMOUSE))
endif

# keyboard or null kbd driver
ifdef NOT_DEFINED_EVER
TTYKBD                   = N
SCANKBD                  = Y
PIPEKBD                  = N
IPAQKBD                  = N
LIRCKBD                  = N
NOKBD                    = N
else
TTYKBD                   = $(subst y,Y,$(CONFIG_USER_MICROWIN_TTYKBD))
SCANKBD                  = $(subst y,Y,$(CONFIG_USER_MICROWIN_SCANKBD))
PIPEKBD                  = $(subst y,Y,$(CONFIG_USER_MICROWIN_PIPEKBD))
IPAQKBD                  = $(subst y,Y,$(CONFIG_USER_MICROWIN_IPAQKBD))
LIRCKBD                  = $(subst y,Y,$(CONFIG_USER_MICROWIN_LIRCKBD))
CLEOKBD                  = $(subst y,Y,$(CONFIG_USER_MICROWIN_CLEOKBD))
NOKBD                    = $(subst y,Y,$(CONFIG_USER_MICROWIN_NOKBD))
endif

####################################################################
# Screen driver specific configuration
# SA1100_LCD_LTLEND 4bpp driver with arm SA1100 LCD controller
# INVERT4BPP 4bpp inverted pixel driver for VTech Helio
####################################################################
SA1100_LCD_LTLEND        = N
INVERT4BPP               = N


