[Date Prev][Date Next][Thread Prev][Thread Next][Thread Index]

[XaraXtreme-dev] test for equality with == in configure.in



Hi all,

Shell constructs like ``if test $variable == "yes"; then''
are bash specific and result in ``test: yes: unexpected operator'' for
systems where /bin/sh is not (a symlink to) bash.

Please use = instead of == for such comparisons since the later is
understood by sh and bash and therefore is more portable.

Here is a patch against 0.4r762's configure.in
This patch also fixes the
FT_CFLAGS = ""
PANGO_CFLAGS = ""
assignments which are not understood by neither bash nor sh and result
in ``FT_CFLAGS: command not found''


--- configure.in.diff begins here ---
--- configure.in.orig	Tue Apr  4 12:12:22 2006
+++ configure.in	Tue Apr  4 12:12:38 2006
@@ -8,7 +8,7 @@
 AC_ARG_ENABLE(debug,
 [[  --enable-debug          Add more debug information and checks to executable]],
 [
-	if test $enableval == "yes"; then
+	if test $enableval = "yes"; then
 		DEBUG_FLAGS="-ggdb -D_DEBUG"
 		OPT_FLAGS="-O0"
 		DebugEnable="yes"
@@ -19,7 +19,7 @@
 AC_ARG_ENABLE(static-exec,
 [[  --enable-static-exec    Build a statically linked version of the executable]],
 [
-	if test $enableval == "yes"; then
+	if test $enableval = "yes"; then
 		StaticEnable="yes"
 		DebugEnable="no"
 	fi
@@ -72,7 +72,7 @@
 PrecompileEnable="yes"
 
 AC_MSG_CHECKING([Compiler])
-if test $ac_compiler_gnu == "yes"; then
+if test $ac_compiler_gnu = "yes"; then
 	GccVersion=`$CXX -v 2>&1 | $AWK '{ if ($2 ~ /version/) print $3 }'`
 	GccVersion=`echo $GccVersion | $AWK 'BEGIN { FS = "."; } { printf "% d", ($1 * 1000 + $2) * 1000 + $3;}'`
 
@@ -173,7 +173,7 @@
 		AC_MSG_ERROR([freetype is required. Try --with-freetype-config.])
 	fi])
 
-if test $WX_GTK == "yes"; then
+if test $WX_GTK = "yes"; then
 	# GTK build, so call FTTEST function to test for FreeType
 	FTTEST
 	FT_CFLAGS="`$FTCONFIG --cflags`"
@@ -189,8 +189,8 @@
 			  )
 else
 	# non-GTK build, i.e., MacOS, so Pango and FreeType are not required
-	FT_CFLAGS = ""
-	PANGO_CFLAGS = ""
+	FT_CFLAGS=""
+	PANGO_CFLAGS=""
 fi
 
 TOPDIR=$srcdir;
--- configure.in.diff ends here ---

-- 
Vasil Dimov
gro.DSBeerF@dv

Testing can show the presence of bugs, but not their absence.
                -- Edsger W. Dijkstra