# +----------------------------------------------------------------------+
# | Aubit 4gl Language Compiler Version $.0   common makefile include    |
# | This file should be included in ALL Aubit 4gl compiler make files    |
# | that are used to compile Aubit compiler itself                       |
# +----------------------------------------------------------------------+
# | Copyright (c) 2000-5 Aubit Development Team (See Credits file)       |
# +----------------------------------------------------------------------+
# | This program is free software; you can redistribute it and/or modify |
# | it under the terms of one of the following licenses:                 |
# |                                                                      |
# |  A) the GNU General Public License as published by the Free Software |
# |     Foundation; either version 2 of the License, or (at your option) |
# |     any later version.                                               |
# |                                                                      |
# |  B) the Aubit License as published by the Aubit Development Team and |
# |     included in the distribution in the file: LICENSE                |
# |                                                                      |
# | This program is distributed in the hope that it will be useful,      |
# | but WITHOUT ANY WARRANTY; without even the implied warranty of       |
# | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        |
# | GNU General Public License for more details.                         |
# |                                                                      |
# | You should have received a copy of both licenses referred to here.   |
# | If you did not, or have any questions about Aubit licensing, please  |
# | contact afalout@ihug.co.nz                                           |
# +----------------------------------------------------------------------+
#
# $Id: Makefile-common.in,v 1.246 2011/01/24 19:22:45 mikeaubury Exp $
#

#WARNING: __NEVER__ use environment vatiable called "TMP" - Informix
#esql compiler will use it without checking to put it's temp files there
#and fail!


#Make sure we are not picking things from environment that make uses
#automatcally:
CFLAGS=
LIBS=

#MUST be here - it will be used by make "shell" commands
SH				=/usr/bin/bash
SHELL			:=${SH}
LTPIC= -DDLL_EXPORT -DPIC

#Workaround for Informix installers messing up libphtread:
LD_LIBRARY_PATH			:=/lib:${LD_LIBRARY_PATH}

#Name we will use in many places, for consistency:
AUBITNAME			=aubit4gl

#If we later need to know if this makefile was included or not:
MAKEFILE_COMMON_INCLUDED	=1

#############
#this internal variable points to default location of Aubit config files
#Default=/etc/opt/${AUBITNAME}
#...unless user does not have sufficinet rights to install it there, as 
#determined by Autoconf when running ./configure
AUBITETC			=/etc/opt/aubit4gl
CC 					=gcc

#WARNING! configure is not creating this file when in binary tree,
#it is copied in state as configured for source code distribution,
#so in binary tree AUBIT_SRC_ROOT cannot be used since it's wrong,
#together with most other @xxx@ stuff - but we are using makefiles installed
#with binary distro only to install/deinstall and compile stuff in tools/test
#so I guess it's OK - if not, we will have to pack Makefile-common.in with
#binary distro and modify configure to create it for binary build too.
ifneq "${AUBIT_BIN_INSTALL}" "1"
	AUBIT_SRC_ROOT		=C:/gnu/cygwin/usr/src/aubit/aubit4glsrc
endif
AUBIT_VERSION		=1.2
AUBIT_BUILD			=33
COMPILE_DATE		=11-01-2013
AC_TARGET			=i686-pc-cygwin
AC_TARGET_OS		=mingw
#############
#While compiling source code, force priority of 'aubitrc' present in this 
#source code tree. Also applies to aubit-config calls made from makefles 
A4GL_INIFILE			=${AUBIT_SRC_ROOT}/etc/aubitrc

ifeq "${AC_TARGET_OS}" "mingw"
	#override TARGET, because when using CygWin tools with MinGW GCC
	#AC will report:
	#AC_TARGET               =i686-pc-cygwin
	#AC_TARGET_OS            =mingw	
	TARGET			=i686-pc-mingw
else
     ifneq "${CC}" "gcc"
		TARGET			=${AC_TARGET}-cc
	else
		TARGET			=${AC_TARGET}
	endif
endif

ifeq "${TARGET_OS}" ""
	TARGET_OS=$(findstring solaris,${TARGET})
endif
ifeq "${TARGET_OS}" ""
	TARGET_OS=$(findstring linux,${TARGET})
endif
ifeq "${TARGET_OS}" ""
	TARGET_OS=$(findstring aix,${TARGET})
endif
ifeq "${TARGET_OS}" ""
	TARGET_OS=$(findstring cygwin,${TARGET})
endif
ifeq "${TARGET_OS}" ""
	TARGET_OS=$(findstring mingw,${TARGET})
endif
ifeq "${TARGET_OS}" ""
	TARGET_OS=$(findstring darwin,${TARGET})
endif
ifeq "${TARGET_OS}" ""
	TARGET_OS=$(findstring hpux,${TARGET})
endif

ifeq "${TARGET_OS}" ""
	TARGET_OS=unknown
endif

SUBDIR:=$(shell pwd)

## ==================================================================
##                    Read configuration file(s)
## ==================================================================


ifndef NOINCL
	NOINCL=0
endif

#    if expression ; \
#     then command ; \
#          ... ; \
#     else command ; \
#          ... ; \
#     fi


#save current stuff in environment so we can override configuration files
ENV_A4GL_SQLTYPE:=${A4GL_SQLTYPE}
ENV_A4GL_LEXTYPE:=${A4GL_LEXTYPE}
ENV_A4GL_LEXDIALECT:=${A4GL_LEXDIALECT}

ifeq "$(NOINCL)" "0"

	NOERR=2>/dev/null

	AUBITRCFILE:=$(shell ls ${AUBITETC}/aubitrc ${NOERR})
	ifneq "${AUBITRCFILE}" ""
		include ${AUBITRCFILE}
		A1:=${AUBITRCFILE}
	endif

	#override AUBITDIR set in gloabal aubitrc, in case it is pointing
	#to some other location then this source code tree; there is no point
	#to have AUBITDIR set in any other way then by "configure", when
    #compiling Aibt compiler source code; it can cause bad combination of
    #libraries, and in this place, it may cause completely wron include
    #of aubitrc configured different then we want it while compiling

	#check if this file is included from make file in Aubit source tree or
	#not. If we are not, we should not override AUBITDIR
    ifneq "${AUBIT_BIN_INSTALL}" "1"
        AUBITDIR=${AUBIT_SRC_ROOT}
    else
		ifeq "${AUBITDIR}" ""
			#this should happen ONLY when initially installing binary build,
            #unless install of aubitrc to /etc/opt/${AUBITNAME}/aubitrc fails:
			AUBITRCFILE:=$(shell ls ./etc/aubitrc-bin ${NOERR})
			ifneq "${AUBITRCFILE}" ""
				include ${AUBITRCFILE}
				A2:=${AUBITRCFILE}
			endif
        endif
	endif

	ifneq "${AUBITDIR}" ""
		AUBITRCFILE:=$(shell ls ${AUBITDIR}/etc/aubitrc ${NOERR})
		ifneq "${AUBITRCFILE}" ""
			include ${AUBITRCFILE}
			A2:=${AUBITRCFILE}
		endif
    endif

    #check if now AUBITDIR points to Aubit source tree or not. We will have
    #${AUBITDIR}/compilers directory only if it points to source code tree:
	TMP_VAR:=$(shell ls ${AUBITDIR}/compilers ${NOERR})
	ifeq "${TMP_VAR}" ""
        AUBITDIR_SRC=0
    else
        AUBITDIR_SRC=1
		C_DFLAGS        +=-DSRC_TREE
	endif

    export AUBITDIR_SRC

	AUBITRCFILE:=$(shell ls ~/.${AUBITNAME}/aubitrc ${NOERR})
	ifneq "${AUBITRCFILE}" ""
		include ${AUBITRCFILE}
		A5:=${AUBITRCFILE}
    endif

	AUBITRCFILE:=$(shell ls ./.aubitrc ${NOERR})
	ifneq "${AUBITRCFILE}" ""
		include ${AUBITRCFILE}
		A6:=${AUBITRCFILE}
    endif

	ifdef A4GL_INIFILE
		#In binary install, this will point to wrong place,
		#so we better first check if we have it
		IS_THERE:=$(shell ls ${A4GL_INIFILE} ${NOERR})
		ifneq "${IS_THERE}" ""
			include $(A4GL_INIFILE)
			A7:=$(A4GL_INIFILE)
		endif
	endif

endif

# remove any quotes...
ifeq ($(CC),"gcc")
        CC=gcc
endif

#in all cases, override AUBITDIR set in any other way then by "configure"
#for compiling Aubit compiler from source code
ifneq "${AUBIT_BIN_INSTALL}" "1"
	AUBITDIR=${AUBIT_SRC_ROOT}
endif

A4GL_VERSION_STRING=1.2_33

ifneq "${ROOT}" ""
PLUGINDIR=${ROOT}/plugins-${A4GL_VERSION_STRING}
	LIBROOT=${ROOT}/lib
endif


# If we can use AUBIT_SRC_ROOT - even better...
ifneq "${AUBIT_SRC_ROOT}" ""
	PLUGINDIR=${AUBIT_SRC_ROOT}/plugins-${A4GL_VERSION_STRING}
	LIBROOT=${AUBIT_SRC_ROOT}/lib
endif
export PLUGINDIR

