splitted off swf.m4.
[swftools.git] / m4 / backticks.m4
diff --git a/m4/backticks.m4 b/m4/backticks.m4
new file mode 100644 (file)
index 0000000..520554b
--- /dev/null
@@ -0,0 +1,30 @@
+AC_DEFUN(RFX_CHECK_SYSTEM_BACKTICKS,
+[
+AC_MSG_CHECKING([whether system() can handle command substitution])
+AC_TRY_RUN([
+#include "stdlib.h"
+int main (int argc, char*argv[])
+{
+    return system("test `touch config.tmp2`");
+}
+], OK=OK,,CROSSCOMPILE=1)
+
+if test "x${OK}" = "xOK";then
+    test -f config.tmp2 || OK=
+fi
+
+if test "x${CROSSCOMPILE}" = "x1";then
+    OK=OK;
+fi
+if test "x${OK}" = "xOK";then
+rm -f config.tmp2
+AC_MSG_RESULT(yes)
+SYSTEM_BACKTICKS=1
+export SYSTEM_BACKTICKS
+AC_DEFINE_UNQUOTED(SYSTEM_BACKTICKS, 1)
+else
+AC_MSG_RESULT(no)
+fi
+])
+
+