1 # FP_CPP_CMD_WITH_ARGS()
2 # ----------------------
3 # sets CPP command and its arguments
6 # $2 = the variable to set to CPP command
7 # $3 = the variable to set to CPP command arguments
9 # The reason for using the non-standard --with-cpp and --with-cpp-flags instead
10 # of the standard CPP and CPPFLAGS is that autoconf sets CPP to "$CC -E",
11 # whereas we expect the CPP command to be configured as a standalone executable
12 # rather than a command. These are symmetrical with --with-hs-cpp and
13 # --with-hs-cpp-flags.
14 AC_DEFUN([FP_CPP_CMD_WITH_ARGS],[
17 [AS_HELP_STRING([--with-cpp=ARG],
18 [Path to the (C) preprocessor [default=autodetect].
19 If you set --with-cpp=CC, ensure -E is included in --with-cpp-flags])],
21 if test "$HostOS" = "mingw32"
23 AC_MSG_WARN([Request to use $withval will be ignored])
29 # We can't use the CPP var here, since CPP_CMD is expected to be a single
30 # command (no flags), and autoconf defines CPP as "/usr/bin/gcc -E".
31 # So we use CC with -E by default
37 AC_ARG_WITH(cpp-flags,
38 [AS_HELP_STRING([--with-cpp-flags=ARG],
39 [Flags to the (C) preprocessor [default=autodetect]])],
41 if test "$HostOS" = "mingw32"
43 AC_MSG_WARN([Request to use $withval will be ignored])
45 # Use whatever flags were manually set, ignoring previously configured
46 # flags; and add CPP_ARGS (which will be -E if CPP_CMD was not specified)
47 CPP_ARGS="$CPP_ARGS $withval"
48 USER_CPP_ARGS="$withval"
52 # Augment CPP_ARGS with whatever flags were previously configured and passed
54 CPP_ARGS="$$3 $CPP_ARGS"
60 # Clear CPP_CMD and CPP_ARGS