#optionally, override things set in environment:
ifneq "${ENVOVERRIDE}" "NO"
	#if ENVOVERRIDE is not set to NO, then...
	ifneq "${ENV_A4GL_SQLTYPE}" ""
		A4GL_SQLTYPE=${ENV_A4GL_SQLTYPE}
    endif
	ifneq "${ENV_A4GL_LEXTYPE}" ""
		A4GL_LEXTYPE=${ENV_A4GL_LEXTYPE}
    endif
	ifneq "${ENV_A4GL_LEXDIALECT}" ""
		A4GL_LEXDIALECT=${ENV_A4GL_LEXDIALECT}
    endif
	
	#A4GL_UI=CONSOLE
    export A4GL_SQLTYPE A4GL_LEXTYPE A4GL_LEXDIALECT A4GL_UI
endif

ifneq "${ENVOVERRIDE}" "YES"
	#We should ignore A4GL_LEXTYPE while compiling the compiler
	A4GL_LEXTYPE=C
	export A4GL_LEXTYPE 
endif


#this is needed when not using LEXTYPE=C, but do we really want to 
#use any other LEXTYPE when building Aubit?
#ifeq "${A4GL_LEXTYPE}" "EC"
#	ifeq "$A4GL_LEXDIALECT" "POSTGRES"
#		FGLC_OUTPUT_EXT=cpc
#        NCC="ecpg_wrap"
#	else
#		FGLC_OUTPUT_EXT=ec
#        NCC="esql"
#    endif
#endif



WINDOWS_DRIVE   =c
CYGWIN_PATH     =/gnu/cygwin

#Substitute Windows drive notation (C: D: E: etc.) with CygWin path mapping
ifneq "${COMSPEC}" ""
	CYG_AUBITDIR	:=$(shell cygpath -u ${AUBITDIR})
endif

## ==================================================================
##                   Global Makefile variables
## ==================================================================

AIX_OBJECT_MODE             =

GCC_VER=4.4

#Version of GCC to treat specially:
ifeq "${GCC_VER}" "3.2"
	GCC_NEW_STYLE=1
endif
ifeq "${GCC_VER}" "3.3"
	GCC_NEW_STYLE=1
endif
ifeq "${GCC_VER}" "3.4"
	GCC_NEW_STYLE=1
endif
ifeq "${GCC_VER}" "4.4"
	GCC_NEW_STYLE=1
endif

ifeq "${GCC_NEW_STYLE}" "1"
    GCC_NO_rdynamic=1
    GCC_NO_PIC=1
    GCC_NO_native-struct=1
endif


GCC_MINGW=yes

#Needed for fixing include paths in UI_GTK:
#FIXME: find a way to get this from Autoconf:
WIN_CYGPATH	=${WINDOWS_DRIVE}${CYGWIN_PATH}


ifeq "${GCC_MINGW}" "yes"
    WIN_PATH	=1
    #AUBITDIR	:=${WIN_CYGPATH}${AUBITDIR}
	#this would incalidate all LINK_LIBS+=-laubit4gl that we need:
	#TARGET_OS	=mingw
endif

ifneq "${AUBIT_BIN_INSTALL}" "1"
	PATH:=${AUBITDIR}/bin:${PATH}
endif


CONFIGURE_COMMAND= '--with-pdcurses=/cygdrive/c/gnu/pdc27_ming_w32' '--with-sqlite=/cygdrive/c/gnu/sqlite-3_3_5' '--enable-ac-debug' '--prefix=/usr/src/aubit/aubit4glbin' 'CFLAGS=-g'

#######################################
#Lclint (Splint) C code checker flags:
#See http://www.splint.org/manual/manual.html

#LCLINTFLAGS		=-weak +posixlib
#When using -skipansiheaders:
#stddef.h needs -I/usr/include/linux
#stdarg.h needs -I/usr/lib/gcc-lib/i386-glibc21-linux/egcs-2.91.66/include
LCLINTFLAGS			=-f .splintrc -I/usr/include/linux -I/usr/lib/gcc-lib/i386-glibc21-linux/egcs-2.91.66/include
#name for log created for each module:
LCLINTLOG  			=lclint.log
#name for cumulative log created in AUBITDIR root:
LCLINT_GLOBAL_LOG	=lclint.log
#Command to use for log file creation:
LCLINTLOGCMD		=2>&1
#This will soon change to "splint":
LCLINTEXE           =no
#Should we ignore if lclint checking fails, or stop:
LCLINTERR           =-

####################
#commands to use:
MAKE				=/usr/bin/make
GMAKE				=no
MKDIR 				=mkdir
CD 					=cd
CP 					=cp
MV                  =mv
CAT                 =cat
RM 					=rm -f
RMDIR				=rm -rf
#CC	 				=c++
#/bin/sh /usr/local/src/php/php-4.2.3/libtool --silent --mode=compile gcc
#LINK.c				=${CC}
#LN_S 				=ln --symbolic --force
LN_S 				=ln -s -f
LN_H                =ln -f
AR 					=ar rc
RANLIB				=ranlib

ifeq "${TARGET_OS}" "aix"
	ifeq "${AIX_OBJECT_MODE}" "64"
		AR=ar -X64 rc
		RANLIB=ranlib -X64
	endif
endif

#BISON will contatin full path to bison executable. It will already include
#-y flag set from autoconf, or "no" if not found or disabled:
BISON               =LANG=C LC_ALL=C /usr/bin/bison -y
BISON_EXE			=/usr/bin/bison
#YACC is variable name we use all over the make files, for Bison command
YACC                =$(strip ${BISON} )

LEX					=flex
ifneq "${LEX}" "no"
	#-i needed to create case insensitive scanner:
	LEX				:=${LEX} -i
endif

NICE                =nice -20
INSTALL_USR			=nobody
INSTALL_GRP 		=nobody
INSTALL_CMD 		=install
INSTALL     		=${INSTALL_CMD} -c -o ${INSTALL_USR} -g ${INSTALL_GRP}
MKPATH      		=mkdir -p
CPPFLAGS 			=
LDFLAGS             = -L/usr/local/lib -L/usr/lib
LDFLAGS_SHARED		= -DDLL_EXPORT -DPIC 
AWK                 =gawk
STRIP               =/cygdrive/e/Qt/2010.02.1/mingw/bin/strip
FIND				=find
UNZIP				=unzip

#Default strip difference :
#-rwxr-xr-x    1 root     root       701702 Jan 28 18:25 bin/4glc
#-rwxr-xr-x    1 root     root       424636 Jan 28 18:25 bin/4glc-strip

#Do we want to strip executables: yes/no
STRIP_EXECUTABLES   =yes

#-rdynamic is needed when calling functions that are defineds in
#executable, from shared libraries that are dlopen at run-time,
#otherwise we get this function calls as undefined symbols. as in:
#4glc: relocation error: /opt/aubit/${AUBITNAME}src/lib/libLEX_C.so: undefined symbol: set_clobber
#-rdynamic basically makes all symbols in a program public to a dlopen() shared lib.
#thsi is a LINKER, not compiler option, and it's not in GCC documentation.
#The -rdynamic option seems to have been
#introduced as a high-level interface to the linker, to (a) force the
#allocation of a global symbol table in the final executable, even if it's
#not strictly needed, and (b) cause the inclusion of the global symbols in
#that symbol table.
#
#        o  Under linux, gcc interprets it by setting the
#           "-export-dynamic" option for ld, which has that effect, according
#           to the linux ld manpage.
#
#        o Under IRIX it's ignored, and the program's happy as a clam.
#
#        o Under SunOS-4.1, gcc interprets it by setting the -dc -dp
#          options for ld, which again forces the allocation of the symbol
#          table in the code produced (see ld(1) on a Sun).

#ifneq "${GCC_VER}" "${GCC_VER_SPEC1}"

RDYNAMIC=-Wl,--export-all-symbols

ifneq "${GCC_NO_rdynamic}" "1"
	#gcc: unrecognized option `-rdynamic'
	RDYNAMIC            =-rdynamic
endif


ifeq "${TARGET_OS}" "mingw"
        RDYNAMIC            =
endif





ifeq "${TARGET_OS}" "solarisxx_not_used"
	#On Solaris: gcc: unrecognized option `-rdynamic'
	#Apprently, this is when Sun native LD is used:	
	#RDYNAMIC		=
	
	#Requested by Phillip Heller:
	#Note that this assumes GNU ld
	RDYNAMIC		=--export-dynamic

	#Solaris 8 (??!!)
	#-export-dynamic worked.  The compiler complaining about the existence of
	# libaubit4gl.so seems to be related to the use of the -Xlinker directive.
 	
	#Solaris ld:
	#   In static mode, -dn, relocatable object files given as argu-
	#     ments are combined to produce an executable object file.  If
	#     the  -r  option  is  specified, relocatable object files are
	#     combined to produce one relocatable object file
		
	#On Solaris:
	#ld -shared nopdf.o -o libEXREPORT_NOPDF.so
	#ld: fatal: option -h and building a dynamic executable are incompatible
	#ld: fatal: Flags processing errors
	
	#Solaris:
	#ld -shared nopdf.o -o libEXREPORT_NOPDF.so
	#ld: fatal: option -h and building a dynamic executable are incompatible
	#ld: fatal: Flags processing errors
	
endif
ifeq "${TARGET_OS}" "darwin"
	#On Darwin:
	#cc: unrecognized option `-rdynamic'
	RDYNAMIC		=
endif
ifeq "${TARGET_OS}" "hpux"
	#On HPUX: gcc: unrecognized option `-rdynamic'
	RDYNAMIC=-a1 -z -Wl,+s -Wl,-E
	CFLAGS+=-fPIC -D__hpux__
