2 # Add a pre-defined string constant to \$PSI_CONSTS
4 grep -Fq "\"psi\\\\\$1\"" \$PSI_CONSTS \
5 || cat >>\$PSI_CONSTS <<EOF
6 {PSI_T_STRING, "string", "psi\\\\\$1", \$2, PSI_T_QUOTED_STRING},
7 EOF
8 }
11 # Add a pre-defined int constant to \$PSI_CONSTS
13 grep -Fq "\"psi\\\\\$1\"" \$PSI_CONSTS \
14 || cat >>\$PSI_CONSTS <<EOF
15 {PSI_T_INT, "int", "psi\\\\\$1", "\$2", PSI_T_NUMBER},
16 EOF
17 }
19 dnl PSI_CONST(const name, type)
20 dnl Check the value of a str/int constant and add it to the list of pre-defined
21 dnl constants.
22 AC_DEFUN(PSI_CONST, [
23 AC_CACHE_CHECK(value of \$1, psi_cv_const_\$1, [
24 psi_const_val=
25 case \$2 in
26 str*)
27 if test "\$cross_compiling" = "yes"
28 then
29 AC_TRY_CPP(PSI_INCLUDES \$1, psi_const_val=`eval "\$ac_try|tail -n1"`, psi_const_val=)
30 else
31 PSI_COMPUTE_STR(psi_const_val, \$1, PSI_INCLUDES)
32 fi
33 ;;
34 int)
35 AC_COMPUTE_INT(psi_const_val, \$1, PSI_INCLUDES)
36 ;;
37 esac
38 psi_cv_const_\$1=\$psi_const_val
39 ])
40 if test "\$psi_cv_const_\$1"
41 then
42 case \$2 in
43 str*)