Skip to content

Commit

Permalink
os400: move build configuration parameters to a separate script
Browse files Browse the repository at this point in the history
They can then easily be overriden in a script named "config400.override"
that is not part of the distribution.

Closes curl#11547
  • Loading branch information
monnerat authored and ptitSeb committed Sep 25, 2023
1 parent 1cae7d8 commit 55733d5
Show file tree
Hide file tree
Showing 4 changed files with 68 additions and 42 deletions.
1 change: 1 addition & 0 deletions packages/Makefile.am
Expand Up @@ -32,6 +32,7 @@ EXTRA_DIST = README.md \
OS400/curlmain.c \
OS400/curl.inc.in \
OS400/initscript.sh \
OS400/config400.default \
OS400/make-include.sh \
OS400/make-lib.sh \
OS400/make-src.sh \
Expand Down
18 changes: 10 additions & 8 deletions packages/OS400/README.OS400
Expand Up @@ -275,18 +275,20 @@ _ Install the curl source directory in IFS. Do NOT install it in the
_ Enter Qshell (QSH, not PASE)
_ Change current directory to the curl installation directory
_ Change current directory to ./packages/OS400
_ Edit file iniscript.sh. You may want to change tunable configuration
parameters, like debug info generation, optimization level, listing option,
target library, ZLIB/LIBSSH2 availability and location, etc.
- If you want to change the default configuration parameters like debug info
generation, optimization level, listing option, target library, ZLIB/LIBSSH2
availability and location, etc., copy file config400.default to
config400.override and edit the latter. Do not edit the original default file
as it might be overwritten by a subsequent source installation.
_ Copy any file in the current directory to makelog (i.e.:
cp initscript.sh makelog): this is intended to create the makelog file with
an ASCII CCSID!
_ Enter the command "sh makefile.sh > makelog 2>&1"
_ Examine the makelog file to check for compilation errors. CZM0383 warnings on
C or system standard API come from QADRT inlining and can safely be ignored.

Leaving file initscript.sh unchanged, this will produce the following OS/400
objects:
Without configuration parameters override, this will produce the following
OS/400 objects:
_ Library CURL. All other objects will be stored in this library.
_ Modules for all libcurl units.
_ Binding directory CURL_A, to be used at calling program link time for
Expand All @@ -297,6 +299,8 @@ _ Service program CURL.<soname>, where <soname> is extracted from the
when this program has dynamically bound curl at link time.
_ Binding directory CURL. To be used to dynamically bind libcurl when linking a
calling program.
- CLI tool bound program CURL.
- CLI command CURL.
_ Source file H. It contains all the include members needed to compile a C/C++
module using libcurl, and an ILE/RPG /copy member for support in this
language.
Expand All @@ -305,11 +309,9 @@ _ CCSIDCURL member in file H. This defines the non-standard EBCDIC wrappers for
C and C++.
_ CURL.INC member in file H. This defines everything needed by an ILE/RPG
program using libcurl.
_ LIBxxx modules and programs. Although the test environment is not supported
on OS/400, the libcurl test programs are compiled for manual tests.
_ IFS directory /curl/include/curl containing the C header files for IFS source
C/C++ compilation and curl.inc.rpgle for IFS source ILE/RPG compilation.

- IFS link /curl/bin/curl to CLI tool program.


Special programming consideration:
Expand Down
52 changes: 52 additions & 0 deletions packages/OS400/config400.default
@@ -0,0 +1,52 @@
#!/bin/sh
#***************************************************************************
# _ _ ____ _
# Project ___| | | | _ \| |
# / __| | | | |_) | |
# | (__| |_| | _ <| |___
# \___|\___/|_| \_\_____|
#
# Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution. The terms
# are also available at https://curl.se/docs/copyright.html.
#
# You may opt to use, copy, modify, merge, publish, distribute and/or sell
# copies of the Software, and permit persons to whom the Software is
# furnished to do so, under the terms of the COPYING file.
#
# This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
# KIND, either express or implied.
#
# SPDX-License-Identifier: curl
#
###########################################################################

