Bug 74004 - bash shell syntax that is incompatible with bourne shell in configure script
Summary: bash shell syntax that is incompatible with bourne shell in configure script
Status: RESOLVED FIXED
Alias: None
Product: koffice
Classification: Applications
Component: general (show other bugs)
Version: 1.3
Platform: Compiled Sources Solaris
: NOR normal
Target Milestone: ---
Assignee: KOffice Bug Wranglers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-02-02 12:04 UTC by Steve Evans
Modified: 2004-02-03 18:10 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Steve Evans 2004-02-02 12:04:15 UTC
Version:           1.3 (using KDE KDE 3.2.0)
Installed from:    Compiled From Sources
Compiler:          gcc 3.2.3 
OS:          Solaris

The configure script is set to run in the shell /bin/sh, which on Solaris is the Bourne shell, *not* bash.

Unfortunately lines 39566 and 39576 use < as a test operator, which works in bash but not in Bourne:

   if test "$MIMETYPE_KDEVERSION" \< "3.1.90" ; then

which gives this error:

checking if we need to add mime types for KDE 3.1... ./configure[39566]: <: unknown test operator
no (KDE 3.2.0)
./configure[39576]: <: unknown test operator
Comment 1 Nicolas Goutte 2004-02-03 18:10:45 UTC
Subject: KOFFICE_1_3_BRANCH: koffice

CVS commit by goutte: 

Better check for KDE 3.1 (central and portable)
(Backport but uses AC_TRY_COMPILE instead of AC_COMPILE_IFELSE)
CCMAIL:74004-close@bugs.kde.org


  M +32 -0     configure.in.in   1.40.2.3
  M +1 -1      kugar/Makefile.am   1.13.2.1
  M +1 -1      mimetypes/Makefile.am   1.3.2.1
  R            kugar/configure.in.in   1.1
  R            mimetypes/configure.in.in   1.2


--- koffice/mimetypes/Makefile.am  #1.3:1.3.2.1
@@ -1,3 +1,3 @@
-if compile_mimetypes_kde31
+if need_kde31_compatibility
   KDE31MIMEDIR = kde31
 endif

--- koffice/kugar/Makefile.am  #1.13:1.13.2.1
@@ -1,4 +1,4 @@
 #SUBDIRS = lib part shell samples kudesigner
-if compile_mimetypes_kde31
+if need_kde31_compatibility
     KDE31MIMEDIR = kde31
 endif

--- koffice/configure.in.in  #1.40.2.2:1.40.2.3
@@ -113,2 +113,34 @@
   fi
 ])
+
+# --- Check for KDE 3.1 ---
+
+AC_MSG_CHECKING([for KDE newer than 3.1.x])
+
+AC_LANG_SAVE
+AC_LANG_CPLUSPLUS
+kdeversion_save_CXXFLAGS="$CXXFLAGS"
+kdeversion_safe_LIBS="$LIBS"
+LIBS="$LIBS $X_EXTRA_LIBS"
+CXXFLAGS="$CXXFLAGS $all_includes"
+
+AC_TRY_COMPILE([
+#include <kdeversion.h>
+#if ! ( KDE_IS_VERSION( 3, 1, 90 ) )
+#error KDE 3.1
+#endif
+],
+[],
+        old_kde_version="no"
+        AC_MSG_RESULT(yes)
+,
+        old_kde_version="yes"
+        AC_MSG_RESULT(no)
+)
+CXXFLAGS="$kdeversion_save_CXXFLAGS"
+LIBS="$kdeversion_safe_LIBS"
+AC_LANG_RESTORE
+
+AM_CONDITIONAL(need_kde31_compatibility, test "$old_kde_version" = "yes")
+
+# --- End KDE 3.1 check ---