Bugreport configure ppp without '--with-openssl'

"Scheibner, Stefan" <[email protected]>
Newsgroups gmane.linux.ppp
Message-ID <FR4P281MB3530A329B44C8D7C8B8B3616988C2@FR4P281MB3530.DEUP281.PROD.OUTLOOK.COM>
Hi,

I updated ppp-2.4.9 to ppp-2.5.0.
I have may found an issue using pkg-config to find openssl includes and libs.
After calling autogen.sh, we call configure with a lot of environment variables.
PATH=... CC=... CFLAGS=... LDFLAGS=...
PKG_CONFIG_PATH=PATH_TO_PKG_CONFIG_FILES 
configure --host=mips-34kc-linux-gnu --build=i486-linux-gnu

As you can see we do cross-compilation and don't pass --with-openssl
During configure, default ssl dirs are checked but no ssl.h file could be found.
Btw. On cross-compile we should skip checking default locations.
However the variable found is still false.
Then we come to following if:
if test "${with_openssl}" != "no" && test ! ${found}
For some reason we don't go into the if condition to use pkg-config to get
openssl includes and libs.
I think the "test ! ${found}" should be changed to "test ${found} == false".
"test ! ${somevar}" seems to be true, if somevar does not exists. It
does not check the content of the variable.

Here are some tests I made:
    foo=true
    if test ! ${foo}
    then :
        printf "%s\n" "in if test ! foo=true" >&6
    fi
    
    if test ${foo}
    then :
        printf "%s\n" "in if test foo=true" >&6
    fi
    
    foo=false
    
    if test ! ${foo}
    then :
        printf "%s\n" "in if test ! foo=false " >&6
    fi
    
    if test ${foo}
    then :
        printf "%s\n" "in if test foo=false " >&6
    fi
    
    if test ${foobarbaz}
    then :
        printf "%s\n" "in if test foobarbaz " >&6
    fi
    if test ! ${foobarbaz}
    then :
        printf "%s\n" "in if test ! foobarbaz " >&6
    fi
    
    On terminal I see following lines:
    in if test foo=true
    in if test foo=false
    in if test ! foobarbaz

Therefore I propose following patch (based on tag ppp-2.5.0)
--- a/m4/ax_check_openssl.m4
+++ b/m4/ax_check_openssl.m4
@@ -70,7 +70,7 @@ AC_DEFUN([AX_CHECK_OPENSSL], [
            ])
        done])
      
-    AS_IF([test "${with_openssl}" != "no" && test ! ${found}], [  
+    AS_IF([test "${with_openssl}" != "no" && test ${found} == false], [
        # if pkg-config is installed and openssl has installed a .pc file,
        # then use that information and don't search ssldirs
        AC_PATH_PROG([PKG_CONFIG], [pkg-config])

May you can check this.

At the moment, we use autoconf version 2.72c

If you need more details, don't hesitate to contact me.

Best regards,
Stefan Scheibner
Software engineer
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.