autoconf
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: default searchpaths on *BSD machines?


From: Bob Friesenhahn
Subject: Re: default searchpaths on *BSD machines?
Date: Sun, 15 Apr 2012 17:53:20 -0500 (CDT)
User-agent: Alpine 2.01 (GSO 1266 2009-07-14)

On Mon, 16 Apr 2012, Miles Bader wrote:

I notice that FreeBSD (etc) put a lot of optionally installed
("/usr/ports") software in /usr/local, but the system compiler's
search-paths on these machines by default _don't_ include
/usr/local...

So my autoconf'd project doesn't find various libraries, even if the
user thought he had installed them.

What's the usual way to handle this issue...?

 1) Add /usr/local to paths by default
 (e.g. CPPFLAGS+=-I/usr/local/include, LDFLAGS+=-L/usr/local/lib)

The approach I use is to create a /usr/local/share/config.site file with this content:

#=========================================
# config.site for configure
#

# Change some defaults.

test "$prefix" = NONE && prefix=/usr/local

CFLAGS_DEFAULT='-O2'
CXXFLAGS_DEFAULT='-O'

CPPFLAGS_DEFAULT="-I/usr/local/include"
LDFLAGS_DEFAULT="-L/usr/local/lib"
LIBS_DEFAULT=

set -a          # Auto-export environment variables

if test "${ac_env_CC_set}" != set
then
  CC="$CC_DEFAULT"
fi

if test "${ac_env_CXX_set}" != set
then
  CXX="$CXX_DEFAULT"
fi

if test "${ac_env_CFLAGS_set}" != set
then
  CFLAGS="$CFLAGS_DEFAULT"
fi

if test "${ac_env_CXXFLAGS_set}" != set
then
  CXXFLAGS="$CXXFLAGS_DEFAULT"
fi

if test "${ac_env_CPPFLAGS_set}" != set
then
  CPPFLAGS="$CPPFLAGS_DEFAULT"
fi

if test "${ac_env_LDFLAGS_set}" = set
then
  LDFLAGS="$LDFLAGS $LDFLAGS_DEFAULT"
else
  LDFLAGS="$LDFLAGS_DEFAULT"
fi

set +a          # Stop auto-exporting variables

echo "CC       = \"$CC\""
echo "CXX      = \"$CXX\""
echo "CFLAGS   = \"$CFLAGS\""
echo "CXXFLAGS = \"$CXXFLAGS\""
echo "CPPFLAGS = \"$CPPFLAGS\""
echo "LDFLAGS  = \"$LDFLAGS\""
#=========================================

--
Bob Friesenhahn
address@hidden, http://www.simplesystems.org/users/bfriesen/
GraphicsMagick Maintainer,    http://www.GraphicsMagick.org/



reply via email to

[Prev in Thread] Current Thread [Next in Thread]