netkittelnet: fix build on toolchains without C++ support
authorPeter Korsgaard <jacmet@sunsite.dk>
Tue, 9 Oct 2012 07:36:35 +0000 (09:36 +0200)
committerPeter Korsgaard <jacmet@sunsite.dk>
Tue, 9 Oct 2012 07:36:35 +0000 (09:36 +0200)
The configure script checks for C++ support as telnet (but not telnetd)
contains C++ code. This used to work by accident if the host had g++,
as we didn't pass TARGET_CONFIGURE_OPTS to configure (which sets CXX to
/bin/false).

Fix it by removing the g++ check and rewriting the configure checks to
use the C compiler instead.

Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
package/netkittelnet/netkittelnet.mk
package/netkittelnet/netkittelnet.patch

index 7bcfaf8c3cbde843441cfd777b1c8ba8fe166861..a0f27860167d8edb9e2e1848df856ee96abcbd4c 100644 (file)
@@ -14,6 +14,8 @@ define NETKITTELNET_CONFIGURE_CMDS
        $(SED) "s/main()/main(void)/;" $(@D)/configure
        # Disable termcap support
        $(SED) "s~\(.*termcap\.h.*\)~/* \1 */~;" $(@D)/telnetd/telnetd.c
+       # C++ support not needed for telnetd
+       $(SED) 's/CXX/CC/g' -e 's/conftest.cc/conftest.c/g' $(@D)/configure
        (cd $(@D); \
                $(TARGET_CONFIGURE_OPTS) \
                ./configure \
index 863bbcd919600af54cd238c94b8f6fd7754991cb..ee4f37ee49b64f7f8bb68492aaf2e50e7da2054c 100644 (file)
         ) >/dev/null 2>&1 || continue;
         CXX=$TRY
         break;
-@@ -141,7 +138,6 @@
-     echo -n 'Checking if C++ compiler works... '
-     if (
-           $CXX __conftest.cc -o __conftest || exit 1
+@@ -138,18 +135,5 @@
+     fi
+     echo "$CXX"
+-else
+-    echo -n 'Checking if C++ compiler works... '
+-    if (
+-          $CXX __conftest.cc -o __conftest || exit 1
 -          ./__conftest || exit 1
-        ) >/dev/null 2>&1; then
-          echo 'yes'
-      else
+-       ) >/dev/null 2>&1; then
+-         echo 'yes'
+-     else
+-         echo 'no'
+-         echo 'Compiler '"$CXX"' does not exist or cannot compile C++; try another.'
+-         rm -f __conftest*
+-         exit
+-     fi
+ fi
+ echo -n "Checking if $CXX accepts gcc warnings... "
 @@ -278,13 +274,11 @@
  EOF
  if (