#!/bin/csh
###########################################################################
#	Zinc Application Framework - mconfig
#	COPYRIGHT (C) 1996-1998.  All Rights Reserved.
#	Zinc Software Incorporated.  Pleasant Grove, Utah  USA
###########################################################################

# This is a C Shell script file.  If you are having problems running this
# script, make sure you have the file /bin/csh (see install).

# Abort if run from the wrong directory
if (! -e source && ! -e include) then
	echo "mconfig can only be run from the root of the Zinc directory tree."
	goto abort
endif

# Set variables if specified on command line (skip interactive prompts)
set system = $1
set compiler = $2
set library = $3
set change_options = $4

# Determine system type (may have been set by calling process).
if (! $?os_name || ! $?os_version) then
	setenv os_name `/bin/uname`
	setenv os_version `/bin/uname -r`
endif

# Define options to handle portability difference
alias e echo
alias E 'echo -n'
alias blank 'echo " "'
set et = ''
set input_style = new

# Platform differences
# SCO: csh's internal echo command can't handle -n or \c; can't handle $< input.
# SunOS 4's internal and external echos can't handle \c.
# Linux doesn't support older `line` input
if ($os_name == 'SCO_SV') then
	# SCO Open Server
	alias E '/bin/echo -n'
	set input_style = old
endif	

############################################################################
#   Change mode on executable files.
############################################################################

change_mode:

if (-e bin/suffixes) chmod 0777 bin/suffixes
if (-e xpm/fixcaps) then
	chmod 0777 xpm/fixcaps
	cd xpm
	./fixcaps
	cd ..
endif
# AIX4
if (-e bin/aix4/mdes) chmod 0777 bin/aix4/mdes
if (-e bin/aix4/umdes) chmod 0777 bin/aix4/umdes
if (-e bin/aix4/zdecrypt) chmod 0777 bin/aix4/zdecrypt
if (-e bin/aix4 && -e bin/zdesign.znc) cp bin/zdesign.znc bin/aix4/zdesign.znc
if (-e bin/aix4 && -e bin/i18n.znc) cp bin/i18n.znc bin/aix4/i18n.znc
# HPUX9
if (-e bin/hpux9/mdes) chmod 0777 bin/hpux9/mdes
if (-e bin/hpux9/zdecrypt) chmod 0777 bin/hpux9/zdecrypt
if (-e bin/hpux9 && -e bin/zdesign.znc) cp bin/zdesign.znc bin/hpux9/zdesign.znc
if (-e bin/hpux9 && -e bin/i18n.znc) cp bin/i18n.znc bin/hpux9/i18n.znc
# HPUX10
if (-e bin/hpux10/mdes) chmod 0777 bin/hpux10/mdes
if (-e bin/hpux10/zdecrypt) chmod 0777 bin/hpux10/zdecrypt
if (-e bin/hpux10 && -e bin/zdesign.znc) cp bin/zdesign.znc bin/hpux10/zdesign.znc
if (-e bin/hpux10 && -e bin/i18n.znc) cp bin/i18n.znc bin/hpux10/i18n.znc
# IRIX6
if (-e bin/irix6/mdes) chmod 0777 bin/irix6/mdes
if (-e bin/irix6/zdecrypt) chmod 0777 bin/irix6/zdecrypt
if (-e bin/irix6 && -e bin/zdesign.znc) cp bin/zdesign.znc bin/irix6/zdesign.znc
if (-e bin/irix6 && -e bin/i18n.znc) cp bin/i18n.znc bin/irix6/i18n.znc
# LINUX2.0.30
if (-e bin/lnux2030/mdes) chmod 0777 bin/lnux2030/mdes
if (-e bin/lnux2030/zdecrypt) chmod 0777 bin/lnux2030/zdecrypt
if (-e bin/lnux2030 && -e bin/zdesign.znc) cp bin/zdesign.znc bin/lnux2030/zdesign.znc
if (-e bin/lnux2030 && -e bin/i18n.znc) cp bin/i18n.znc bin/lnux2030/i18n.znc
# LINUX2.0.31
if (-e bin/lnux2031/mdes) chmod 0777 bin/lnux2031/mdes
if (-e bin/lnux2031/zdecrypt) chmod 0777 bin/lnux2031/zdecrypt
if (-e bin/lnux2031 && -e bin/zdesign.znc) cp bin/zdesign.znc bin/lnux2031/zdesign.znc
if (-e bin/lnux2031 && -e bin/i18n.znc) cp bin/i18n.znc bin/lnux2031/i18n.znc
# OSF1
if (-e bin/osf1/mdes) chmod 0777 bin/osf1/mdes
if (-e bin/osf1/umdes) chmod 0777 bin/osf1/umdes
if (-e bin/osf1/zdecrypt) chmod 0777 bin/osf1/zdecrypt
if (-e bin/osf1 && -e bin/zdesign.znc) cp bin/zdesign.znc bin/osf1/zdesign.znc
if (-e bin/osf1 && -e bin/i18n.znc) cp bin/i18n.znc bin/osf1/i18n.znc
# SCO
if (-e bin/sco/mdes) chmod 0777 bin/sco/mdes
if (-e bin/sco/zdecrypt) chmod 0777 bin/sco/zdecrypt
if (-e bin/sco && -e bin/zdesign.znc) cp bin/zdesign.znc bin/sco/zdesign.znc
if (-e bin/sco && -e bin/i18n.znc) cp bin/i18n.znc bin/sco/i18n.znc
# SUN4
if (-e bin/sun4/mdes) chmod 0777 bin/sun4/mdes
if (-e bin/sun4/umdes) chmod 0777 bin/sun4/umdes
if (-e bin/sun4/zdecrypt) chmod 0777 bin/sun4/zdecrypt
if (-e bin/sun4 && -e bin/zdesign.znc) cp bin/zdesign.znc bin/sun4/zdesign.znc
if (-e bin/sun4 && -e bin/i18n.znc) cp bin/i18n.znc bin/sun4/i18n.znc
# SUN5
if (-e bin/sun5/mdes) chmod 0777 bin/sun5/mdes
if (-e bin/sun5/umdes) chmod 0777 bin/sun5/umdes
if (-e bin/sun5/zdecrypt) chmod 0777 bin/sun5/zdecrypt
if (-e bin/sun5 && -e bin/zdesign.znc) cp bin/zdesign.znc bin/sun5/zdesign.znc
if (-e bin/sun5 && -e bin/i18n.znc) cp bin/i18n.znc bin/sun5/i18n.znc

