Re: [gtk-list] Re: Using autoconf with GTK



On Tue, 27 Jul 1999 00:15:37 -0400, David Allen wrote:
> On Mon, Jul 26, 1999 at 09:05:00PM -0700, Arthur Jerijian wrote:
>> I run the risk of posting a FAQ here, but....

It *is* in the updated GTK FAQ, question 4.5.

[snip]

> Right off the top of my head, you might want to check into the AC_CHECK_LIB
> stuff to put into your configure.in for checking for libraries.

Except for GTK, which can be detected with the following macro:

  AM_PATH_GTK(1.2.0,,AC_MSG_ERROR(foobar needs GTK 1.2.x, sorry))

> What autoscan outputs is rarely completely sufficient for checking the 
> dependancies on your app, but at least it helps some, and saves you having
> to write the rules for things that are really common portability problems
> between UNIXen and so on.
> 
> Some quick examples:
> 
> Check for a header:
> AC_CHECK_HEADERS(unistd.h)
> 
> Check for a program:
> AC_CHECK_PROG(INSTALL, install, `which install`, `which cp`)

Install is a special program, better use the macro AM_PROG_INSTALL for
that. Here is an example from one of my project which tries to find the
SCIL_Image (an image processing library, see
http://www.tpd.tno.nl/TPD/smartsite64.html) mksysfunc utility:

  SCIL_ROOT="/usr/it/packages/scilimage14"
  SCIL_ARCH="Irix6n32"
  AC_PATH_PROG(SCIL_MKSYSFNC, mksysfnc, echo, ${SCIL_ROOT}/${SCIL_ARCH})

> And so on...see the www.gnu.org documentation.  Autoconf isn't too hard, but
> you do have to do some reading to get it to do things the way you want it to
> do them.

Right, autoconf is not difficult. The trick is to use it together with
automake: you get a lot of extra macro's, and you don't have to worry
about your Makefiles. Even more advanced use includes libtool, but I don't
think you need that at this stage...


Erik

-- 
J.A.K. (Erik) Mouw, Information and Communication Theory Group, Department
of Electrical Engineering, Faculty of Information Technology and Systems,
Delft University of Technology, PO BOX 5031,  2600 GA Delft, The Netherlands
Phone: +31-15-2785859  Fax: +31-15-2781843  Email J.A.K.Mouw@its.tudelft.nl
WWW: http://www-ict.its.tudelft.nl/~erik/




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