#
# libcurl compilation script for the OS/400.
#
-# $Id$
SCRIPTDIR=`dirname "${0}"`
. "${SCRIPTDIR}/initscript.sh"
cd "${TOPDIR}/lib"
-# Create ca-bundle.h file.
-
-if action_needed "ca-bundle.h"
-then echo "/* This file is generated automatically */" > ca-bundle.h
- echo "#ifndef CURL_CA_BUNDLE" >> ca-bundle.h
-
- if [ "${CABUNDLE}" ]
- then echo '#define CURL_CA_BUNDLE @CURL_CA_BUNDLE@' >> ca-bundle.h
- else echo '#undef CURL_CA_BUNDLE /* unknown */' >> ca-bundle.h
- fi
-
- echo "#endif" >> ca-bundle.h
-fi
-
-
# Create and compile the identification source file.
echo '#pragma comment(user, "libcurl version '"${LIBCURL_VERSION}"'")' > os400.c
-echo '#pragma comment(date)' >> os400.c
-echo '#pragma comment(copyright, "Copyright (C) 1998-2007 Daniel Stenberg et al. OS/400 version by P. Monnerat")' >> os400.c
+echo '#pragma comment(user, __DATE__)' >> os400.c
+echo '#pragma comment(user, __TIME__)' >> os400.c
+echo '#pragma comment(copyright, "Copyright (C) 1998-2013 Daniel Stenberg et al. OS/400 version by P. Monnerat")' >> os400.c
make_module OS400 os400.c
LINK= # No need to rebuild service program yet.
MODULES=
# Get source list.
-CSOURCES()
-
-{
- shift # Drop the equal sign.
- CSOURCES="$*" # Get the file names.
-}
-
-HHEADERS()
-
-{
- shift # Drop the equal sign.
- HHEADERS="$*" # Get the file names.
-}
-
-. Makefile.inc
+sed -e ':begin' \
+ -e '/\\$/{' \
+ -e 's/\\$/ /' \
+ -e 'N' \
+ -e 'bbegin' \
+ -e '}' \
+ -e 's/\n//g' \
+ -e 's/[[:space:]]*$//' \
+ -e 's/^\([A-Za-z][A-Za-z0-9_]*\)[[:space:]]*=[[:space:]]*\(.*\)/\1="\2"/' \
+ -e 's/\$(\([A-Za-z][A-Za-z0-9_]*\))/${\1}/g' \
+ < Makefile.inc > tmpscript.sh
+. ./tmpscript.sh
# Compile the sources into modules.
make_module CCSIDCURL "${SCRIPTDIR}/ccsidcurl.c"
for SRC in ${CSOURCES}
-do MODULE=`basename "${SRC}" .c |
- tr '[a-z]' '[A-Z]' |
- sed -e 's/^\(..........\).*/\1/'`
+do MODULE=`db2_name "${SRC}"`
make_module "${MODULE}" "${SRC}"
done
# Gather the list of symbols to export.
-EXPORTS=`grep '^CURL_EXTERN[ ]' \
+EXPORTS=`grep '^CURL_EXTERN[[:space:]]' \
"${TOPDIR}"/include/curl/*.h \
"${SCRIPTDIR}/ccsidcurl.h" |
- sed -e 's/^.*CURL_EXTERN[ ]\(.*\)(.*$/\1/' \
- -e 's/[ ]*$//' \
- -e 's/^.*[ ][ ]*//' \
+ sed -e 's/^.*CURL_EXTERN[[:space:]]\(.*\)(.*$/\1/' \
+ -e 's/[[:space:]]*$//' \
+ -e 's/^.*[[:space:]][[:space:]]*//' \
-e 's/^\*//' \
-e 's/(\(.*\))/\1/'`
BSF="${LIBIFSNAME}/TOOLS.FILE/BNDSRC.MBR"
-if action_needed "${BSF}"
+if action_needed "${BSF}" Makefile.am
then LINK=YES
fi
if [ "${LINK}" ]
-then echo " STRPGMEXP PGMLVL(*CURRENT) SIGNATURE('LIBCURL')" > "${BSF}"
+then echo " STRPGMEXP PGMLVL(*CURRENT) SIGNATURE('LIBCURL_${SONAME}')" \
+ > "${BSF}"
for EXPORT in ${EXPORTS}
do echo ' EXPORT SYMBOL("'"${EXPORT}"'")' >> "${BSF}"
done
then CMD="CRTSRVPGM SRVPGM(${TARGETLIB}/${SRVPGM})"
CMD="${CMD} SRCFILE(${TARGETLIB}/TOOLS) SRCMBR(BNDSRC)"
CMD="${CMD} MODULE(${TARGETLIB}/OS400)"
- CMD="${CMD} BNDDIR(${TARGETLIB}/${STATBNDDIR})"
- CMD="${CMD} BNDSRVPGM(QADRTTS)"
+ CMD="${CMD} BNDDIR(${TARGETLIB}/${STATBNDDIR}"
+ if [ "${WITH_ZLIB}" != 0 ]
+ then CMD="${CMD} ${ZLIB_LIB}/${ZLIB_BNDDIR}"
+ fi
+ CMD="${CMD})"
+ CMD="${CMD} BNDSRVPGM(QADRTTS QGLDCLNT QGLDBRDR)"
CMD="${CMD} TEXT('curl API library')"
CMD="${CMD} TGTRLS(${TGTRLS})"
system "${CMD}"