Received: from ritchie.wplus.net (relay.wplus.net [195.131.52.179]) by hub.org (8.9.3/8.9.3) with ESMTP id LAA40758 for ; Thu, 29 Jul 1999 11:52:07 -0400 (EDT) (envelope-from dms@woland.wplus.net) Received: from woland.wplus.net (woland.wplus.net [195.131.0.39]) by ritchie.wplus.net (8.9.1/8.9.1/wplus.2) with ESMTP id TAA23397; Thu, 29 Jul 1999 19:52:02 +0400 (MSK/MSD) X-Real-To: pgsql-hackers@postgresql.org Received: (from dms@localhost) by woland.wplus.net (8.9.2/8.9.1/wplus.2) id TAA02048; Thu, 29 Jul 1999 19:52:00 +0400 (MSD) Message-ID: X-Mailer: XFMail 1.3 [p0] on FreeBSD X-Priority: 3 (Normal) Content-Type: text/plain; charset=KOI8-R Content-Transfer-Encoding: 8bit MIME-Version: 1.0 In-Reply-To: <199907291459.QAA10044@roadrunner.pvk.openlinksw.com> Date: Thu, 29 Jul 1999 19:52:00 +0400 (MSD) Sender: dms@woland.wplus.net From: Dmitry Samersoff To: Patrick van Kleef Subject: Re: [HACKERS] Off-topic: autoconf guru Cc: pgsql-hackers@postgresql.org On 29-Jul-99 Patrick van Kleef wrote: > Hi Dmitry, > > Autoconf can do this out of the box. With the macros AC_LANG_C and > AC_LANG_CPLUSPLUS you can switch between C and C++ compiler mode. Here > is a small example based on the snippet you provided: Thank you very match !!!! It is exactly what I need for !!! > > > AC_PREREQ(2.12) > AC_INIT(configure.in) > > # > # Check which C and C++ compiler to use > # > AC_PROG_CC > AC_PROG_CXX > > # > # The following checks are done with the C compiler > # > AC_LANG_C > > AC_CHECK_FUNC(accept) > > > # > # Now switch over to the C++ compiler for the next test > # > AC_LANG_CPLUSPLUS > > AC_MSG_CHECKING(socket size type) > AC_TRY_COMPILE([#include > #include > #include > ], > [int a = accept(1, (struct sockaddr *) 0, (int *) 0);], > [AC_DEFINE(SOCKET_SIZE_TYPE, int) AC_MSG_RESULT(int)], > [AC_DEFINE(SOCKET_SIZE_TYPE, size_t) AC_MSG_RESULT(size_t)]) > > # > # Switch back to C mode again > # > AC_LANG_C > > AC_OUTPUT() > > > Best regards, > > Patrick > -- > Patrick van Kleef > pkleef@roady.xs4all.nl --- Dmitry Samersoff, dms@wplus.net, ICQ:3161705 http://devnull.wplus.net * There will come soft rains ...