]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
os400: build test servers
authorPatrick Monnerat <patrick@monnerat.net>
Sat, 19 Aug 2023 06:28:39 +0000 (08:28 +0200)
committerDaniel Stenberg <daniel@haxx.se>
Wed, 30 Aug 2023 09:38:57 +0000 (11:38 +0200)
Also fix a non-compliant main prototype in disabled.c.

Closes #11547

packages/OS400/initscript.sh
packages/OS400/make-tests.sh
tests/server/disabled.c

index c092e1c2d5a60e355a7a7373b8016455a31814ce..935797c411085c8995307507f270ac9c43afec2b 100755 (executable)
@@ -185,8 +185,9 @@ make_module()
         echo "#line 1" >> __tmpsrcf.c
         cat "${2}" >> __tmpsrcf.c
         CMD="CRTCMOD MODULE(${TARGETLIB}/${1}) SRCSTMF('__tmpsrcf.c')"
-#       CMD="${CMD} SYSIFCOPT(*IFS64IO) OPTION(*INCDIRFIRST *SHOWINC *SHOWSYS)"
-        CMD="${CMD} SYSIFCOPT(*IFS64IO) OPTION(*INCDIRFIRST)"
+        CMD="${CMD} SYSIFCOPT(*IFS64IO *ASYNCSIGNAL)"
+#       CMD="${CMD} OPTION(*INCDIRFIRST *SHOWINC *SHOWSYS)"
+        CMD="${CMD} OPTION(*INCDIRFIRST)"
         CMD="${CMD} LOCALETYPE(*LOCALE) FLAG(10)"
         CMD="${CMD} INCDIR('${QADRTDIR}/include'"
         CMD="${CMD} '${TOPDIR}/include/curl' '${TOPDIR}/include' '${SRCDIR}'"
@@ -265,6 +266,7 @@ versioned_copy()
 #       The `sed' statement works as follows:
 #       - Join \nl-separated lines.
 #       - Retain only lines that begins with "identifier =".
+#       - Replace @...@ sustitutions by shell variable references.
 #       - Turn these lines into shell variable assignments.
 
 get_make_vars()
@@ -277,6 +279,7 @@ get_make_vars()
                 -e 'b begin'                                            \
                 -e '}'                                                  \
                 -e '/^[A-Za-z_][A-Za-z0-9_]*[[:space:]]*=/!d'           \
+                -e 's/@\\([A-Za-z0-9_]*\\)@/${\\1}/g'                   \
                 -e 's/[[:space:]]*=[[:space:]]*/=/'                     \
                 -e 's/=\\(.*[^[:space:]]\\)[[:space:]]*$/=\\"\\1\\"/'   \
                 -e 's/\\\$(\\([^)]*\\))/\${\\1}/g'                      \
index 470fb51012d5a28c37c7b8dadadf54bf8c2ec228..ed475956c9158f176a185014cf176d2fd7ae511f 100755 (executable)
@@ -32,90 +32,114 @@ SCRIPTDIR=`dirname "${0}"`
 cd "${TOPDIR}/tests"
 
 
-#       tests directory not implemented yet.
+#       Build programs in a directory.
 
+build_all_programs()
 
-#       Process the libtest subdirectory.
+{
+        #       Compile all programs.
+        #       The list is found in variable "noinst_PROGRAMS"
 
-cd libtest
+        INCLUDES="'`pwd`' '${TOPDIR}/lib' '${TOPDIR}/src'"
+        MODS="${1}"
+        SRVPGMS="${2}"
 
-#       Get definitions from the Makefile.inc file.
+        for PGM in ${noinst_PROGRAMS}
+        do      DB2PGM=`db2_name "${PGM}"`
+                PGMIFSNAME="${LIBIFSNAME}/${DB2PGM}.PGM"
 
-get_make_vars Makefile.inc
+                #       Extract preprocessor symbol definitions from
+                #               compilation options for the program.
 
-#       Special case: redefine chkhostname compilation parameters.
+                PGMCFLAGS="`eval echo \"\\${${PGM}_CFLAGS}\"`"
+                PGMDFNS=
 
-chkhostname_SOURCES=chkhostname.c
-chkhostname_LDADD=curl_gethostname.o
+                for FLAG in ${PGMCFLAGS}
+                do      case "${FLAG}" in
+                        -D?*)   DEFINE="`echo \"${FLAG}\" | sed 's/^..//'`"
+                                PGMDFNS="${PGMDFNS} '${DEFINE}'"
+                                ;;
+                        esac
+                done
 