# Tunable configuration parameters.

setenv TARGETLIB 'CURL' # Target OS/400 program library.
setenv STATBNDDIR 'CURL_A' # Static binding directory.
setenv DYNBNDDIR 'CURL' # Dynamic binding directory.
setenv SRVPGM "CURL.${SONAME}" # Service program.
setenv TGTCCSID '500' # Target CCSID of objects.
setenv DEBUG '*ALL' # Debug level.
setenv OPTIMIZE '10' # Optimization level
setenv OUTPUT '*NONE' # Compilation output option.
setenv TGTRLS '*CURRENT' # Target OS release.
setenv IFSDIR '/curl' # Installation IFS directory.
setenv QADRTDIR '/QIBM/ProdData/qadrt' # QADRT IFS directory.

# Define ZLIB availability and locations.

setenv WITH_ZLIB 0 # Define to 1 to enable.
setenv ZLIB_INCLUDE '/zlib/include' # ZLIB include IFS directory.
setenv ZLIB_LIB 'ZLIB' # ZLIB library.
setenv ZLIB_BNDDIR 'ZLIB_A' # ZLIB binding directory.

# Define LIBSSH2 availability and locations.

setenv WITH_LIBSSH2 0 # Define to 1 to enable.
setenv LIBSSH2_INCLUDE '/libssh2/include' # LIBSSH2 include IFS directory.
setenv LIBSSH2_LIB 'LIBSSH2' # LIBSSH2 library.
setenv LIBSSH2_BNDDIR 'LIBSSH2_A' # LIBSSH2 binding directory.
39 changes: 5 additions & 34 deletions packages/OS400/initscript.sh
Expand Up @@ -62,41 +62,12 @@ SONAME=`sed -e '/^VERSIONCHANGE=/!d;s/^.*=\([0-9]*\).*/\1/' \
< "${TOPDIR}/lib/Makefile.soname"`
export SONAME

# Get OS/400 configuration parameters.

################################################################################
#
# Tunable configuration parameters.
#
################################################################################

setenv TARGETLIB 'CURL' # Target OS/400 program library.
setenv STATBNDDIR 'CURL_A' # Static binding directory.
setenv DYNBNDDIR 'CURL' # Dynamic binding directory.
setenv SRVPGM "CURL.${SONAME}" # Service program.
setenv TGTCCSID '500' # Target CCSID of objects.
setenv DEBUG '*ALL' # Debug level.
setenv OPTIMIZE '10' # Optimization level
setenv OUTPUT '*NONE' # Compilation output option.
setenv TGTRLS '*CURRENT' # Target OS release.
setenv IFSDIR '/curl' # Installation IFS directory.
setenv QADRTDIR '/QIBM/ProdData/qadrt' # QADRT IFS directory.

# Define ZLIB availability and locations.

setenv WITH_ZLIB 0 # Define to 1 to enable.
setenv ZLIB_INCLUDE '/zlib/include' # ZLIB include IFS directory.
setenv ZLIB_LIB 'ZLIB' # ZLIB library.
setenv ZLIB_BNDDIR 'ZLIB_A' # ZLIB binding directory.

# Define LIBSSH2 availability and locations.

setenv WITH_LIBSSH2 0 # Define to 1 to enable.
setenv LIBSSH2_INCLUDE '/libssh2/include' # LIBSSH2 include IFS directory.
setenv LIBSSH2_LIB 'LIBSSH2' # LIBSSH2 library.
setenv LIBSSH2_BNDDIR 'LIBSSH2_A' # LIBSSH2 binding directory.


################################################################################
. "${SCRIPTDIR}/config400.default"
if [ -f "${SCRIPTDIR}/config400.override" ]
then . "${SCRIPTDIR}/config400.override"
fi

# Need to get the version definitions.

Expand Down

0 comments on commit 55733d5

Please sign in to comment.