###########################################################################
#	Determine which system.
###########################################################################

choose_system:
if ($system != "") goto choose_compiler

clear
e "Which system are you installing to:"
blank
e " 1)  Digital UNIX 4.0"
e " 2)  Hewlett Packard HP-UX 9.0"
e " 3)  Hewlett Packard HP-UX 10.20"
e " 4)  IBM RS/6000 AIX 4.3"
e " 5)  Linux release 2.0.30 / GCC 2.7.2.1"
e " 6)  Linux release 2.0.31 / GCC 2.7.2.3"
e " 7)  SCO UNIX"
e " 8)  SGI IRIX 6.2"
e " 9)  Sun Solaris 2.X"
e " 10)  SunOS 4.1.3"
e " 11)  None of the above"
blank

choose_system_again:
E "[1..10, q = quit]: "$et
if ($input_style == "new") then
	set tmp = $<
else
	set tmp = `line`
endif

switch ($tmp)
	case 1:
	case osf1:
		set system = osf1
		set compiler = gnu
		breaksw

	case 2:
	case hpux9:
		set system = hpux9
		breaksw
	
	case 3:	
	case hpux10:
		set system = hpux10
		breaksw
	
	case 4:
	case aix4:
		set system = aix4
		set library = archive
		breaksw

	case 5:
	case linux4:
		set system = linux4
		set compiler = gnu
		breaksw

	case 6:
	case linux5:
		set system = linux5
		set compiler = gnu
		breaksw

	case 7:
	case sco:
		set system = sco
		set compiler = gnu
		set library = archive
		breaksw

	case 8:
	case irix6:
		set system = irix6
		breaksw

	case 9:
	case sun5:
		set system = sun5
		breaksw

	case 10:
	case sun4:
		set system = sun4
		breaksw

	case 11:
		set system = none
		breaksw

	case q:
		goto abort

	default:
		# e "Invalid entry please choose again"
		# blank  
		goto choose_system_again
endsw

###########################################################################
#	Determine which compiler type.
###########################################################################

choose_compiler:
if ($compiler != "") goto choose_library

clear
e "Are you using the system's native compiler or gnu?"
blank
e " 1)  native"
e " 2)  gnu"
blank

