Skip to content

Commit

Permalink
Merge pull request #3 from ZOSOpenTools/use-utils
Browse files Browse the repository at this point in the history
Use utils
  • Loading branch information
ccw-1 authored May 25, 2022
2 parents 7541875 + ffc3e78 commit 4e9c54f
Show file tree
Hide file tree
Showing 6 changed files with 114 additions and 218 deletions.
150 changes: 0 additions & 150 deletions bin/automakebuild.sh

This file was deleted.

72 changes: 72 additions & 0 deletions oldsetenv.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
#!/bin/sh
#set -x

if ! [ -f ./setenv.sh ]; then
echo "Need to source from the setenv.sh directory" >&2
else
export _BPXK_AUTOCVT="ON"
export _CEE_RUNOPTS="FILETAG(AUTOCVT,AUTOTAG),POSIX(ON),TERMTHDACT(MSG)"
export _TAG_REDIR_ERR="txt"
export _TAG_REDIR_IN="txt"
export _TAG_REDIR_OUT="txt"

export AUTOMAKE_VRM="automake-1.16"
export AUTOMAKE_ROOT="${PWD}"

export AUTOTOOLS_MIRROR="https://github.com/autotools-mirror"
export AUTOCONF_URL="http://ftp.gnu.org/gnu/automake/"

#
# Add 'Perl' and 'M4' to PATH, LIBPATH, PERL5LIB
#
if $gitsource ; then
export GIT_URL="https://github.com/autotools-mirror"
else
export TARBALL_URL="http://ftp.gnu.org/gnu/autoconf/"
fi

#
# Add 'make', 'zlib', 'Perl', 'M4' to PATH, LIBPATH, PERL5LIB
#
if [ "${GIT_ROOT}x" = "x" ]; then
export GIT_ROOT="${HOME}/zot/boot/git"
fi
if [ "${CURL_ROOT}x" = "x" ]; then
export CURL_ROOT="${HOME}/zot/boot/curl"
fi
if [ "${PERL_ROOT}x" = "x" ]; then
export PERL_ROOT="${HOME}/zot/prod/perl"
fi
if [ "${M4_ROOT}x" = "x" ]; then
export M4_ROOT="${HOME}/zot/prod/m4"
fi
if [ "${MAKE_ROOT}x" = "x" ]; then
export MAKE_ROOT="${HOME}/zot/prod/make"
fi
if [ "${GZIP_ROOT}x" = "x" ]; then
export GZIP_ROOT="${HOME}/zot/boot/gzip"
fi
if [ "${ZLIB_ROOT}x" = "x" ]; then
export ZLIB_ROOT="${HOME}/zot/boot/zlib"
fi
if [ "${AUTOCONF_ROOT}x" = "x" ]; then
export AUTOCONF_ROOT="${HOME}/zot/prod/autoconf"
fi
if [ "${AUTOMAKE_INSTALL_PREFIX}x" = "x" ]; then
export AUTOMAKE_INSTALL_PREFIX="${HOME}/zot/prod/automake"
fi

export PATH="${M4_ROOT}/bin:${PERL_ROOT}/bin:${GIT_ROOT}/bin:${MAKE_ROOT}/bin:${CURL_ROOT}/bin:${GZIP_ROOT}/bin:${ZLIB_ROOT}/bin:${AUTOCONF_ROOT}/bin:$PATH"
for libperl in $(find "${PERL_ROOT}" -name "libperl.so"); do
lib=$(dirname "${libperl}")
export LIBPATH="${lib}:${LIBPATH}"
break
done
export PERL5LIB_ROOT=$( cd ${PERL_ROOT}/lib/perl5/5*; echo $PWD )
export PERL5LIB="${PERL5LIB_ROOT}:${PERL5LIB_ROOT}/os390"

export MY_ROOT="${PWD}"
export PATH="${MY_ROOT}/bin:${PATH}"

export AUTOMAKE_PROD="${HOME}/zot/prod/automake"
fi
3 changes: 3 additions & 0 deletions portchk.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/sh
# Temporary - write a proper test
exit 0
12 changes: 12 additions & 0 deletions portcrtenv.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/bin/sh
install_dir="$1"

cat <<zz >"${install_dir}/.env"
if ! [ -f ./.env ]; then
echo "Need to source from the .env directory" >&2
return 0
fi
mydir="\${PWD}"
export PATH="\${mydir}/bin:\$PATH"
zz
exit 0
78 changes: 15 additions & 63 deletions setenv.sh
100755 → 100644
Original file line number Diff line number Diff line change
@@ -1,72 +1,24 @@
#!/bin/sh
#set -x

#
# Set up environment variables for general build tool to operate
#
if ! [ -f ./setenv.sh ]; then
echo "Need to source from the setenv.sh directory" >&2
else
export _BPXK_AUTOCVT="ON"
export _CEE_RUNOPTS="FILETAG(AUTOCVT,AUTOTAG),POSIX(ON),TERMTHDACT(MSG)"
export _TAG_REDIR_ERR="txt"
export _TAG_REDIR_IN="txt"
export _TAG_REDIR_OUT="txt"