endif
ifeq "${TARGET_OS}" "aix"
    #On IBM AIX: gcc: unrecognized option `-rdynamic'
	ifeq "${AIX_OBJECT_MODE}" "64"
		CFLAGS+=-maix64 -D__aix64__
		RDYNAMIC=-Wl,-G,-brtl,-b64,-bexpall
	else
		CFLAGS+=-D__aix__
		RDYNAMIC=-Wl,-G,-brtl
	endif
endif

#FIXME: use gcc to do linking, not ld directly.  Instead of 'ld -shared',
#use 'gcc -shared'.  If you MUST pass linker specific options to ld, use
#'-Wl,--my-ld-option' in your gcc. On Cygwin, using 'ld' directly will not
#automatically pick up the w32api libraries, even if they are installed.
#command line.
#even better, use libtool (once it is working on CygWin)

#LD Command to use for linking libraries:
ifeq "${TARGET_OS}" "darwin"
	#LD                  =ld
	LD              =${CC}
else
	LD              =${CC}
endif

#ifeq "${TARGET_OS}" "hpux"
#	LD              =ld
#endif

#LD Command to use for linking executables:
LD_EXE              =${CC} ${RDYNAMIC} ${CFLAGS}

EXTRASYSTEMLIBS = 
ifeq "${TARGET_OS}" "solaris"
	#LD_EXE         =ld
	LD_EXE		= ${CC} ${RDYNAMIC} ${CFLAGS}
        EXTRASYSTEMLIBS = -lnsl -lsocket -lz
endif
ifeq "${TARGET_OS}" "darwin"
	LD_EXE          =${CC} ${LDFLAGS} -ldl ${RDYNAMIC} ${CFLAGS}
        EXTRASYSTEMLIBS+=${LIBCURL_LIBS}

endif



ALL_LIBS			=
#AUTOCONF_CFLAGS     =-g  -DDLL_EXPORT -DPIC
AUTOCONF_CFLAGS     =-g -g  -DDLL_EXPORT -DPIC

ifeq "${TARGET_OS}" "solaris"
ifneq "${CC}" "gcc"
        AUTOCONF_CFLAGS=-g  -Kpic
        RDYNAMIC=
        PIC=-kpic
	SO_LDFLAGS=-G
endif
endif

ifeq "${TARGET_OS}" "darwin"
        AUTOCONF_CFLAGS+=-fno-common
endif

DDEBUG				=-DDEBUG
#tipycally set by autoconf: AUTOCONF_CFLAGS     =-g -O2
#fixme: set -DDEBUG and -g from configure:

NON_PEDANTIC_OK		=1
#cannot use -pedantic, too much warnings, using Splint instead

WARN_ALL=-Wall
WARN_NONOUSED=-Wno-unused
ifeq "${TARGET_OS}" "linux"
	CWARN    		=-Wall -Wredundant-decls -Wmissing-declarations \
						-Wmissing-prototypes -Wstrict-prototypes
else
	CWARN			=
endif

############################
#If we need to disable unused variables warning, use this.
#This is unfortunate, and we will no doubth accumulate significant 
#ammount of unused variables in the future
#For ID string, use:
#	ifndef lint static char const module_id[] = "..."
#CWARN	+=-Wno-unused-variable


ifeq "${WIN_PATH}" "1"
	C_IFLAGS            =-I$(AUBITDIR)/incl  -I$(AUBITDIR)
else
	C_IFLAGS            =-I$(AUBITDIR)/incl -I$(AUBITDIR)
	#with GCC 3.2 including system include paths manually generates a warning:
	#-I/usr/local/include
endif


ifeq "${TARGET_OS}" "darwin"
	C_IFLAGS 			+=-I$(AUBITDIR)/tools
endif
ifeq "yes" "no"
	C_IFLAGS 			+=-I$(AUBITDIR)/tools/getopt
endif

HAS_LONG_LONG_DTYPE=1
HAVE_ZLIB		=
ZLIB_INC_PATH		=C:/gnu/cygwin/usr/include
ZLIB_LIB_PATH		=C:/gnu/cygwin/lib
ifeq "${ZLIB_INC_PATH}" ""
ZLIB_INC_PATH		=/usr/include
endif
ifeq "${ZLIB_LIB_PATH}" ""
ZLIB_LIB_PATH		=/usr/lib
endif
YYDEBUG             =
C_DFLAGS			+=${DDEBUG} -DHAVE_CONFIG_H ${YYDEBUG}
CFLAGS				+=${CWARN} ${AUTOCONF_CFLAGS} ${C_DFLAGS} ${C_IFLAGS} 
ifneq "${ZLIB_INC_PATH}" ""
	#CFLAGS+=-I${ZLIB_INC_PATH}
endif

#we are overriding LD_LIBRARY_PATH that might existed in environment:
LD_LIBRARY_PATH		:=${AUBITDIR}/lib:/usr/local/lib:${LD_LIBRARY_PATH}

################
#Make sure we have access to Ifx libs - in case user did not configure
#his env correctly. We can deal with PATH, -I and -L in 4glpc config files,
#but Aubit plug-ins (needed by compiler) will fail to load unless this is allready set
LD_LIBRARY_PATH		:=${LD_LIBRARY_PATH}:${INFORMIXDIR}/lib:${INFORMIXDIR}/lib/esql

################
#Make sure we can find Ifx executables - this is needed only for 4glc when
#used directly - not for 4glpc, Since Amake still uses 4glc, we need this in 
#cases user just dumped Informix CSDK without setting environment properly,
#and then forced it to be configured with --with-informix=xxx
PATH				:=${PATH}:${INFORMIXDIR}/bin


#To let know 4glpc we are in process of making compiler, and not
#compiling 4gl programs
MAKINGAUBIT			=1


#There are sutuations in which it's OK for some targets to fail to build.
#Under normal circumstances, we would leave FAIL_OK empty
FAIL_OK             =-

#  -fPIC  If supported for the target machine, emit position-
#         independent code,  suitable  for  dynamic  linking,
#         even if branches need large displacements.
#FIXME: is it OK to have -fPIC when creating executables, not libraries?

#ifneq "${GCC_VER}" "${GCC_VER_SPEC1}"
ifneq "${GCC_NO_PIC}" "1"
	#cc1: warning: -fPIC ignored for target (all code is position independent)
	PIC					= -DDLL_EXPORT -DPIC
endif

ifeq "${TARGET_OS}" "solaris"
ifneq "${CC}" "gcc"
        PIC=-Kpic
	WARN_ALL=
	WARN_NONOUSED=
endif
endif


ifeq "${TARGET_OS}" "darwin"
	#On Darwin Autoconf will set PIC = -fno-common
	#The generation of position-independent code (PIC) is the default is the
	#default on Darwin. Actually, PowerPC code is position-independent by design,
	#so there is no performance or space penalty involved. So, you don't need to
	#specify a PIC option when compiling code for a shared library or module.
	#However, the linker doesn't allow "common" symbols in shared libraries,
	#so you must use the -fno-common compiler option.
	#PIC				=@PIC@ -fPIC
endif
USE_RPCGEN			=0
HAVE_RPCLIB			=0
RPCGEN				=
RPCLIB_NAME			=

HAVELIBCURL			=0
LIBCURLCPPFLAGS			=
LIBCURL_LIBS			=

##################################################
#definitions of names for binary distro file name:
#This is also set in makefile-common by configure, but can change after
#last configure run
#AUBITVERSION:=$(shell cat $(SOURCE)/tools/project/version)
#AUBITBUILD	:=$(shell cat $(SOURCE)/tools/project/build)
AUBITVERSION=1.2
AUBITBUILD=33
AUBITLIBFULL=aubit4gl-${A4GL_VERSION_STRING}
COMPILEDATE	:=$(shell date +%d-%m-%Y)


#How do we wanat compilers (4glc, mcompile, mkmess, fcompile) linked. this
#flag is forwarded to 4glpc:
#LINK_COMPILERS      =-static
LINK_COMPILERS      =-dynamic
#got core dumps when trying this:
#LINK_COMPILERS      =-shared
#which Aubit library we want to link Aubit executables/compiler with. This
#flag is forwarded to C linker:
AUBIT_LIB			=-l$(AUBITLIBFULL)
ifeq "${TARGET_OS}" "solaris"
	AUBIT_LIB			+=-lc
endif


########################
#Define compilers to use for compiling Aubit compiler generated code
#NCC=gcc
FGLC_OUTPUT_EXT=c

########################
#do not install static libraries on CygWin:
#we no longer compile static libs on any platform - remove this
#STATICLIB_INST=no

########################
#This is extension for LOADABLE libraries - using dlopen():
SO_EXT=.dll

########################
#This is extension for LINKABLE libraries - linked at compile time. In Aubit
#this is (or should be) only libaubit4gl:
SO_EXT_LINKABLE=.dll

ARCHEXT			=zip
DIRSEP          =/
#on unix, we expect to have WWW set in environment
#WWW            =/data2/htdocs
GTKCONFIGTEXT   =echo "----- gtk-config --version ---------"
GTKCONFIGCMD    =gtk-config --version
LDDCMD          =ldd

########################
#FIXME: add -g from configure
#FIXME: verify that we need -fPIC in CFLAGS
CFLAGS      +=${PIC}

########################
#flags to linker, when making shared libraries:
SO_LDFLAGS  =-shared
ifeq "${TARGET_OS}" "solaris"
ifneq "${CC}" "gcc"
	SO_LDFLAGS=-G
endif
endif

