diff options
author | Patrick Monnerat <pm@datasphere.ch> | 2015-04-17 17:09:13 +0200 |
---|---|---|
committer | Daniel Veillard <veillard@redhat.com> | 2016-05-01 18:32:20 +0800 |
commit | 1463a91df53b46accd0cc6a544132bc0f3bea9dc (patch) | |
tree | eeadefabe22c5a3c67f8fa073f0a885977ddf403 /os400/initscript.sh | |
parent | 11e805d39701513f7fdb3b692beb7c493a498a97 (diff) | |
download | libxml2-1463a91df53b46accd0cc6a544132bc0f3bea9dc.tar.gz |
os400: initscript make_module(): Use options instead of positional parameters.
Diffstat (limited to 'os400/initscript.sh')
-rw-r--r-- | os400/initscript.sh | 35 |
1 files changed, 30 insertions, 5 deletions
diff --git a/os400/initscript.sh b/os400/initscript.sh index fb805071..cc52e45e 100644 --- a/os400/initscript.sh +++ b/os400/initscript.sh @@ -165,15 +165,38 @@ action_needed() } -# make_module module_name source_name [additional_definitions] +# make_module [option] module_name source_name # # Compile source name into ASCII module if needed. # As side effect, append the module name to variable MODULES. # Set LINK to "YES" if the module has been compiled. +# Options are: +# --define <additional definitions> +# --ebcdic +# --sysiconv make_module() { + DEFN= + EBCDIC= + SYSICONV= + while true + do case "${1}" in + --define) + DEFN="${2}" + shift + ;; + --ebcdic) + EBCDIC=yes + ;; + --sysiconv) + SYSICONV=yes + ;; + *) break + esac + shift + done MODULES="${MODULES} ${1}" MODIFSNAME="${LIBIFSNAME}/${1}.MODULE" action_needed "${MODIFSNAME}" "${2}" || return 0; @@ -185,7 +208,7 @@ make_module() # the source file and we compile that temporary file. rm -f __tmpsrcf.c - if [ "${4}" != 'ebcdic' ] + if [ -z "${EBCDIC}" ] then echo "#line 1 \"${2}\"" >> __tmpsrcf.c echo "#pragma convert(819)" >> __tmpsrcf.c echo '#include "wrappers.h"' >> __tmpsrcf.c @@ -197,8 +220,10 @@ make_module() CMD="${CMD} OPTION(*INCDIRFIRST)" CMD="${CMD} SYSIFCOPT(*IFS64IO) LANGLVL(*EXTENDED) LOCALETYPE(*LOCALE)" CMD="${CMD} INCDIR(" - CMD="${CMD} '${TOPDIR}/os400/iconv'" - if [ "${4}" != 'ebcdic' ] + if [ -z "${SYSICONV}" ] + then CMD="${CMD} '${TOPDIR}/os400/iconv'" + fi + if [ -z "${EBCDIC}" ] then CMD="${CMD} '/qibm/proddata/qadrt/include'" fi CMD="${CMD} '${TOPDIR}/os400' '${TOPDIR}/os400/dlfcn'" @@ -211,7 +236,7 @@ make_module() CMD="${CMD} OUTPUT(${OUTPUT})" CMD="${CMD} OPTIMIZE(${OPTIMIZE})" CMD="${CMD} DBGVIEW(${DEBUG})" - CMD="${CMD} DEFINE('_REENTRANT' 'TRIO_HAVE_CONFIG_H' 'NDEBUG' ${3})" + CMD="${CMD} DEFINE('_REENTRANT' 'TRIO_HAVE_CONFIG_H' 'NDEBUG' ${DEFN})" system "${CMD}" rm -f __tmpsrcf.c |