choose_compiler_again:
E "[1..2, q = quit, return = native]: "$et
if ($input_style == "new") then
	set tmp = $<
else
	set tmp = `line`
endif

switch ($tmp)
	case 1:
	case "":
	case native:
		set compiler = native
		breaksw

	case 2:
	case gnu:
		set compiler = gnu
		breaksw

	case q:
		goto abort

	default:
		# e "Invalid entry please choose again"
		# blank
		goto choose_compiler_again
endsw

###########################################################################
#	Determine which library type.
###########################################################################

choose_library:
if ($library != "") goto macro_initialization

clear
e "What type of library would you like to make:"
blank
e " 1)  archive"
e " 2)  shared"
blank

choose_library_again:
E "[1..2, q = quit, return = archive ]: "$et
if ($input_style == "new") then
	set tmp = $<
else
	set tmp = `line`
endif

switch ($tmp)
	case 1:
	case "":
	case archive:
		set library = archive
		breaksw

	case 2:
	case shared:
		set library = shared
		breaksw

	case q:
		goto abort

	default:
		# e "Invalid entry please choose again"
		# blank
		goto choose_library_again
endsw

###########################################################################
#   Make macro initialization.
###########################################################################

macro_initialization:

set CC            		= 1
set LINK          		= 2
set CC_FLAGS      		= 3
set LINK_FLAGS    		= 4
set CPP_EXTENSION 		= 5
set LIB_EXTENSION		= 6
set INCLUDE_DIRS  		= 7
set LIB_DIRS      		= 8
set GUI_LIBS      		= 9
set LIBS          		= 10
set LIBRARIAN     		= 11
set AR_FLAGS      		= 12
set RANLIB        		= 13
set SHARED_LINK    		= 14
set SHARED_LINK_FLAGS		= 15
set SHARED_LIB_EXTENSION	= 16


if ($library == shared) then
	set last_user_variable = 16
else
	set last_user_variable = 13
endif

set variables =\
(\
	CC\
	LINK\
	CC_FLAGS\
	LINK_FLAGS\
	CPP_EXTENSION\
	LIB_EXTENSION\
	INCLUDE_DIRS\
	LIB_DIRS\
	GUI_LIBS\
	LIBS\
	LIBRARIAN\
	AR_FLAGS\
	RANLIB\
	SHARED_LINK\
	SHARED_LINK_FLAGS\
	SHARED_LIB_EXTENSION\
)

set meanings =\
(\
	"Compiler name"\
	"Linker name"\
	"Compiler options"\
	"Linker options"\
	"File extension"\
	"Library extension"\
	"Include search paths"\
	"Library search paths"\
	"Graphical libraries"\
	"Other libraries"\
	"Archiver/librarian name"\
	"Archiver/librarian options"\
	"Ranlib command"\
	"Shared linker name"\
	"Shared link options"\
	"Shared library extension"\
)

###########################################################################
#	Initialize macro values for Motif systems.
###########################################################################

switch ($system)

#	----- Digital UNIX 3.2 -----
	case osf1:
		set values =\
		(\
			"cxx"\
			"cxx"\
			""\
			"-s"\
			".cxx"\
			".a"\
			""\
			""\
			"-lXpm -lXm -lXt -lX11"\
			"-ldnet_stub -lm"\
			"ar"\
			"r"\
			""\
			"ld"\
			"-shared -G 0"\
			".so"\
		)
		if ($library == shared) then
			set values[$LINK_FLAGS] = "-s -call_shared"
			set values[$LIB_EXTENSION] = ".so"
		endif
		if ($compiler == gnu) then
			set values[$CC] = "g++"
			set values[$LINK] = "g++"
			set values[$SHARED_LINK] = "ld"
			set values[$SHARED_LINK_FLAGS] = "-fPIC -shared -G 0"
			if ($library == shared) then
				set values[$CC_FLAGS] = "-Wall -fPIC"
			else
				set values[$CC_FLAGS] = "-Wall"
			endif
		endif
		breaksw

