OpenVMS Source Code Demos

mysql_demo1x

$!==============================================================================
$! title    : mysql_demo1x.com (build script for mysql demo c programs 10-19)
$!          : which are called from VMS-BASIC)
$! author   : Neil Rieck (https://neilrieck.net)
$!	    : Waterloo, Ontario, Canada.
$! platforms: variation-1 (2014) -----------------------------------------------
$!		MariaDB-5.5-25 on OpenVMS-8.4
$!		a) requires an up-to-date version of zlib (1.2.6 or higher)
$!		     http://fafner.dyndns.org/~alexey/libsdl/ZLIB-1_2_7.ZIP
$!		b) links to LIBYASSL.OLB (yet-another-ssl which was provided)
$!	    : variation-2 (2017) -----------------------------------------------
$!		MariaDB-5.5-57 and MariaDB-5.5-58
$!		a) links to LIBZ.OLB (provided)
$!		b) links to sys$share:SSL$LIBSSL_SHR32.EXE	-or-
$!		c) links to sys$share:SSL1$LIBSSL_SHR32.EXE	-or-
$!		d) links to SSL_LIBSSL32.OLB (provided)
$! notes    : 1) MariaDB is an alternate fork of MySQL
$!	      2) your OpenVMS system will have one of three TCPIP stacks
$!		 (MultiNet, TCPIP Services, TCPware) which place different
$!		 include files in sys$library. The cleanest compile comes
$!		 from MultiNet
$!	      3) Linking 5.5-25 is noisy on Alpha but not Itanium
$! when     who what
$! 20140120 NSR build script for my MariaDB-5.5-25 demo programs (Alpha only)
$! 20170419 NSR added additional support for Itanium
$! 20171031 NSR added support for MariaDB-5.5-57 and MariaDB-5.5-58
$!==============================================================================
$	on error then goto fini					!
$	set on							!
$	say	:== write sys$output				!
$	ask	:== inquire/nopunct				!
$	say	"==============================================="
$	say	"-i-script:",f$environment("procedure")
$	dir	/nohead/notrail/width=file=60 mysql_demo1*.bas
$	ask choice "desired demo number? "
$	if (choice .eqs. "") then goto FINI
$	pgm1	= "MYSQL_DEMO"		+ choice		! .bas
$	pgm2	= "MYSQL_API_DEMO"	+ choice		! .c
$	say	""
$	say	"-i-script:",f$environment("procedure")		!
$	say	"   (a build program for MySQL/MariaDB clients on OpenVMS)"
$	arch	= f$getsyi("ARCH_NAME")				!
$	path	= f$trnlnm("mysql055_root")			! eg. KAWC90$DKB1:[MYSQL055.]
$	path	= path - "]"					!
$	path	= path + "lib."'arch'"]"			! eg. KAWC09$DKB1:[MYSQL055.lib.ia64]
$!
$!	create a logical because LINK "sys$input/opt" does not support DCL symbol substitution
$!
$	def/process	logical_path  'path'			!
$!
$	say "-i-BASIC compiling: ",pgm1
$bas	'pgm1'.bas
$	say "-i-C compiling: ",pgm2
$cc	'pgm2'.c/float=ieee				-
		/ieee=denorm				-
		/name=(as_is,shorten)			-
		/include=mysql055_root:[include.mysql]
$	set noon
$	say "-i-linking ",pgm1," and ",pgm2
$	wait 0:0:01
$	junk = f$search(path +"SSL_LIBSSL32.OLB")
$	if (junk.eqs."")
$	then
$		variation = 2014
$		say "-i-did not detect: SSL_LIBSSL32.OLB"
$	else
$		variation = 2017
$		say "-i-detected: SSL_LIBSSL32.OLB"
$	endif
$	say "-i-linking ",pgm1," and ",pgm2," using variation ",variation
$	wait 0:0:01
$ if variation.eq.2014					! 5.5-25
$ then
$	link	'pgm1'.obj,'pgm2'.obj	,	-
		sys$input/opt
		logical_path:libclientlib.olb/library
		logical_path:libdbug.olb/library
                logical_path:libmysys.olb/library
                logical_path:libsql.olb/library
                logical_path:libstrings.olb/library
                logical_path:libvio.olb/library
                logical_path:libyassl.olb/library
                sys$share:LIBZSHR.EXE/share