########################
#list of Aubit plug-ins (loadable modules) that are to be linked statically
#with all external libraries (eg. libUI_TUI with Curses libraries)
#PLUGIN_STATIC=esql

########################
#flags to CC when making and linking executables:
ifeq "${TARGET_OS}" "darwin"
EXE_CFLAGS  =${RDYNAMIC} ${CFLAGS}
else
EXE_CFLAGS  =${RDYNAMIC}
endif

EXEEXT      =
LN          =${LN_H}

########################
#we should not use hard links when we are installing, because this
#can cause errors like "Invalid cross-device link" when source
#and destination is on different deveices:
LN_S_LIB    =${LN_S}
CPEXE       =${LN_H}


## ==================================================================
##                    Platform dependent Settings
## ==================================================================

ifdef COMSPEC #############Windows platform - CygWin/MinGW related:################

	#Only for CygWin - Windows 'find' is useless anyway
	FIND=/bin/find
	UNZIP=/bin/unzip
	
	#dll on Windows are loaded by standard Windows loader, that don't
	#understand CygWin symbolic links:
	SOEXP_EXT   	=${SO_EXT}.a
    DLL_EXPORTLIB_EXT=${SOEXP_EXT}
	DIRSEP			=\\
	WWW				=\\\\APTIVA\\ROOT\\data2\\htdocs
	GTKCONFIGTEXT	=echo "----- gtk-version form makefile -------"
	GTKCONFIGCMD	=echo ${LIBVER}
    LDDCMD          =cygcheck
    #we need makefile for aubit binary build on CygWin to install dll/ and extralibs/

	PATH		:=${CYG_AUBITDIR}/lib:${CYG_AUBITDIR}/bin:${AUBITDIR}/lib:/usr/local/lib:${PATH}

	#native-struct rewuired by GTK on Windows, but causes cc1: unrecognized option `-fnative-struct'
    #error with GCC 3.2 on CygWin
	#ifneq "${GCC_VER}" "${GCC_VER_SPEC1}"
    ifneq "${GCC_NO_native-struct}" "1"
		CFLAGS		+=-fnative-struct
    else
		CFLAGS		+=-mms-bitfields
	endif
    EXEEXT		=.exe
	EXE			=${EXEEXT}

	DLL_CFLAGS=-shared -Wl,--out-implib=TMP${SOEXP_EXT} -Wl,--export-all-symbols
	SO_LDFLAGS	=${DLL_CFLAGS}
	SO_GCCFLAGS =-Xlinker ${RDYNAMIC}

	LN			=cp
	LN_S_LIB    =cp
	CPEXE		=cp

	#ifeq "${GCC_MINGW}" "yes"
		#Native Windows - perform file format conversion:
		#FCONVERT=yes
    #
	#Output will be in DOS format:
	#FCONVERT_CMD=unix2dos -D
	#Output will be in UNIX format:
	#FCONVERT_CMD=unix2dos -U

endif

ifeq "${TARGET_OS}" "darwin"
		#SO_LDFLAGS	=-r ${LDFLAGS}
		#This is to make ONLY dlopen() loadable library, not a standard
        #shared one, ("bundle") so we will need separate setting for
		#libaubit4gl.dynlib
		SO_LDFLAGS	=-flat_namespace -bundle -undefined suppress ${LDFLAGS} ${CFLAGS}

        #Darwin
		#-Wl,-force_flat_namespace is needed to get all the programs
		#to link correctly. (huh?)
endif

ifeq "${TARGET_OS}" "hpux"
	#SO_LDFLAGS	=-b
	SO_LDFLAGS	+=-fPIC
endif

ifeq "${TARGET_OS}" "aix"
	ifeq "${CC}" "gcc"
		ifeq "${AIX_OBJECT_MODE}" "64"
			SO_LDFLAGS +=-maix64 -Wl,-G,-b64
		else
			SO_LDFLAGS +=-Wl,-G
		endif
	endif
endif

## ==================================================================
##                              Libtool configuration
## ==================================================================


ifeq "no" "yes"
#enable memeory debugging with Electric Fence
	SO_LDFLAGS		+=-lefence
	LD_EXE			+=-lefence
endif



#/bin/sh ../../libtool --mode=link gcc  -g -O2  -o mkmess  mkmess.o -laubit4gl -lcheck -lpanel -lform -ldl -lcurses -lc -lgmp

#From Makefie:
#LIBTOOL = $(SHELL) $(top_builddir)/libtool
#LIBTOOL_DEPS = etc/config/ltmain.sh
#...
#LTCOMPILE = $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
#CCLD = $(CC)
#LINK = $(LIBTOOL) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(LDFLAGS) -o $@

LIBTOOL = $(SHELL) $(top_builddir)/libtool
LIBTOOL_DEPS = etc/config/ltmain.sh
LTCOMPILE = $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
CCLD = $(CC)
LINK = $(LIBTOOL) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(LDFLAGS) -o $@


#<options needed also for binary distro makefile========================>

ifeq "${FGLPC}" "new"
	FGLPC_NAME=4glpc_new
	FGLPC_SH=
else
	FGLPC_NAME=4glc
	FGLPC_SH=

	#FGLPC_NAME=4glpc
	#4glpc needs bash to run - old sh will not do. We need to fix this in "aubit" script	
	#FGLPC_SH=${SH}
endif


#Option we need to pass to 4gl compiler used (4glc/4glpc/4glpc_new) to
#make shared library WARNING: 4glpc -sahred option is not same as what traditionaly
#it is for C compilers; in 4glpc it menas "use shared libraries for linking) and
#--as-dll option is used to make shared library. Also, 4glpc accepts "-as-dll" and
#--as-dll but 4glc accepts --as-dll or --shared, and NOT -as-dll. 4glpc_new takes 
#--as-dll, but not --shared
AS_DLL=--as-dll
ifdef VERBOSE
	VERBOSE_FLAG=--verbose
endif


FGLPCEXEC_NAME=${AUBIT_SRC_ROOT}/bin/4glpc
ifneq "${AUBIT_BIN_INSTALL}" "1"
	FCOMPILE	=${AUBIT_SRC_ROOT}/bin/fcompile
	#MKMESS      =${AUBIT_SRC_ROOT}/bin/mkmess
    MKMESS      =${AUBIT_SRC_ROOT}/bin/amkmessage
	FGLPCEXEC	:=${FGLPC_SH} ${AUBIT_SRC_ROOT}/bin/${FGLPC_NAME}
	MCOMPILE	=${AUBIT_SRC_ROOT}/bin/mcompile
else
	FCOMPILE	=aubit fcompile
	#MKMESS      =aubit mkmess
	MKMESS      =aubit amkmessage
	FGLPCEXEC	=${FGLPC_SH} aubit ${FGLPC_SH} ${FGLPC_NAME}
	MCOMPILE	=aubit mcompile
endif


#install location:
ifdef COMSPEC
	#on Windows, dll libraries need to be in the path
	LIB_INSTALL_LINK=/usr/local/bin
else
	#FSH and RPM rules say we should install binaries (links) in
	#${PREFIX}/${AUBITNAME} and libraries (links) in ${PREFIX}/lib. But this will
	#in our case be /opt, and on 99% of the systems we will not have /opt/bin
	#already in the path, and /opt/lib will not be in libraries search path.
	#This conflicts with RPM rule that say that installed programs "must be
	#operational" after RPM install is finished. Therefore, we have to use
	#/usr/lib and /usr/bin:

	#/usr/local/lib is not in default lib load path on RedHat, so we MUST use
	#/usr/lib to get things working immediately after installation, without the
	#need to edit system files manualy

	LIB_INSTALL_LINK=/usr/lib
endif

PREFIX=/usr/src/aubit/aubit4glbin
BIN_INSTALL_LINK=/usr/bin
#INSTALL_DIR=${PREFIX}/${AUBITNAME}
INSTALL_DIR=${PREFIX}

GREP_WORD=/usr/bin/grep -w

#Set AUBITDIR in aubitrc settings:
	TOREPLACE=^AUBITDIR

	ifeq "${AUBIT_BIN_INSTALL}" "1"
		LOOKFOR_INFILE:=${AUBITDIR}/etc/aubitrc-bin
    else
		LOOKFOR_INFILE:=${AUBITDIR}/etc/aubitrc
    endif

	INFILE:=$(shell ls ${LOOKFOR_INFILE} ${NOERR})

	ifneq "${INFILE}" ""
		OLDVALUE:=$(shell ${GREP_WORD} "${TOREPLACE}" ${INFILE} | awk '{print $1}' | sed -e "s/\//\\\\\//g")
		ifeq "${GCC_MINGW}" "yes"
			NEWVALUE:=$(shell echo "AUBITDIR=${WIN_CYGPATH}$(INSTALL_DIR)" | sed -e "s/\//\\\\\//g")
        else
			NEWVALUE:=$(shell echo "AUBITDIR=$(INSTALL_DIR)" | sed -e "s/\//\\\\\//g")
        endif
		STARTWITH=^${OLDVALUE}
		REPLACEWITH=${NEWVALUE}
    endif

	#this DIRECTORY is created in configure
	#ifneq "$(shell  if test -w ${AUBITETC} ; then echo 1; fi)" "1"
	#	DUMMY:=$(shell ${MKPATH} ${AUBITETC})
    #endif

	#command line parameter to make : "make aubitrc=new"
    #this will force ${AUBITETC}/aubitrc to be overwriten with new one
	ifneq "${aubitrc}" "new"
		AUBITRCFILEEXISTS:=$(shell ls ${AUBITETC}/aubitrc 2>/dev/null)
    endif

	#This DIRECTORY is created from configure
	#ifeq "${AUBITRCFILEEXISTS}" ""
	#	#create path
	#	DUMMY:=$(shell ${MKPATH} ${AUBITETC})
	#	#AUBITRCFILEEXISTS:=$(shell ls ${AUBITETC}/aubitrc 2>/dev/null)
	#endif

