- Check for gsoap version
authorJiří Škrábal <nykolas@ics.muni.cz>
Thu, 17 Feb 2005 08:07:34 +0000 (08:07 +0000)
committerJiří Škrábal <nykolas@ics.muni.cz>
Thu, 17 Feb 2005 08:07:34 +0000 (08:07 +0000)
org.glite.security.gsoap-plugin/Makefile
org.glite.security.gsoap-plugin/src/glite_gsplugin.c

index a1c4623..07b464b 100644 (file)
@@ -22,6 +22,9 @@ GSPLUGIN_DEBUG:=
 
 version_info=-version-info `echo ${version} | cut -d. -f1,2 | tr . :`
 
+gsoap_version=`${gsoap_prefix}/bin/soapcpp2 -version 2>&1 | cut -d' ' -f4 | perl -F\\\\. -nae '$$F[2] =~ s/\D*$$//; print $$F[2]+100*$$F[1]+10000*$$F[0]'`
+gsoap_min_version=`${gsoap_prefix}/bin/soapcpp2 -version 2>&1 | cut -d' ' -f4 | cut -d'.' -f3`
+
 VPATH=${top_srcdir}/src:${top_srcdir}/test:${top_srcdir}/examples
 
 TEST_LIBS:=-L${cppunit}/lib -lcppunit
@@ -35,6 +38,8 @@ endif
 
 CFLAGS:= ${DEBUG} \
        -DVERSION=\"${version}\" \
+       -DGSOAP_VERSION=${gsoap_version} \
+       -DGSOAP_MIN_VERSION=\"${gsoap_min_version}\" \
        -I${top_srcdir}/src -I${top_srcdir}/interface -I. \
        -I${stagedir}/include \
        -I${gsoap_prefix}/include \
index 8cfb12f..bdec0aa 100644 (file)
@@ -108,7 +108,9 @@ glite_gsplugin(struct soap *soap, struct soap_plugin *p, void *arg)
 
        soap->fconnect          = glite_gsplugin_connect;
        soap->fclose            = glite_gsplugin_close;
+#if GSOAP_VERSION >= 20700
        soap->fclosesocket      = glite_gsplugin_close;
+#endif
        soap->faccept           = glite_gsplugin_accept;
        soap->fsend                     = glite_gsplugin_send;
        soap->frecv                     = glite_gsplugin_recv;
@@ -169,6 +171,15 @@ glite_gsplugin_connect(
 
 
        pdprintf(("GSLITE_GSPLUGIN: glite_gsplugin_connect()\n"));
+#if GSOAP_VERSION <= 20700
+       if (   GSOAP_VERSION < 20700
+               || (GSOAP_VERSION == 20700
+                       && (strlen(GSOAP_MIN_VERSION) < 1 || GSOAP_MIN_VERSION[1] < 'e')) ) {
+               fprintf(stderr, "Client connect will work only with gSOAP v2.7.0e and later");
+               return ENOSYS;
+       }
+#endif
+
        ctx = ((int_plugin_data_t *)soap_lookup_plugin(soap, plugin_id))->ctx;
 
        if ( ctx->cred == GSS_C_NO_CREDENTIAL ) {