$	savedstatus = $status
$ endif
$ if variation.eq.2017					! 57 + 58
$ then
$    ask junk "linker recipe? (1-3, 0=auto) "		!
$    recipe = 0						!
$    recipe = f$integer(junk)				!
$    if (recipe.lt.0).or.(recipe.gt.3) then recipe = 0	!
$    if (recipe.ne.0) then goto have_recipe		!
$    recipe = 1						! default
$    if f$search("sys$share:SSL$LIBSSL_SHR32.EXE")  .nes."" then recipe = 2
$    if f$search("sys$share:SSL1$LIBSSL_SHR32.EXE") .nes."" then recipe = 3
$have_recipe:
$    say "-i-linking via recipe: ",recipe
$    wait 0:0:01
$    if (recipe.eq.1)
$    then
$	link	'pgm1'.obj/selective	-
		/NOinformationals	-
		, sys$input/opt
		logical_path:libclientlib.olb/library
		logical_path:libdbug.olb/library
                logical_path:libmysys.olb/library
                logical_path:libsql.olb/library
                logical_path:libstrings.olb/library
                logical_path:libvio.olb/library
                logical_path:SSL_LIBSSL32.OLB/library
                logical_path:SSL_LIBCRYPTO32.OLB/library
                logical_path:LIBZ.OLB/library
$	savedstatus = $status
$    endif
$    if recipe.eq.2
$    then
$	link	'pgm1'.obj/selective	-
		/NOinformationals 	-
		, sys$input/opt
		logical_path:libclientlib.olb/library
		logical_path:libdbug.olb/library
                logical_path:libmysys.olb/library
                logical_path:libsql.olb/library
                logical_path:libstrings.olb/library
                logical_path:libvio.olb/library
                sys$share:SSL1$LIBSSL_SHR32.EXE/share
		sys$share:SSL1$LIBCRYPTO_SHR32.EXE/share
                logical_path:LIBZ.OLB/library
$	savedstatus = $status
$    endif
$    if recipe.eq.3
$    then
$	link	'pgm1'.obj/selective	-
		/NOinformationals	-
		, sys$input/opt
		logical_path:libclientlib.olb/library
		logical_path:libdbug.olb/library
                logical_path:libmysys.olb/library
                logical_path:libsql.olb/library
                logical_path:libstrings.olb/library
                logical_path:libvio.olb/library
                sys$share:SSL$LIBSSL_SHR32.EXE/share
		sys$share:SSL$LIBCRYPTO_SHR32.EXE/share
                sys$share:LIBZSHR.EXE/share
$	savedstatus = $status
$     endif
$ endif
$	say "-i-linking without MMK is sometimes noisy so here is a summary:"
$	say "-i-exit status: ",savedstatus
$	if ((savedstatus .and. 1).eq.0) then say "-i-there were LINKER warnings"
$	if ((savedstatus .and. 2).eq.2) then say "-i-there were LINKER errors"
$	if ((savedstatus .and. 4).eq.4) then say "-i-there were LINKER fatals"
$	if ((savedstatus .and. 6).ne.6)
$	then
$		say "-i-there were NO LINKER errors"
$		say "-i-look what I built:"
$		say "==============================================================="
$		dir/col=1/date/width=file=50/nohead/notrail/since="-0 0:0:15" 'pgm'*.exe;
$		say "==============================================================="
$	endif
$fini:
$	set noon
$	if (f$length(f$trnlnm("logical_path")).gt.0) then deas/process logical_path
$	say "-i-exiting script"
$	exit

home Back to Home
Neil Rieck
Waterloo, Ontario, Canada.