#	----- Hewlett Packard HP-UX 9.0 and 10 -----
	case hpux9:
	case hpux10:
		set values = \
		(\
			"CC"\
			"CC"\
			""\
			"-s"\
			".cpp"\
			".a"\
			""\
			"-L/usr/lib/Motif1.2 -L/usr/lib/X11R5"\
			"-lXpm -lXm -lXt -lX11"\
			"-lm"\
			"ar"\
			"r"\
			""\
			"CC"\
			"-b"\
			".sl"\
		)
		if ($library == shared) then
			set values[$CC_FLAGS] = "+z"
			set values[$LINK_FLAGS] = "-s -Wl,+s"
			set values[$LIB_EXTENSION] = ".sl"
		endif
		if ($system == hpux10) then
			set values[$LIB_DIRS] = "-L/usr/lib/Motif1.2 -L/usr/lib/X11R6"
		endif
		if ($compiler == gnu) then
			set values[$CC] = "g++"
			set values[$LINK] = "g++"
			set values[$SHARED_LINK] = "g++"
			set values[$LINK_FLAGS] = ""
			set values[$SHARED_LINK_FLAGS] = "-fPIC -shared"
			if ($library == shared) then
				set values[$CC_FLAGS] = "-Wall -fPIC"
			else
				set values[$CC_FLAGS] = "-Wall"
			endif
		endif
		breaksw
	
#	----- IBM RS/6000 AIX 4.1 -----
	case aix4:
		set values =\
		(\
			"xlC"\
			"xlC"\
			"-D_IBM_RS6000"\
			""\
			".C"\
			".a"\
			""\
			""\
			"-lXpm -lXm -lXt -lX11"\
			"-lm"\
			"ar"\
			"r"\
			""\
			"xlC"\
			""\
			".so"\
		)
		if ($library == shared) then
			set values[$LIB_EXTENSION] = ".so"
		endif
		if ($compiler == gnu) then
			set values[$CC] = "g++"
			set values[$LINK] = "g++"
			set values[$SHARED_LINK] = "g++"
			if ($library == shared) then
				set values[$CC_FLAGS] = "-Wall -fPIC -D_IBM_RS6000"
			else
				set values[$CC_FLAGS] = "-Wall -D_IBM_RS6000"
			endif
		endif
		breaksw
		
#	----- Red Hat Linux  -----
	case linux4:
	case linux5:
		set values =\
		(\
			"g++"				\
			"g++"				\
			"-Wall"				\
			""				\
			".cpp"				\
			".a"				\
			"-I/usr/X11R6/include"		\
			"-L/usr/X11R6/lib"		\
			"-lXpm -lXm -lXt -lXext -lX11"	\
			"-lm"				\
			"ar"				\
			"r"				\
			""				\
			"g++"				\
			"-shared"			\
			".so"				\
		)
		if (-e /usr/X11R6/lib/libXp.so) then
			set values[$GUI_LIBS] = "-lXpm -lXm -lXp -lXt -lXext -lX11"
		endif
		if ($system == linux5 && $library != shared) then
			set values[$CC_FLAGS] = "-Wall -DGCC_2_7_2_3"
		else if ($system == linux5 && $library == shared) then
			set values[$CC_FLAGS] = "-Wall -fPIC -DGCC_2_7_2_3"
			set values[$LIB_EXTENSION] = ".so"
			set values[$LINK_FLAGS] = ""
		else if ($library == shared) then
			set values[$CC_FLAGS] = "-Wall -fPIC"
			set values[$LIB_EXTENSION] = ".so"
			set values[$LINK_FLAGS] = ""
		endif
		breaksw
		
#	----- SCO UNIX 3.2 -----
	case sco:
		set values =\
		(\
			"CC"\
			"CC"\
			"-DSCO_UNIX"\
			"-s"\
			".C"\
			".a"\
			""\
			""\
			"-lXpm -lXm -lXt -lX11"\
			"-lsocket -lintl -lm"\
			"ar"\
			"r"\
			""\
			"CC"\
			"-shared"\
			".so"\
		)
		if ($library == shared) then
			set values[$LIB_EXTENSION] = ".so"
			set values[$LINK_FLAGS] = ""
		endif
		if ($compiler == gnu) then
			set values[$CC] = "g++"
			set values[$LINK] = "g++"
			set values[$SHARED_LINK] = "g++"
			set values[$CC_FLAGS] = "-Wall -DSCO_UNIX"
		endif
		breaksw