-#       Compile all programs.
-#       The list is found in variable "noinst_PROGRAMS"
+                #        Compile all C sources for the program into modules.
+
+                PGMSOURCES="`eval echo \"\\${${PGM}_SOURCES}\"`"
+                LINK=
+                MODULES=
+
+                for SOURCE in ${PGMSOURCES}
+                do      case "${SOURCE}" in
+                        *.c)    #       Special processing for libxxx.c files:
+                                #               their module name is determined
+                                #               by the target PROGRAM name.
+
+                                case "${SOURCE}" in
+                                lib*.c) MODULE="${DB2PGM}"
+                                        ;;
+                                *)      MODULE=`db2_name "${SOURCE}"`
+                                        ;;
+                                esac
+
+                                #       If source is in a sibling directory,
+                                #               prefix module name with 'X'.
+
+                                case "${SOURCE}" in
+                                ../*)   MODULE=`db2_name "X${MODULE}"`
+                                            ;;
+                                esac
+
+                                make_module "${MODULE}" "${SOURCE}" "${PGMDFNS}"
+                                if action_needed "${PGMIFSNAME}" "${MODIFSNAME}"
+                                then    LINK=yes
+                                fi
+                                ;;
+                        esac
+                done
 
-INCLUDES="'${TOPDIR}/tests/libtest' '${TOPDIR}/lib'"
+                #       Link program if needed.
+
+                if [ "${LINK}" ]
+                then    PGMLDADD="`eval echo \"\\${${PGM}_LDADD}\"`"
+                        for ARG in ${PGMLDADD}
+                        do      case "${ARG}" in
+                                -*)     ;;              # Ignore non-module.
+                                *)      MODULES="${MODULES} "`db2_name "${ARG}"`
+                                        ;;
+                                esac
+                        done
+                        MODULES="`echo \"${MODULES}\" |
+                            sed \"s/[^ ][^ ]*/${TARGETLIB}\/&/g\"`"
+                        CMD="CRTPGM PGM(${TARGETLIB}/${DB2PGM})"
+                        CMD="${CMD} ENTMOD(${TARGETLIB}/CURLMAIN)"
+                        CMD="${CMD} MODULE(${MODULES} ${MODS})"
+                        CMD="${CMD} BNDSRVPGM(${SRVPGMS} QADRTTS)"
+                        CMD="${CMD} TGTRLS(${TGTRLS})"
+                        CLcommand "${CMD}"
+                fi
+        done
+}
 
-for PGM in ${noinst_PROGRAMS}
-do      DB2PGM=`db2_name "${PGM}"`
-        PGMIFSNAME="${LIBIFSNAME}/${DB2PGM}.PGM"
 
-        #       Extract preprocessor symbol definitions from compilation
-        #               options for the program.
+#       Build programs in the server directory.
 
-        PGMCFLAGS="`eval echo \"\\${${PGM}_CFLAGS}\"`"
-        PGMDEFINES=
+(
+        cd server
+        get_make_vars Makefile.inc
+        build_all_programs "${TARGETLIB}/OS400SYS"
+)
 
-        for FLAG in ${PGMCFLAGS}
-        do      case "${FLAG}" in
-                -D?*)   DEFINE="`echo \"${FLAG}\" | sed 's/^..//'`"
-                        PGMDEFINES="${PGMDEFINES} '${DEFINE}'"
-                        ;;
-                esac
-        done
 
-        #        Compile all C sources for the program into modules.
+#       Build all programs in the libtest subdirectory.
 
-        PGMSOURCES="`eval echo \"\\${${PGM}_SOURCES}\"`"
-        LINK=
-        MODULES=
+(
+        cd libtest
+        get_make_vars Makefile.inc
 
-        for SOURCE in ${PGMSOURCES}
-        do      case "${SOURCE}" in
-                *.c)    #       Special processing for libxxx.c files: their
-                        #               module name is determined by the target
-                        #               PROGRAM name.
+        #       Special case: redefine chkhostname compilation parameters.
 
-                        case "${SOURCE}" in
-                        lib*.c) MODULE="${DB2PGM}"
-                                ;;
-                        *)      MODULE=`db2_name "${SOURCE}"`
-                                ;;
-                        esac
-
-                        make_module "${MODULE}" "${SOURCE}" "${PGMDEFINES}"
-                        if action_needed "${PGMIFSNAME}" "${MODIFSNAME}"
-                        then    LINK=yes
-                        fi
-                        ;;
-                esac
-        done
+        chkhostname_SOURCES=chkhostname.c
+        chkhostname_LDADD=curl_gethostname.o
 
-        #       Link program if needed.
-
-        if [ "${LINK}" ]
-        then    PGMLDADD="`eval echo \"\\${${PGM}_LDADD}\"`"
-                for LDARG in ${PGMLDADD}
-                do      case "${LDARG}" in
-                        -*)     ;;              # Ignore non-module.
-                        *)      MODULES="${MODULES} "`db2_name "${LDARG}"`
-                                ;;
-                        esac
-                done
-                MODULES="`echo \"${MODULES}\" |
-                    sed \"s/[^ ][^ ]*/${TARGETLIB}\/&/g\"`"
-                CMD="CRTPGM PGM(${TARGETLIB}/${DB2PGM})"
-                CMD="${CMD} ENTMOD(${TARGETLIB}/CURLMAIN)"
-                CMD="${CMD} MODULE(${MODULES})"
-                CMD="${CMD} BNDSRVPGM(${TARGETLIB}/${SRVPGM} QADRTTS)"
-                CMD="${CMD} TGTRLS(${TGTRLS})"
-                CLcommand "${CMD}"
-        fi
-done
+        build_all_programs "" "${TARGETLIB}/${SRVPGM}"
+)
index a9b43b8355bfbdbbedfd56faded3b21179a4761f..82fa854e3f50ab8fd995c7fc9e610899d7aa7324 100644 (file)
@@ -91,9 +91,13 @@ static const char *disabled[]={
   NULL
 };
 
-int main(void)
+int main(int argc, char **argv)
 {
   int i;
+
+  (void) argc;
+  (void) argv;
+
   for(i = 0; disabled[i]; i++)
     printf("%s\n", disabled[i]);