LDCONFIG=no
ifneq "${LDCONFIG}" "no"
	LD_SO_CONF=/etc/ld.so.conf
	GREP_LD_SO_CONF:=$(shell grep ${INSTALL_DIR}/lib ${LD_SO_CONF})
	GREP_LD_SO_CONF_REMOVE:=$(shell echo "${GREP_LD_SO_CONF}" | sed -e "s/\//\\\\\//g")
endif

#All paths to libraries, that configure script detected outside standard
#library paths. We can use them when compiling, we can use them even in
#4glpc, but when user try to run compiled program, they will unlimately
#fail unless this paths are in LD_LIBRARY_PATH, or in Lunix, optionally in
#/etc/ld.so.conf (don't forget ro run "ldconfig" is you change ld.so.conf
#file manually!)
#We have 2 choices to make user's life easier:
#1) On linux only, we can stuff them in ld.so.conf, and re-run ldconfig.
#   this will be done with "make ldconfig". This will work immediately,
#   but it depenfd on user's rights to write to this file, and works only
#   on Linux.
#   NOTE: ld.so.conf apparently only applies to dynamic loader - but NOT
#   compiler linker ?
#
#2) On non-Linux systems, we can try to stuff them in /etc/profile, (depending
#	on user's rights) or $HOME/.bashrc (? $HOME/.profile), and source this
#	file as ".$HOME/.bashrc". This should also work immediately.
#
#/usr/local/lib should always be in there !
ADD_LD_LIBRARY_PATH=c:/gnu/pdc27_ming_w32;C:/PROGRA~1/IBM/Informix/CLIENT~1/lib;C:/PROGRA~1/IBM/Informix/CLIENT~1/lib/esql;:/usr/local/lib
#ADD_LD_LIBRARY_PATH_SPACE=${ADD_LD_LIBRARY_PATH::/=--}
#ADD_LD_LIBRARY_PATH_SPACE:=$(shell echo ${ADD_LD_LIBRARY_PATH} | sed -e "s%:% %g")
ADD_LD_LIBRARY_PATH_SPACE:=$(shell echo "${ADD_LD_LIBRARY_PATH}" | sed -e "s/:/ /g" -e "s/;/ /g")

#</options needed also for binary disrto makefile========================>




#All varibales needed in environment, primarily because 4glpc cannot
#read this file - all make files should include this file anyway:
export MAKINGAUBIT
ifneq "${AUBIT_BIN_INSTALL}" "1"
	export AUBIT_SRC_ROOT
endif
export AUBITDIR
#This one is needed to run Aubit compiled programs from build process:
export LD_LIBRARY_PATH
#AUBIT_BIN_INSTALL is needed for make files and 4glpc to know they are not
#in Aubit compiler source code tree; it is added to this file by "make install"
export AUBIT_BIN_INSTALL
#Must be exported on MinGW, but don't seem to be working (put it in profile):
export PATH


## ==================================================================
##            Convert Autoconf variables to Make variables
## ==================================================================

#Convert Autoconf variables into Make variables here, so we don't need to
#process every make file with Autoconf:

# Misc
EXE_EXT				=.exe
GLIB_CFLAGS			=
FORMS_DESTINATION	=etc
HELP_DESTINATION	=etc
COMP_FORM_EXT		=.afr.dat
LIBPQ_FE_H_IFLAGS	=-I/cygdrive/c/PROGRA~1/POSTGR~1/8.1/include/
RPM					=no
RPM_A4GL_DEFAULT_PREFIX=/opt/aubit4gl-rpm
LIBTOOL_DEPS		=etc/config/ltmain.sh
enable_minimal		=

# Windows / CygWin / MinGW / MSYS
CYGWIN_PATH_WIN		=C:\gnu\cygwin
MSYS_ROOTDIR		=C:/gnu/msys
GCC_HOME_WINPATH	=e:\Qt\2010.02.1\mingw
GCC_HOME_CYGPATH	=/cygdrive/e/Qt/2010.02.1/mingw

# Informix
IFMX_ESQLC			='c:/Program Files/IBM/Informix/Client-SDK/bin/esql'
IFX_LIBS            ="C:/PROGRA~1/IBM/Informix/CLIENT~1/bin/isqlt09a.dll" "C:/PROGRA~1/IBM/Informix/CLIENT~1/bin/igl4n304.dll" "C:/PROGRA~1/IBM/Informix/CLIENT~1/bin/iglxn304.dll" "C:/PROGRA~1/IBM/Informix/CLIENT~1/bin/igo4n304.dll"    
INFORMIXC			=gcc
INFORMIXDIR			='C:/PROGRA~1/IBM/Informix/CLIENT~1'
INFORMIXDIR_UNQUOTED=C:/PROGRA~1/IBM/Informix/CLIENT~1
ifdef COMSPEC
#WARNING: CygWin shell does funny things to variables that are quoted; string
#'abc' becomes ''\''abc''\'' - try comparing output of 'set' and 'echo $VARNAME'
#So - we cannot use qupted pats - MAKE SURE ALL PATHS WITH POTENTIAL SPACES IN THEM
#ARE CONVERTED IN DOS 8.3 FORMAT!!!
	INFORMIXDIR=${INFORMIXDIR_UNQUOTED}
endif
export INFORMIXDIR

# Querix 
Q_ESQLC				=no

# GTK+
GTK_INC_PATH		=-IC:/gnu/GTK/include/gtk-2.0 -IC:/gnu/GTK/lib/gtk-2.0/include -IC:/gnu/GTK/include/atk-1.0 -IC:/gnu/GTK/include/cairo -IC:/gnu/GTK/include/pango-1.0 -IC:/gnu/GTK/include/glib-2.0 -IC:/gnu/GTK/lib/glib-2.0/include 
GTK_LIB_PATH		=-LC:/gnu/GTK/lib  
GTKLIBS				=-lgtk-win32-2.0 -lgdk-win32-2.0 -latk-1.0 -lgdk_pixbuf-2.0 -lpangowin32-1.0 -lgdi32 -lpangocairo-1.0 -lpango-1.0 -lcairo -lgobject-2.0 -lgmodule-2.0 -lglib-2.0 -lintl -liconv  
GTK_VERSION			=2.0

# Curses
HAVE_CURSES     	=0
HAVE_WIDE_NCURSES     	=
CURSES_INC_PATH 	=
CURSES_LIB_PATH		=
CURSES_LIB_NAME 	=
HAVE_LIBQRENCODE	=0
HAVE_STDCPP=1
HAVE_LIBDL		=0
USE_LIBDL=	0



# PDcurses
HAVE_PDCURSES   	=1
HAS_PDCURSES_STATIC_OBJS =1
PD_CURSES_LIB_PATH	=-Lc:/gnu/pdc27_ming_w32
PD_CURSES_INC_PATH	=-Ic:/gnu/pdc27_ming_w32
PD_CURSES_LIB_NAME	=c:/gnu/pdc27_ming_w32/pdcurses.a c:/gnu/pdc27_ming_w32/panel.a
PD_CURSES_DRIVE		=c
PD_CURSES_CYGDRIVE	=/cygdrive/c
XCURSES_CFLAGS		=
XCURSES_LIBS		=

# libPDF
PDFLIB_L_FLAGS		=
PDFLIB_I_FLAGS		=

# PCRE
PCRE_INC_PATH		=C:/gnu/cygwin/usr/local
PCRE_LIB_PATH		=C:/gnu/cygwin/usr/local

# XML-RPC
XMLRPC_LFLAGS		=-LC:/gnu/msys/local/lib -L/usr/local/lib -L/usr/lib
XMLRPC_IFLAGS		=-IC:/gnu/msys/local/include
XMLRPC_LIBS			= 			-lxmlrpc_client -lxmltok -lxmlparse -lwwwinit -lwwwapp -lwwwhtml 			-lwwwtelnet -lwwwnews -lwwwhttp -lwwwmime -lwwwgopher -lwwwftp -lwwwfile 			-lwwwdir -lwwwcache -lwwwstream -lwwwmux -lwwwtrans -lwwwcore -lwwwutils 			-lmd5 -lws2_32 -lxmlrpc -lxmlrpc_xmlparse -lxmlrpc_xmltok -lwwwxml

# Iksemel / Jabber
JABBERBUILD			=no
IKSEMEL_I_FLAGS		=
IKSEMEL_L_FLAGS		=

# SQLite
SQLITE_LIBNAME		=sqlite3
SQLITE_LDPATH		=c:/gnu/sqlite-3_3_5/lib
SQLITE_LDPATH2		=c:/gnu/sqlite-3_3_5

SQLITE_ODBC			=
SQLITE_ODBC_VER		=
SQLITE_ODBC_LIBNAME_SHARED	=
SQLITE_ODBC_LIBNAME_STATIC	=
SQLITE_ODBC_LIBDIR	=

# iODBC
IODBC_INCLUDE		= 
IODBC_LFLAGS		=
IODBC_LIBS			=