export AUTOMAKE_VRM="automake-1.16"
export AUTOMAKE_ROOT="${PWD}"
return 0
fi

export AUTOTOOLS_MIRROR="https://github.com/autotools-mirror"
export AUTOCONF_URL="http://ftp.gnu.org/gnu/automake/"
export PORT_ROOT="${PWD}"
export PORT_TYPE="TARBALL"

#
# Add 'Perl' and 'M4' to PATH, LIBPATH, PERL5LIB
#
if $gitsource ; then
export GIT_URL="https://github.com/autotools-mirror"
else
export TARBALL_URL="http://ftp.gnu.org/gnu/autoconf/"
fi
export PORT_TARBALL_URL="https://ftp.gnu.org/gnu/automake/automake-1.16.tar.gz"
export PORT_TARBALL_DEPS="curl gzip make m4 perl autoconf"

#
# Add 'make', 'zlib', 'Perl', 'M4' to PATH, LIBPATH, PERL5LIB
#
if [ "${GIT_ROOT}x" = "x" ]; then
export GIT_ROOT="${HOME}/zot/boot/git"
fi
if [ "${CURL_ROOT}x" = "x" ]; then
export CURL_ROOT="${HOME}/zot/boot/curl"
fi
if [ "${PERL_ROOT}x" = "x" ]; then
export PERL_ROOT="${HOME}/zot/prod/perl"
fi
if [ "${M4_ROOT}x" = "x" ]; then
export M4_ROOT="${HOME}/zot/prod/m4"
fi
if [ "${MAKE_ROOT}x" = "x" ]; then
export MAKE_ROOT="${HOME}/zot/prod/make"
fi
if [ "${GZIP_ROOT}x" = "x" ]; then
export GZIP_ROOT="${HOME}/zot/boot/gzip"
fi
if [ "${ZLIB_ROOT}x" = "x" ]; then
export ZLIB_ROOT="${HOME}/zot/boot/zlib"
fi
if [ "${AUTOCONF_ROOT}x" = "x" ]; then
export AUTOCONF_ROOT="${HOME}/zot/prod/autoconf"
fi
if [ "${AUTOMAKE_INSTALL_PREFIX}x" = "x" ]; then
export AUTOMAKE_INSTALL_PREFIX="${HOME}/zot/prod/automake"
fi

export PATH="${M4_ROOT}/bin:${PERL_ROOT}/bin:${GIT_ROOT}/bin:${MAKE_ROOT}/bin:${CURL_ROOT}/bin:${GZIP_ROOT}/bin:${ZLIB_ROOT}/bin:${AUTOCONF_ROOT}/bin:$PATH"
for libperl in $(find "${PERL_ROOT}" -name "libperl.so"); do
lib=$(dirname "${libperl}")
export LIBPATH="${lib}:${LIBPATH}"
break
done
export PERL5LIB_ROOT=$( cd ${PERL_ROOT}/lib/perl5/5*; echo $PWD )
export PERL5LIB="${PERL5LIB_ROOT}:${PERL5LIB_ROOT}/os390"
export PORT_GIT_URL="https://github.com/autotools-mirror/automake.git"
export PORT_GIT_DEPS="git make m4 perl autoconf automake help2man makeinfo xz"

export MY_ROOT="${PWD}"
export PATH="${MY_ROOT}/bin:${PATH}"
export PORT_EXTRA_CFLAGS=""
export PORT_EXTRA_LDFLAGS=""

export AUTOMAKE_PROD="${HOME}/zot/prod/automake"
if [ "${PORT_TYPE}x" = "TARBALLx" ]; then
export PORT_BOOTSTRAP=skip
fi
17 changes: 12 additions & 5 deletions tests/runbasic.sh
Original file line number Diff line number Diff line change
@@ -1,13 +1,20 @@
#!/bin/sh

cd basic || exit 99
genfiles=autom4te.cache configure autom4te.cache aclocal.m4 configure build-aux Makefile.in config.status config.log Makefile hello.o hello.dbg hello .deps"
genfiles="autom4te.cache configure autom4te.cache aclocal.m4 configure build-aux Makefile.in config.status config.log Makefile hello.o hello.dbg hello .deps"
rm -rf $genfiles

export PATH="${AUTOMAKE_PROD}/bin:$PATH"
# msf - should this be required?
export PERL5LIB="${AUTOMAKE_PROD}/share/automake-1.16:$PERL5LIB"
# Set up Perl, Autoconf, Automake from prod

cd $HOME/zot/prod/perl || exit 99
. ./.env
cd $OLDPWD
cd $HOME/zot/prod/autoconf || exit 99
. ./.env
cd $OLDPWD
cd $HOME/zot/prod/automake || exit 99
. ./.env
cd $OLDPWD

if ! whence autoreconf || ! whence aclocal ; then
echo "Need autoconf and automake tools on PATH before running test" >&2
Expand Down

0 comments on commit 4e9c54f

Please sign in to comment.