For more information please visit our Web Site at: http://tpf.ncsa.uiuc.edu/ This document outlines the steps needed to build version 7.16.1 of the libcurl library on the IBM z/TPF Enterprise Edition V1 R1 system. It assumes that you are familiar with the MakeTPF build solution and the TPF APAR process. The libcurl library is used by the z/TPF FTP Client (PJ31266) and the z/TPF HTTP Client (PJ32013). For contact assistance and problem reporting, follow the normal problem reporting process for z/TPF issues and questions or contact a TPF Customer Support Representative. The following naming conventions are used in this document: "Curl" refers to the entire Curl package "libcurl" refers to just the library portion of the Curl package "CURL" is the libcurl program name on the z/TPF system. The following directory structure is used for building the libcurl library for TPF: opensource/curl/lib ROOTCDIRS opensource/curl/lib ROOTINCDIRS opensource/curl/include " " opensource/curl/include/curl " " opensource/curl/output/exp ROOTEXPDIRS opensource/curl/output/lib ROOTLIBDIRS opensource/curl/output/lst ROOTLSTDIRS opensource/curl/output/load ROOTLOADDIRS opensource/curl/output/obj ROOTOBJDIRS opensource/curl MakeTPF .mak file tpftools/include_ztpf_user MakeTPF environment files If you want to change the directory structure, adjust these instructions and the Maketpf-related files accordingly. 1. Apply the tpf_select_bsd sub-second APAR. z/TPF APAR PJ32100 corrects tpf_select_bsd sub-second time increments and is required for libcurl to function properly. If you have not already done so, apply PJ32100. 2. Apply the z/TPF FTP Client APAR. z/TPF FTP Client APAR PJ31266 is a prerequisite for libcurl. If you have not already done so, apply PJ31266. 3. Optionally apply the z/TPF HTTP Client APAR. The z/TPF HTTP Client APAR PJ32013 is necessary to use the HTTP Client APIs on z/TPF but is not a prerequisite for libcurl. If desired, apply PJ32013. 4. Acquire the Curl source files. Download and extract the Curl source files from the z/TPF Repository: a. Download the curl_7_16_1_20070713.tar.gz file from http://tpf.ncsa.uiuc.edu/ to your root source directory. Note: Issues with MS IE and WinZip When downloading the curl_7_16_1_20070713.tar.gz package with Microsoft IE for Windows, the name might be changed to curl_7_16_1_20070713.tar.tar. WinZip will fail when trying to extract the package while it is named curl_7_16_1_20070713.tar.tar. To correct this, rename the file back to curl_7_16_1_20070713.tar.gz and WinZip will correctly extract the tarball. Notes: Make sure you have "Hide Extensions for Known Types" un-checked in your Internet Explorer options so you will actually get access to the file extension. If you are using FTP - please ensure you use Binary transfer mode b. Unarchive curl_7_16_1_20070713.tar.gz to your source directory. This package contains the tarred source trees for the Curl package (http://curl.haxx.se/) with additional modifications for the z/TPF system. tar zxvfp curl_7_16_1_20070713.tar.gz This will create the directory structure opensource/curl. 5. Remove any previous versions of libcurl Version 7.16.1-20070713 replaces all earlier libcurl versions for z/TPF. Remove any previous installations of libcurl before preceeding. (The version is indicated by the #define LIBCURL_VERSION value defined in opensource/curl/include/curl/curlver.h.) 6. Create the MakeTPF environment files. Create the tpftools/include_ztpf_user directory if it does not already exist: mkdir -p tpftools/include_ztpf_user Copy the downloaded opensource/curl/packages/TPF/maketpf.env_curllib and opensource/curl/packages/TPF/maketpf.env_curl files to the tpftools/include_ztpf_user directory. The maketpf.env_curllib environment is used to build libcurl. The maketpf.env_curl environment is used to build programs that use libcurl, such as the z/TPF FTP and HTTP Client-related programs. 7. Create the libcurl makefile. Copy the downloaded opensource/curl/packages/TPF/curl.mak file to the opensource/curl directory. This is the makefile for the libcurl library. The makefiles for the z/TPF FTP Client are part of APAR PJ31266 so you do not have to create them manually. The makefiles for the z/TPF HTTP Client are part of APAR PJ32013 so you do not have to create them manually. 8. Flip the libcurl switch. Building the libcurl library and support for the z/TPF FTP and HTTP Clients is optional and is controlled by a MakeTPF switch called TPF_SBCURL. TPF_SBCURL was added to tpftools/include_ztpf/maketpf.rules_functionswitch2ksh and tpftools/include_ztpf/maketpf.rules_functionswitch_defaults by APAR PJ31266. The LIBCURL= option in macro/sip/config.mac was added for the TPF_SBCURL switch. Change the LIBCURL= value from NO to YES in xxx/src/sip.asm, where "xxx" is the system you are building (for example: bas, bss, wp). This will set the TPF_SBCURL switch on. Enter the following to run SIP: bldtpf -f -sip xxx/src/sip.asm 9. Build the libcurl library. Build the library by entering the following: maketpf -f CURL This creates opensource/curl/output/lib/libCURL.so and opensource/curl/output/load/CURLvv.so (where "vv" is the USER_VERSION_CODE in your maketpf.cfg configuration file). There should be no warnings nor errors. If you get unresolved references to Curl_SOCKS4 or Curl_SOCK5, you are probably using an old curl.mak file. Create a new curl.mak file as described above. 10. Rebuild all code that uses libcurl. You will need to rebuild the z/TPF FTP Client code for CFTC, CFTD, CFTF, CTMW, and CXXC. See APAR PJ31266 for instructions on building or rebuilding the z/TPF FTP Client. If you have applied PJ32013 you will need to rebuild the z/TPF HTTP Client code for CHTF, CTMW, and CXXC. See APAR PJ32013 for instructions on building or rebuilding the z/TPF HTTP Client. (Note that CTMW and CXXC are used for both the z/TPF FTP Client and the z/TPF HTTP Client.) If you get an ETPFHTTP_LIBERR error when calling the HTTP Client APIs, it's a symptom of an old libcurl library. Rebuild libcurl and the z/TPF HTTP Client. [This document was last updated 2007-08-31]