# UnixODBC
UNIXODBC_LFLAGS		=
UNIXODBC_INCLUDE	=
UNIXODBC_LIBS		= 

# PostgreSQL
PGODBC_INCLUDE		= 
PGODBC_LFLAGS		=	
PGODBC_LIBNAME		= 
PGSQL_INCLUDE		=-Ic:\PROGRA~1\POSTGR~1\8.1\include
PGSQL_LFLAGS		=-Lc:\PROGRA~1\POSTGR~1\8.1\lib 
PGSQL_LIBS			=-lpq
PGSQL_INCDIR		=/cygdrive/c/PROGRA~1/POSTGR~1/8.1/include
PGSQL_INCLUDE		=-Ic:\PROGRA~1\POSTGR~1\8.1\include
PGSQL_LIBDIR		=/cygdrive/c/PROGRA~1/POSTGR~1/8.1/lib
PG_ESQLC_V3             =0
PG_ESQLC			=c:/PROGRA~1/POSTGR~1/8.1/bin/ecpg
ECPG_HAVE_ECPGGET_PGCONN	=
ECPG_INCDIR			=/cygdrive/c/PROGRA~1/POSTGR~1/8.1/include
ECPG_LIBDIR			=/cygdrive/c/PROGRA~1/POSTGR~1/8.1/lib
ECPG_LFLAGS			=-Lc:\PROGRA~1\POSTGR~1\8.1\lib
ECPG_IFLAGS			=-Ic:\PROGRA~1\POSTGR~1\8.1\include -I/cygdrive/c/PROGRA~1/POSTGR~1/8.1/include
HAVE_PGSQL_LIB		=yes
POSTGRESDIR			=c:\PROGRA~1\POSTGR~1\8.1

#MySQL
MYSQL_LFLAGS		=-LC:/gnu/cygwin/usr/local/lib -LC:/gnu/cygwin/usr/local/mysql -L/usr/lib/mysql -L/usr/lib
MYSQL_IFLAGS		=-IC:/gnu/cygwin/usr/local/include -I/usr/include/mysql
SQL_MYSQL_EMB		=no
SQL_MYSQL			=no

# SAP DB / MaxDB
SAPODBC_INCLUDE		= 
SAPODBC_LFLAGS		=
SAPDB_ODBC_ADDLIBS	=

SAPDB_ESQLC			=no
SAPDB_INCDIR		= 
SAPDB_LIBDIR		=

#Ingres
INGRES_INST_PATH	=
HAVE_INGRES_ESQLC	=no
INGRES_ESQLC		=
export INGRES_INST_PATH INGRES_ESQLC HAVE_INGRES_ESQLC

# Doxy
DOXYGEN				=/usr/bin/doxygen
WWW_DOCUMENT_ROOT	=
CGI_DIR				=
WWW_HOST_NAME		=localhost

# ORBit / CORBA
HAS_ORBIT_TYPE		=0
ORBIT_IDL			=no
ORBIT_NAME			=ORBit-2.0
ORBIT_VERSION		=
CAPI_LDFLAGS		=
CAPI_CFLAGS			=
ORBIT_CONFIG		=no

TUI_DIALOG			=@TUI_DIALOG@
TUI_DIALOG_VERSION	=@TUI_DIALOG_VERSION@
XDIALOG				=@XDIALOG@
XDIALOG_VERSION		=@XDIALOG_VERSION@
DIALOG				=@DIALOG@
DIALOG_TYPE			=@DIALOG_TYPE@
EXDATA_MPZ			=no
PERL				=/usr/bin/perl


GETOPT_LONG			=yes
RPCLIB_INCLUDE		=
YYDEBUG				=

POP_INC_PATH		=C:/gnu/cygwin/usr/include
POP_LIB_PATH		=C:/gnu/cygwin/lib

SMTP_INC_PATH		=-IC:/gnu/GTK/include/glib-2.0 -IC:/gnu/GTK/lib/glib-2.0/include  
 -IC:/gnu/cygwin/usr/include
SMTP_LIB_PATH		=C:/gnu/cygwin/lib


INNO_ROOTDIR		=C:\Program Files\Inno Setup 5
ISTOOL_ROOTDIR		=C:\Program Files\ISTool\

ifeq "${POP_INC_PATH}" ""
POP_INC_PATH		=/usr/include
endif
ifeq "${POP_LIB_PATH}" ""
POP_LIB_PATH		=/usr/lib
endif


ifeq "${SMTP_INC_PATH}" ""
SMTP_INC_PATH		=/usr/include
endif
ifeq "${SMTP_LIB_PATH}" ""
SMTP_LIB_PATH		=/usr/lib
endif

## ==================================================================
##                      Moved from aubitrc:
## ==================================================================

PDFBUILD=no
JABBERBUILD=no
PERLBUILD=yes
GTKBUILD=yes
HAVE_UNIXODBC=no
HAVE_IODBC=no
RPCLIB_NAME=

###############################
#GTK+ 2.0 configuration
GTK_CONFIG="@GTK_CONFIG@"
PKG_CONFIG="/cygdrive/c/gnu/GTK/bin/pkg-config"
#package names reported by gtk-config or pkg-config:
GTK_NAME="gtk+-2.0"
GDK_NAME="gdk-2.0"
GLIB_NAME="glib-2.0"

MANUAL_GTK="-lgtk-win32-2.0 -lgdk-win32-2.0 -latk-1.0 -lgdk_pixbuf-2.0 -lpangowin32-1.0 -lgdi32 -lpangocairo-1.0 -lpango-1.0 -lcairo -lgobject-2.0 -lgmodule-2.0 -lglib-2.0 -lintl -liconv  
 -LC:/gnu/GTK/lib  
 -IC:/gnu/GTK/include/gtk-2.0 -IC:/gnu/GTK/lib/gtk-2.0/include -IC:/gnu/GTK/include/atk-1.0 -IC:/gnu/GTK/include/cairo -IC:/gnu/GTK/include/pango-1.0 -IC:/gnu/GTK/include/glib-2.0 -IC:/gnu/GTK/lib/glib-2.0/include "

## ==================================================================
##                      Common rules
## ==================================================================

#Create make file in current directory:
%.mak: Makefile.in
	cd ${AUBITDIR} && $(SH) ./config.status --file $(SUBDIR)/Makefile

#"new" for instance
%ew: Makefile.in
	cd ${AUBITDIR} && $(SH) ./config.status --file $(SUBDIR)/Makefile

#causes strange makefile updates...
#"makefile" for instance
#%akefile: Makefile.in
#	cd ${AUBITDIR} && $(SH) ./config.status --file $(SUBDIR)/Makefile


## ==================================================================
##                    Install Settings
## ==================================================================

################################
#RPM setup:
RPMBUILDROOT=no-rpm-build-root

BIN_PATH    =bin
LIB_PATH    =lib
DOC_PATH    =docs
TEST_PATH   =tools/test
FGLPC_SETTINGS_PATH   =tools/4glpc/settings
ETC_PATH    =etc
INCL_PATH   =incl
IDE_PATH  	=tools/ide
CONVSQL_PATH=etc/convertsql
IMPORT_PATH=etc/import

#installation files sourcing paths. This is generally the same as destination
#paths, but with different SOURCE path.
SOURCE 		=${AUBIT_SRC_ROOT}
BIN_DIR     =$(SOURCE)/${BIN_PATH}
LIB_DIR     =$(SOURCE)/${LIB_PATH}
PLUGIN_DIR	=$(SOURCE)/plugins-${A4GL_VERSION_STRING}
DOC_DIR    	=$(SOURCE)/${DOC_PATH}
FGLPC_SETTINGS_DIR     =$(SOURCE)/$(FGLPC_SETTINGS_PATH)
TEST_DIR    =$(SOURCE)/${TEST_PATH}
TEST_DIR_STD=$(TEST_DIR)
TEST_DIR_GUI=$(TEST_DIR)/gui
ETC_DIR    	=$(SOURCE)/${ETC_PATH}
HOME_DIR    =$(SOURCE)
ROOT_DIR    =$(SOURCE)
INCL_DIR    =$(SOURCE)/${INCL_PATH}
IDE_DIR    	=$(SOURCE)/${IDE_PATH}
CONVSQL_DIR =$(SOURCE)/${CONVSQL_PATH}
IMPORT_DIR =$(SOURCE)/${IMPORT_PATH}

#Paths to install to:
BIN_DEST	=$(INSTALL_DIR)/${BIN_PATH}
LIB_DEST	=$(INSTALL_DIR)/${LIB_PATH}
PLUGIN_DEST	=$(INSTALL_DIR)/plugins-${A4GL_VERSION_STRING}
FGLPC_SETTINGS_DEST	=$(INSTALL_DIR)/${FGLPC_SETTINGS_PATH}
DOC_DEST   	=$(INSTALL_DIR)/${DOC_PATH}
TEST_DEST   =$(INSTALL_DIR)/${TEST_PATH}
TEST_DEST_STD =$(TEST_DEST)
TEST_DEST_GUI =$(TEST_DEST)/gui
ETC_DEST   	=$(INSTALL_DIR)/${ETC_PATH}
HOME_DEST   =$(HOME)
ROOT_DEST	=$(INSTALL_DIR)
INCL_DEST	=$(INSTALL_DIR)/${INCL_PATH}
DATAIOINCL_DEST	=$(INSTALL_DIR)/${INCL_PATH}/dataio
IDE_DEST   	=$(INSTALL_DIR)/${IDE_PATH}
CONVSQL_DEST=$(INSTALL_DIR)/${CONVSQL_PATH}
IMPORT_DEST=$(INSTALL_DIR)/${IMPORT_PATH}


