cURL / Mailing Lists / curl-users / Single Mail

curl-users

Re: autoconf/makefile problem

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Fri, 4 Jul 2003 19:14:32 +0200 (CEST)

On Wed, 2 Jul 2003, Dan Grayson wrote:

> Oops, you're right. Here is the offending line from lib/ca-bundle.h.
>
> #define CURL_CA_BUNDLE "${prefix}/share/curl/curl-ca-bundle.crt"
>
> But the problem is a standard one, and the solution is addressed in the info
> page for autoconf:
>
> A corollary is that you should not use these variables except in
> Makefiles. For instance, instead of trying to evaluate `datadir' in
> `configure' and hard-coding it in Makefiles using e.g.,
> `AC_DEFINE_UNQUOTED(DATADIR, "$datadir")', you should add
> `-DDATADIR="$(datadir)"' to your `CPPFLAGS'.

Yeah, that was easy until they came up with libtool. libtool is very good at
stripping off those extra quotes (") around the string before it invokes the
compiler and... yeah, it screws things up.

I'm not saying you're wrong, I just can't get that to work. :-( I've tried
doing it like this:

AC_HELP_STRING([--without-ca-bundle], [Don't install the CA bundle]),
   [ ca="$withval" ],
   [
  if test "x$prefix" != xNONE; then
    ca="\${prefix}/share/curl/curl-ca-bundle.crt"
  else
    ca="$ac_default_prefix/share/curl/curl-ca-bundle.crt"
  fi
   ] )

if test X"$OPT_SSL" = Xno
then
  ca="no"
fi

if test "x$ca" = "xno"; then
  dnl let's not keep "no" as path name, blank it instead
  ca=""
  AC_MSG_RESULT([none])
else
  CURL_CA_BUNDLE='"'$ca'"'
  CPPFLAGS="$CPPFLAGS -DCURL_CA_BUNDLE=$CURL_CA_BUNDLE"
  AC_SUBST(CURL_CA_BUNDLE)
  AC_MSG_RESULT([$ca])
fi

-- 
 Daniel Stenberg -- curl: been grokking URLs since 1998
-------------------------------------------------------
This SF.Net email sponsored by: Free pre-built ASP.NET sites including
Data Reports, E-commerce, Portals, and Forums are available now.
Download today and enter to win an XBOX or Visual Studio .NET.
http://aspnet.click-url.com/go/psa00100006ave/direct;at.asp_061203_01/01
Received on 2003-07-04