#	----- SGI IRIX 6.2 -----
	case irix6:
		set values =\
		(\
			"CC"\
			"CC"\
			""\
			""\
			".cc"\
			".a"\
			""\
			""\
			"-lXpm -lXm -lXt -lX11"\
			"-lm"\
			"ar"\
			"r"\
			""\
			"CC"\
			"-shared"\
			".so"\
		)
		if ($library == shared) then
			set values[$LINK_FLAGS] = "-call_shared"
			set values[$LIB_EXTENSION] = ".so"
		endif
		if ($compiler == gnu) then
			set values[$CC] = "g++"
			set values[$LINK] = "g++"
			set values[$SHARED_LINK] = "g++"
			if ($library == shared) then
				set values[$CC_FLAGS] = "-Wall -fPIC"
			else
				set values[$CC_FLAGS] = "-Wall"
			endif
		endif
		breaksw

#	----- Siemens/Nixdorf SINIX -----
#	Not tested for ZAF 5
	case sinix:
		set values =\
		(\
			"CC"\
			"CC"\
			"-D_SINIX"\
			"-s"\
			".C"\
			".a"\
			""\
			""\
			"-lXpm -lXm -lXt -lX11"\
			"-lnsl -lgen -lm"\
			"ar"\
			"r"\
			""\
			"CC"\
			"-shared"\
			".so"\
		)
		if ($library == shared) then
			set values[$LIB_EXTENSION] = ".so"
		endif
		breaksw
		
#	----- Sun Solaris 2.X -----
	case sun5:
		set values =\
		(\
			"CC"\
			"CC"\
			""\
			"-s -R/usr/dt/lib"\
			".cc"\
			".a"\
			"-I/usr/openwin/include -I/usr/dt/include"\
			"-L/usr/openwin/lib -L/usr/dt/lib"\
			"-lXpm -lXm -lXt -lX11"\
			"-lsocket -lgen -lnsl -lm"\
			"ar"\
			"r"\
			""\
			"CC"\
			"-G"\
			".so"\
		)
		if ($library == shared) then
			set values[$CC_FLAGS] = "-PIC"
			set values[$LINK_FLAGS] = "-s"
			set values[$LIB_EXTENSION] = ".so"
		endif
		if ($compiler == gnu) then
			set values[$CC] = "g++"
			set values[$LINK] = "g++"
			set values[$LINK_FLAGS] = ""
			set values[$SHARED_LINK] = "g++"
			set values[$SHARED_LINK_FLAGS] = "-fPIC -shared"
			if ($library == shared) then
				set values[$CC_FLAGS] = "-Wall -fPIC"
			else
				set values[$CC_FLAGS] = "-Wall"
			endif
		endif
		breaksw

#	----- Sun Solaris X86 -----
#	Not tested for ZAF 5
	case x86:
		set values =\
		(\
			"CC"\
			"CC"\
			""\
			"-s"\
			".cc"\
			".a"\
			"-I/usr/openwin/include -I/usr/dt/include"\
			"-L/usr/openwin/lib -L/usr/dt/lib"\
			"-lXpm -lXm -lXt -lX11"\
			"-lsocket -lgen -lnsl -lm"\
			"ar"\
			"r"\
			""\
			"CC"\
			"-G"\
			".so"\
		)
		if ($library == shared) then
			set values[$CC_FLAGS] = "-PIC"
			set values[$LIB_EXTENSION] = ".so"
		endif
		breaksw
	
#	----- SunOS 4.1.3 -----
	case sun4:
		set values =\
		(\
			"CC"\
			"CC"\
			"-D_SUNOS4"\
			"-s"\
			".cc"\
			".a"\
			"-I/opt/IXImd12x/include -I/usr/openwin/include"\
			"-L/opt/IXImd12x/lib -L/usr/openwin/lib"\
			"-lXpm -lXm -lXt -lX11"\
			"-lm"\
			"ar"\
			"r"\
			'/bin/ranlib $@'\
			"CC"\
			"-G"\
			".so"\
		)
		if ($library == shared) then
			set values[$CC_FLAGS] = "-D_SUNOS4  -PIC"
			set values[$LIB_EXTENSION] = ".so"
		endif
		if ($compiler == gnu) then
			set values[$CC] = "g++"
			set values[$LINK] = "g++"
			set values[$SHARED_LINK] = "g++"
			set values[$SHARED_LINK_FLAGS] = "-fPIC -shared"
			if ($library == shared) then
				set values[$CC_FLAGS] = "-D_SUNOS4 -Wall -fPIC"
			else
				set values[$CC_FLAGS] = "-D_SUNOS4 -Wall"
			endif
		endif
		breaksw

	default:
		set values =\
		(\
			"CC"\
			"CC"\
			""\
			""\
			".cpp"\
			".a"\
			""\
			""\
			"-lXpm -lXm -lXt -lX11"\
			"-lm"\
			"ar"\
			"r"\
			""\
			"CC"\
			"-shared"\
			".so"\
		)

		if ($system != none) then
			e "Unknown system type: '$system'."
			E "Continue [q = quit, return = continue]: "$et
			if ($input_style == "new") then
				set tmp = $<
			else
				set tmp = `line`
			endif
			if ($tmp == "q") goto abort
		endif
		blank