## ==================================================================
##                    To bin directory
## ==================================================================

AMAKE_BIN_SCRIPTS=amake genmake prepmake
AMAKE_BIN_EXE=aubit-config
RUNTIME_EXE=afinderr configurator aubit-config fshow loadmap layout_engine report_viewer
BIN_SCRIPTS=aubit ecpg_wrap amake genmake prepmake runner_fgl_wrapper adbaccess aperform aace_runner a4gl
BIN_PERL_MODULES=$(SOURCE)/compilers/ace/perl_runner/report.pm $(SOURCE)/compilers/ace/perl_runner/using.pm
RUNTIME_RESOURCE=
COMP_EXE=4glc fcompile amkmessage convertsql 4glpc sql_parse adbschema 	asql_g.4ae a4gl.4ae aace generate_aace aace_4gl aace_perl 		mcompile mdecompile process_report quick_check_logrep adecompile ide1.4ae 		fdecompile unmkmessage default_frm quickguide.4ae fglproto aupscol adbload2 asql_i.4ae runforms.4ae asql_p.4ae 
PCODE_ENABLED=no
BIN_EXE=${COMP_EXE} ${AMAKE_BIN_EXE} ${RUNTIME_EXE}

#Building this is optional:
ifneq "$(shell ls $(SOURCE)/bin/fdecompile-j${EXEEXT} 2> /dev/null)" ""
	#needs missing source code
	BIN_EXE		+=fdecompile-j${EXEEXT}
endif
#user's manual choice (make extra):
ifneq "$(shell ls $(SOURCE)/bin/odbctest-unixODBC${EXE} 2> /dev/null)" ""
	BIN_EXE		+=odbctest-unixODBC${EXE}
endif
ifneq "$(shell ls $(SOURCE)/bin/odbctest-iodbc3${EXE} 2> /dev/null)" ""
	BIN_EXE		+=odbctest-iodbc3${EXE}
endif
ifneq "$(shell ls $(SOURCE)/bin/odbctest-iodbc2${EXE} 2> /dev/null)" ""
	BIN_EXE		+=odbctest-iodbc2${EXE}
endif

#WARNING: watch out for files that allready have Aubit exe extension (.4ae)
#On Windows, we cant just add .exe to them!
#$(filter %.o,$(files))
BIN_EXE_NOT_4AE=$(filter-out %.4ae,${BIN_EXE})
BIN_EXE_4AE=$(filter %.4ae,${BIN_EXE})

#4glpc compile settings files
FGLPC_SETTINGS_FILES= C C_INFORMIX EC EC_INFOFLEX EC_INFORMIX EC_INGRES EC_POSTGRES EC_SAP INFORMIX PCODEC SPL_INFORMIX aix aix__EC_INFORMIX darwin darwin__EC_POSTGRES i686-pc-linux-gnuaout-cc__C i686-pc-linux-gnuaout-cc__EC mingw__C mingw__EC_INFORMIX mingw__EC_POSTGRES x86_64-unknown-linux-gnu__C x86_64-unknown-linux-gnu__EC x86_64-unknown-linux-gnu__EC_INFORMIX x86_64-unknown-linux-gnu__EC_POSTGRES

BIN_FILES   =${BIN_SCRIPTS} ${RUNTIME_RESOURCE} ${BIN_EXE_4AE} \
			$(addsuffix ${EXE_EXT},${BIN_EXE_NOT_4AE})
AMAKE_BIN_FILES	=${AMAKE_BIN_SCRIPTS} $(addsuffix ${EXE_EXT},${AMAKE_BIN_EXE})


#Additional files to allways remove from bin, even if we would not install
#them under current configuration:
BIN_ALLWAYSCLEAN=$(notdir /usr/src/aubit/aubit4glsrc/tools/metrics_4gl/4GL_metrics.cgi) $(notdir /usr/src/aubit/aubit4glsrc/tools/cygwin/run.exe) \
	odbctest-iodbc2${EXE} odbctest-iodbc3${EXE} odbctest-unixODBC${EXE}

## ==================================================================
##                    To lib directory
## ==================================================================

#Only DLL we will actually link against - everything else is loaded at run-time:
#LIB_EXPORTLIB 	+=libaubit4gl${SOEXP_EXT}
LIB_EXPORTLIB   =aubit4gl-1.2_33

#WARNING: Order here is important:
TMP_LIBFILES	=$(addsuffix ${SO_EXT_LINKABLE},${LIB_EXPORTLIB}) 
TMP_PLUGINFILES =$(addsuffix ${SO_EXT},LEX_EC LEX_C LEX_CS HELP_std A4GL_string channel A4GL_file A4GL_HTML A4GL_pick A4GL_roman errhook_sample barcode  EXREPORT_NOPDF RPC_NORPC FORM_NOFORM SQL_nosql MSG_NATIVE UI_CONSOLE UI_XML 		PACKER_PACKED PACKER_FORMXML PACKER_PERL PACKER_XML FORM_GENERIC DATA_report LEX_WRITE 		DATA_module DATA_struct_form PACKER_MEMPACKED SQL_FILESCHEMA 		SQLPARSE_NONE SQLPARSE_INFORMIX DATA_module_definition 		LOGREPPROC_TXT LOGREPPROC_CSV LOGREPPROC_HTML)
LIB_DEFAULT		=$(addprefix lib,${TMP_LIBFILES}) $(addprefix ${PLUGINDIR}/lib,${TMP_PLUGINFILES})

#ifneq "${COMSPEC}" ""
#	LIB_DEFAULT	+=$(addprefix lib,$(addsuffix ${SOEXP_EXT},${LIB_EXPORTLIB}))
#endif

#LIB_DEFAULT=HELP_std A4GL_string channel A4GL_file A4GL_HTML A4GL_pick A4GL_roman errhook_sample barcode  LEX_EC LEX_C LEX_CS
#LIB_SO		=${LIB_DEFAULT}

#not needed any more, as we version stap this file in configure.in
#LIB_SO		=$(addprefix ${LIB_DIR}/lib,$(addsuffix -${A4GL_VERSION_STRING}${SO_EXT_LINKABLE},${LIB_EXPORTLIB}))
LIB_SO		=$(addprefix ${LIB_DIR}/lib,$(addsuffix ${SO_EXT_LINKABLE},${LIB_EXPORTLIB}))
PLUGIN_SO	=$(addprefix ${PLUGINDIR}/lib,${TMP_PLUGINFILES})

#Lib files we build depending on available 3rd party support:
#did not work by passing this directly to notdir:

TMP_RPMFILES=$(addprefix ${PLUGINDIR}/lib, LEX_PERL UI_HL_TUIN UI_HL_TUIw UI_HL_TUINs UI_HL_TUIws SQL_esql ESQL_INFORMIX SQL_odbc32 SQL_pg SQL_pg8 UI_HL_GTK LOGREP_CSV LOGREP_TXT LOGREP_HTML UI_GLADE A4GL_glade SQL_sqlite3  ESQL_POSTGRES  )
LIB_OPTIONAL=$(addsuffix ${SO_EXT},${TMP_RPMFILES})

LIB_FILES   		=${LIB_SO} 
#PLUGIN_FILES   		=${PLUGIN_SO} ${LIB_OPTIONAL}
PLUGIN_FILES   		=${notdir ${PLUGIN_SO} ${LIB_OPTIONAL}}

ifneq "${COMSPEC}" ""
	LIB_FILES 		+=$(addprefix ${LIB_DIR}/,lib4glc${SO_EXT}) \
					$(addprefix ${LIB_DIR}/lib,$(addsuffix ${SOEXP_EXT},${LIB_EXPORTLIB}))
	LIB_ALLWAYSCLEAN+=libUI_TUI.dll
endif

#Additional files to clean even if we would not install them under
#current configuration:
LIB_ALLWAYSCLEAN+=libA4GL_cint${SO_EXT}  libUI_GTK${SO_EXT} \
	 libSQL_esqlSAP${SO_EXT}

## ==================================================================
##                    To docs directory
## ==================================================================

DOC_FILES		=COPYING CREDITS LICENSE aubit4gl.ico aubit4gl.png README-Windows.txt

## ==================================================================
##                    To test directory
## ==================================================================

TEST_STD=testmenu.menu file.4gl form.per hello.4gl hello_db.4gl 		hello2.4gl helpfile.msg pdf_report.4gl test_build.4gl test_select.4gl 		testmenu.4gl assoc2.4gl testmpz.4gl make.bat Makefile
TEST_GUI=gui.per calc.per form-gui.per gui.4gl calc.4gl hello-gui.4gl 		multi.per radio.per widget.per Makefile
TEST_FILES=$(addprefix gui/,$(TEST_GUI)) $(TEST_STD)

## ==================================================================
##                    To etc directory
## ==================================================================

ETC_FILES       =gtkrc_2 odbc.ini.example Aubit4GL.jpg change.afr.dat options.afr.dat values.afr.dat  helpfile.hlp help_aubit.hlp helpsql_POSTGRES.hlp helpsql_POSTGRES8.hlp helpsql_SQLITE.hlp 4glpc.hlp

#This file is installed by copying etc/aubitrc.in to aubitrc-bin.in
#but we still need to de-install it:
ETC_DEINST      =aubitrc-bin.in

## ==================================================================
##                    To etc/convertsql directory
## ==================================================================

