+ hard=
+ if test -z "$hard"; then
+ msg="C to warn about writing to stringliterals"
+ else
+ msg="C to prohibit any write to stringliterals"
+ fi
+ echo $ac_n "checking $msg""... $ac_c" 1>&6
+echo "configure:1546: checking $msg" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_cc_no_writeable_strings'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+
+ cat > conftest.c <<EOF
+#include <string.h>
+int main (void)
+{
+ char test[16];
+ if (strcpy (test, "test")) return 0;
+ return 1;
+}
+EOF
+ if test "$GCC" = "yes";
+ then
+ if test -z "$hard"; then
+ ac_cv_prog_cc_no_writeable_strings="-Wwrite-strings"
+ else
+ ac_cv_prog_cc_no_writeable_strings="-fno-writable-strings -Wwrite-strings"
+ fi
+
+ if test -n "`${CC-cc} -c $ac_cv_prog_cc_no_writeable_strings conftest.c 2>&1`" ; then
+ ac_cv_prog_cc_no_writeable_strings="suppressed: string.h"
+ fi
+
+ elif $CC -flags 2>&1 | grep "Xc.*strict ANSI C" > /dev/null 2>&1 &&
+ $CC -c -xstrconst conftest.c > /dev/null 2>&1 &&
+ test -f conftest.o
+ then
+ # strings go into readonly segment
+ ac_cv_prog_cc_no_writeable_strings="-xstrconst"
+
+ rm conftest.o
+ if test -n "`${CC-cc} -c $ac_cv_prog_cc_no_writeable_strings conftest.c 2>&1`" ; then
+ ac_cv_prog_cc_no_writeable_strings="suppressed: string.h"
+ fi
+
+ elif $CC > /dev/null 2>&1 &&
+ $CC -c +ESlit conftest.c > /dev/null 2>&1 &&
+ test -f conftest.o
+ then
+ # strings go into readonly segment
+ ac_cv_prog_cc_no_writeable_strings="+ESlit"
+
+ rm conftest.o
+ if test -n "`${CC-cc} -c $ac_cv_prog_cc_no_writeable_strings conftest.c 2>&1`" ; then
+ ac_cv_prog_cc_no_writeable_strings="suppressed: string.h"
+ fi
+
+ elif ! $CC > /dev/null 2>&1 &&
+ $CC -c -readonly_strings conftest.c > /dev/null 2>&1 &&
+ test -f conftest.o
+ then
+ # strings go into readonly segment
+ ac_cv_prog_cc_no_writeable_strings="-readonly_strings"
+
+ rm conftest.o
+ if test -n "`${CC-cc} -c $ac_cv_prog_cc_no_writeable_strings conftest.c 2>&1`" ; then
+ ac_cv_prog_cc_no_writeable_strings="suppressed: string.h"
+ fi
+
+
+ # -use_readonly_const is the default for IRIX C,
+ # puts them into .rodata, but they are copied later.
+ # need to be "-G0 -rdatashared" for strictmode but
+ # I am not sure what effect that has really.
+
+ fi
+ rm -f conftest.*
+
+fi
+
+echo "$ac_t""$ac_cv_prog_cc_no_writeable_strings" 1>&6
+ if test -z "$WRITESTRINGS" ; then
+ if test -n "$ac_cv_prog_cc_no_writeable_strings" ; then
+ case "$ac_cv_prog_cc_no_writeable_strings" in
+ suppressed*) WRITESTRINGS="" ;; # known but suppressed
+ *) WRITESTRINGS="$ac_cv_prog_cc_no_writeable_strings" ;;
+ esac
+ fi
+ fi
+
+
+