endsw

###########################################################################
#	Interactivly display values and maybe let them change them.
###########################################################################

display_variables:
if ($change_options == "n") goto done_assigning

clear
e "Are the following options correct?"
blank
@ i = 1
while ( $i <= $last_user_variable )
	e " " $meanings[$i]":" $values[$i]
	@ i++
end
blank
E "[y, n, q, return = y]: "$et
if ($input_style == "new") then
	set tmp = $<
else
	set tmp = `line`
endif

if ("$tmp" == q) goto abort
if ("$tmp" != n) goto done_assigning

###########################################################################
#	Show each variable, and let the user change it.
###########################################################################

clear
e "Modify the following options:"
blank
@ i = 1
while ($i <= $last_user_variable)
	E "  "$meanings[$i]" "$et
	if ("$values[$i]" == "") then
		E \(none\)$et
	else
		E \($values[$i]\)$et
	endif
	E ": "$et
	if ($input_style == "new") then
		if ($os_name == 'Linux') then
			set tmp = $<:q
		else
			set tmp = $<
		endif
	else
		set tmp = `line`
	endif
	if ("$tmp" == q) goto abort
	if ("$tmp" != "") then
		set values[$i]="$tmp"
		if ($i == $LIB_EXTENSION && $library == shared) then
			set values[$SHARED_LIB_EXTENSION]="$tmp"
		endif
	endif
	@ i++
end
goto display_variables

###########################################################################
#	Create an awk program file to perform the changes.
###########################################################################

done_assigning:

set tmpawkfile=/tmp/tmpAwkFile.$$
set newline="\n"
echo "{ matched = 0 }" > $tmpawkfile
@ i = 1
while ( $i <= $#meanings )
	echo \$1 == \"$variables[$i]\" \{ printf \"%s = %s\", \$1, \"$values[$i]\" \; matched = 1 \; print \"\" \} >> $tmpawkfile
	@ i++
end

echo "matched == 0 { print }" >> $tmpawkfile

###########################################################################
#	Run awk program to edit each Makefile in the current tree.
###########################################################################

blank
e "Configuring makefiles..."
set tmpmakefile=/tmp/tmpmakefile.$$
if (-e /bin/nawk) then
	set awk=/bin/nawk
else
	set awk=awk
endif

set startdir = `pwd`
foreach i (`find $startdir -name posix.mak -print`)
	cd $i:h
	$awk -f $tmpawkfile posix.mak > $tmpmakefile
	mv $tmpmakefile Makefile
end
cd $startdir
rm -f $tmpawkfile

###########################################################################
#	Decrypt the ?_env.hpp files
###########################################################################

if ($system == linux4) then
	set system = lnux2030	
else if ($system == linux5) then
	set system = lnux2031
endif


if (-e ./bin/$system/zdecrypt) then
	cd include
	../bin/$system/zdecrypt z_env.hzz z_env.hpp
	../bin/$system/zdecrypt m_env.hzz m_env.hpp
	cd ..
endif


###########################################################################
#	Change source file suffixes
###########################################################################
if (-x ./bin/suffixes && $values[$CPP_EXTENSION] != ".cpp") then
	if (-x /bin/tr || -x /usr/bin/tr) then
		# Strip the '.' from the extension.
		set ext=`echo $values[$CPP_EXTENSION] | tr "." " "`
		e "Checking and changing source file extensions..."
		./bin/suffixes cpp $ext > /dev/null
	else
		e "Unable to change source file extensions.  Please run \'suffixes\'."
	endif
endif


###########################################################################
#	Finish up
###########################################################################
if (! -e lib) then
	mkdir lib
endif

#e Creating soft link to mdesign...
#cd bin
#ln -s $system/mdesign mdesign
#cd ..

exit_point:
e "ZAF configuration is complete."
blank
exit (0)

abort:
e "Aborting the ZAF installation program."
exit (1)