CONVSQL_FILES 	= INFORMIX-DB2.cnv INFORMIX-DB2VM.cnv INFORMIX-INFORMIX.cnv INFORMIX-INGRES.cnv INFORMIX-MYSQL.cnv INFORMIX-MYSQLDIRECT.cnv INFORMIX-ORACLE.cnv INFORMIX-POSTGRES.cnv INFORMIX-POSTGRES8.cnv INFORMIX-POSTGRESQL.cnv INFORMIX-SQLITE.cnv INFORMIX-SQLSERVER.cnv ORACLE-INFORMIX.cnv POSTGRESQL-INFORMIX.cnv README.txt
IMPORT_FILES 	=a4gl_file  a4gl_glade  a4gl_html  a4gl_pcre  a4gl_string  	default channel README

## ==================================================================
##                    To user's HOME directory
## ==================================================================

#Do not install this by default, it can confuse user not expecting anything
#to override the global aubitrc
#HOME_FILES		=etc/aubitrc


## ==================================================================
##                    To incl directory
## ==================================================================

AMAKE_INCL_FILES	=header.mki footer.mki footer2.mki footer-c.mki a4gl.mk 		q4gl.mk d4gl.mk i4gl.mk
INCL_HEADERS 		=a4gl_incl_4glhdr.h a4gl_incl_4gldef.h a4gl_4gl_callable.h a4gl_builtin_funcs.h a4gl_rep_structure.h a4gl_screenio.h         a4gl_exdata.h a4gl_API_exreport.h a4gl_API_form.h a4gl_API_help.h 		a4gl_API_menu.h a4gl_API_rpc.h a4gl_API_sql.h a4gl_API_ui.h a4gl_expr.h 		a4gl_API_sqlparse.h a4gl_API_esql.h a4gl_incl_infx.h 		a4gl_incl_config.h 		a4gl_esql.h a4gl_esql_infx.h a4gl_esql_postgres.h 		a4gl_esql_ingres.h 		a4gl_memhandling.h 		a4gl_esql_infoflex.h 
INCL_MAKE   		=Makefile-common Makefile-install.mki Makefile-common.in
INCL_FILES	=${INCL_MAKE} ${AMAKE_INCL_FILES} ${INCL_HEADERS} 
DATAIO_INCLFILES=report.xs.h npcode.xs.h form_x.xs.h fgl.xs.h

## ==================================================================
##                    To Aubit binary installation root directory
## ==================================================================

ROOT_FILES      =README.txt install.sh
ROOT_ALLWAYSCLEAN=libtool

## ==================================================================
##                    To ide directory
## ==================================================================

#FIXME: replace this with binary executables:
#IDE_files       =$(IDEDIR)/*.4gl $(IDEDIR)/*.c $(IDEDIR)/*.sh $(IDEDIR)/*.msg $(IDEDIR)/*.per $(IDEDIR)/Makefile

#IDE installs:
#/usr/local/bin/ide
#/usr/local/4glide/ide.4ae
#/usr/local/4glide/d4glinpt.afr d4glopts.afr
#/usr/local/4glide/d4glhelp.iem


## ==================================================================
##                    Derived files lists with paths
## ==================================================================

#installation files with paths:
TOBIN		=$(addprefix $(BIN_DIR)/,		$(BIN_FILES)) 
#TOLIB		=$(addprefix $(LIB_DIR)/,		$(LIB_FILES))
TOLIB		=$(LIB_FILES)
TOPLUGIN	=$(addprefix $(PLUGIN_DIR)/,	$(PLUGIN_FILES))
TODOCS		=$(addprefix $(DOC_DIR)/,		$(DOC_FILES))
TOTEST_STD  =$(addprefix $(TEST_DIR_STD)/,	$(TEST_STD))
TOTEST_GUI	=$(addprefix $(TEST_DIR_GUI)/,	$(TEST_GUI))
TOETC		=$(addprefix $(ETC_DIR)/,		$(ETC_FILES))
TOHOME		=$(addprefix $(HOME_DIR)/,		$(HOME_FILES))
TOROOT		=$(addprefix $(ROOT_DIR)/,		$(ROOT_FILES))
TOINCL		=$(addprefix $(INCL_DIR)/,		$(INCL_FILES))
TODATAIOINCL	=$(addprefix $(INCL_DIR)/dataio/,	$(DATAIO_INCLFILES))
TOIDE       =$(addprefix $(IDE_DIR)/,		$(IDE_FILES))
TOCONVSQL   =$(addprefix $(CONVSQL_DIR)/,	$(CONVSQL_FILES))
TOSETTINGS   =$(addprefix $(FGLPC_SETTINGS_DIR)/,	$(FGLPC_SETTINGS_FILES))
TOIMPORT	=$(addprefix $(IMPORT_DIR)/,	$(IMPORT_FILES))
AMAKE_TOBIN	=$(addprefix $(BIN_DIR)/,		$(AMAKE_BIN_FILES))
AMAKE_TOINCL=$(addprefix $(INCL_DIR)/,		$(AMAKE_INCL_FILES))

ifneq "${COMSPEC}" ""
	TOBIN	+=/usr/src/aubit/aubit4glsrc/tools/cygwin/run.exe
endif

TOBIN		+=/usr/src/aubit/aubit4glsrc/tools/metrics_4gl/4GL_metrics.cgi
TOBIN		+=$(BIN_PERL_MODULES)

#deinstallation files with paths:
FROMBIN		=$(addprefix $(BIN_DEST)/,	$(BIN_FILES)) \
			 $(addprefix $(BIN_DEST)/,	$(BIN_ALLWAYSCLEAN))
FROMLIB		=$(addprefix $(LIB_DEST)/,	$(LIB_FILES)) \
			 $(addprefix $(LIB_DEST)/,	$(LIB_ALLWAYSCLEAN))
FROMPLUGIN	=$(addprefix $(PLUGIN_DEST)/,$(PLUGIN_FILES))
FROMDOCS	=$(addprefix $(DOC_DEST)/,	$(DOC_FILES))
FROMTEST	=$(addprefix $(TEST_DEST)/,	$(TEST_FILES))
FROMETC		=$(addprefix $(ETC_DEST)/,	$(ETC_FILES)) \
			 $(addprefix $(ETC_DEST)/,	$(ETC_FILES_LEGACY)) \
			 $(addprefix $(ETC_DEST)/,	$(ETC_DEINST))
FROMHOME	=$(addprefix $(HOME_DEST)/,	$(HOME_FILES))
FROMROOT	=$(addprefix $(ROOT_DEST)/,	$(ROOT_FILES)) \
			 $(addprefix $(ROOT_DEST)/,	$(ROOT_ALLWAYSCLEAN))
FROMINCL	=$(addprefix $(INCL_DEST)/,	$(INCL_FILES)) \
			 $(addprefix $(INCL_DEST)/,	$(INCL_FILES_LEGACY))
FROMIDE     =$(addprefix $(IDE_DEST)/,	$(IDE_FILES))
FROMCONVSQL =$(addprefix $(CONVSQL_DEST)/,$(CONVSQL_FILES))
FROMSETTINGS=$(addprefix $(FGLPC_SETTINGS_DEST)/,	$(FGLPC_SETTINGS_FILES))
FROMIMPORT 	=$(addprefix $(IMPORT_DEST)/,$(IMPORT_FILES))

## ==================================================================
##                    Automatic build Settings
## ==================================================================

AUBITCVSSFNAME		=${AUBITNAME}src
NAMEVERBLD			=${AUBITCVSSFNAME}-${AUBITVERSION}-${AUBITBUILD}
PLATFORMINFO		=${NAMEVERBLD}.txt
SOURCETARBASENAME	=${NAMEVERBLD}.${ARCHEXT}
BINTARBASENAME      =${AUBITNAME}bin-${TARGET}-${AUBITVERSION}-${AUBITBUILD}.${ARCHEXT}
SOURCETARNAME		=$(SOURCE)/$(SOURCETARBASENAME)

#Path under your web server HTDOCS dir, where to put Doxy generated files:
DOXY_WWWPATH        =projects/Aubit4GL/doxy


## ==================================================================
##                    Third-party products installation settings
## ==================================================================

WGET				=/usr/bin/wget
RPM					=no
TIME                =$(shell date +%H-%M-%S)
#This one on SF will not work, because it used cookies to redirect:
#RH_RPM_PATH		=http://umn.dl.sourceforge.net/mirrors/redhat/redhat/redhat-7.3-en/os/i386/RedHat/RPMS
#This one had time out problems:
#250 Directory successfully changed.
#--> PORT 192,168,1,69,4,103
#421 Timeout. Pay attention.
#Invalid PORT.
#Retrying.
#
#RH_RPM_PATH         =ftp://rpmfind.net/linux/redhat/7.3/en/os/i386/RedHat/RPMS

RH_RPM_VER			=

RH_RPM_PATH			=ftp://ftp.redhat.com/pub/redhat/linux/${RH_RPM_VER}/en/os/i386/RedHat/RPMS

#List of all missing options as make targets to be installed, as determined
#by autoconf:
INSTALL_MISSING_OPTIONAL = install.pdflib install.ingres install.mysql.client install.xmlrpc install.cint install.mpz install.iksemel install.libspopc install.libsmtp install.pcre install.sxml install.dot
A4GL_LOCALOUTPUT=N
export A4GL_LOCALOUTPUT

export CFLAGS
CFLAGS_NOWARN   =$(subst ${CWARN},,${CFLAGS})
#=================================== EOF ================================

