checking for specific versions of operating system

2005-08-23 Thread Simon Morgan
Hi, Versions of FreeBSD = 5.3 no longer link with -lkse and require -lpthread instead. I'm trying to add a check to an autoconf configure.in file to set THREAD_LIBS based on the version of FreeBSD the program is being compiled under. The program is using a case switch to check $host. I've done a

Re: checking for specific versions of operating system

2005-08-23 Thread Baurzhan Ismagulov
Hello Simon. On Tue, Aug 23, 2005 at 11:47:21AM +0100, Simon Morgan wrote: Versions of FreeBSD = 5.3 no longer link with -lkse and require -lpthread instead. Trying -lpthread, if not available, trying -lkse? With kind regards, Baurzhan. ___

Re: checking for specific versions of operating system

2005-08-23 Thread Stepan Kasal
Hello, On Tue, Aug 23, 2005 at 03:36:57PM +0100, Simon Morgan wrote: On 8/23/05, Baurzhan Ismagulov [EMAIL PROTECTED] wrote: Trying -lpthread, if not available, trying -lkse? That sounds like a better idea than simply checking the OS version but unfortunately I have no idea how to

Re: checking for specific versions of operating system

2005-08-23 Thread Ralf Wildenhues
Hi Simon, Baurzhan, * Baurzhan Ismagulov wrote on Tue, Aug 23, 2005 at 04:21:11PM CEST: On Tue, Aug 23, 2005 at 11:47:21AM +0100, Simon Morgan wrote: Versions of FreeBSD = 5.3 no longer link with -lkse and require -lpthread instead. Trying -lpthread, if not available, trying -lkse? I'd

Re: checking for specific versions of operating system

2005-08-23 Thread Simon Morgan
On 8/23/05, Ralf Wildenhues [EMAIL PROTECTED] wrote: I'd try to get the ACX_PTHREAD macro from the autoconf archive and work with that. Any of its shortcomings should be discussed with its maintainer (or on this list, FWIW) and incorporated into an improved version of the macro. That way,

Re: checking for specific versions of operating system

2005-08-23 Thread Baurzhan Ismagulov
On Tue, Aug 23, 2005 at 03:36:57PM +0100, Simon Morgan wrote: On 8/23/05, Baurzhan Ismagulov [EMAIL PROTECTED] wrote: Trying -lpthread, if not available, trying -lkse? That sounds like a better idea than simply checking the OS version but unfortunately I have no idea how to implement such

Re: checking for specific versions of operating system

2005-08-23 Thread Simon Morgan
On 8/23/05, Baurzhan Ismagulov [EMAIL PROTECTED] wrote: It isn't guaranteed that the user has -lkse, and you don't check for it. Well that check is inside a check for FreeBSD, and if it doesn't have pthread then it should have kse. Or am I missing something?

Re: checking for specific versions of operating system

2005-08-23 Thread Baurzhan Ismagulov
On Tue, Aug 23, 2005 at 03:56:12PM +0100, Simon Morgan wrote: AC_CHECK_LIB(pthread,pthread_create,THREAD_LIBS=-lpthread,THREAD_LIBS=-lkse) which seems to work. Can you or anybody else with more experience than me see any problems with it? It isn't guaranteed that the user has -lkse, and you

Re: checking for specific versions of operating system

2005-08-23 Thread Albert Chin
On Tue, Aug 23, 2005 at 03:56:12PM +0100, Simon Morgan wrote: On 8/23/05, Ralf Wildenhues [EMAIL PROTECTED] wrote: I'd try to get the ACX_PTHREAD macro from the autoconf archive and work with that. Any of its shortcomings should be discussed with its maintainer (or on this list, FWIW) and

Re: checking for specific versions of operating system

2005-08-23 Thread Bob Friesenhahn
On Tue, 23 Aug 2005, Ralf Wildenhues wrote: Trying -lpthread, if not available, trying -lkse? I'd try to get the ACX_PTHREAD macro from the autoconf archive and work with that. Any of its shortcomings should be discussed with its maintainer (or on this list, FWIW) and incorporated into an

Re: checking for specific versions of operating system

2005-08-23 Thread Stepan Kasal
Hello, On Tue, Aug 23, 2005 at 04:53:58PM +0200, Baurzhan Ismagulov wrote: AC_CHECK_LIB(lib1, func, [LDFLAGS=-llib1], []) if [ -z $LDFLAGS ]; then AC_CHECK_LIB(lib2, func, [LDFLAGS=-llib2], [ echo $0: Need lib1 or lib2 2 exit 2 ]) fi several comments: 1)

Re: checking for specific versions of operating system

2005-08-23 Thread Baurzhan Ismagulov
Hello Stepan, On Tue, Aug 23, 2005 at 06:25:47PM +0200, Stepan Kasal wrote: several comments: 1) AC_MSG_ERROR is better than echo 2) you should use LIBS, not LDFLAGS for -l flags 3) in the example you show, one call to AC_SEARCH_LIBS might be better. (But I don't know your real code,

Re: checking for specific versions of operating system

2005-08-23 Thread Harlan Stenn
I use things like this: AC_CHECK_FUNC(gethostent, , AC_CHECK_LIB(nsl, gethostent, , , -lsocket)) AC_CHECK_FUNC(openlog, , AC_CHECK_LIB(gen, openlog, , AC_CHECK_LIB(syslog, openlog, , , -lsocket))) in case that's useful to anybody... H ___

Re: checking for specific versions of operating system

2005-08-23 Thread Bob Friesenhahn
On Tue, 23 Aug 2005, Baurzhan Ismagulov wrote: On Tue, Aug 23, 2005 at 06:25:47PM +0200, Stepan Kasal wrote: several comments: 1) AC_MSG_ERROR is better than echo 2) you should use LIBS, not LDFLAGS for -l flags 3) in the example you show, one call to AC_SEARCH_LIBS might be better. (But I

Re: checking for specific versions of operating system

2005-08-23 Thread Andreas Schwab
Harlan Stenn [EMAIL PROTECTED] writes: I use things like this: AC_CHECK_FUNC(gethostent, , AC_CHECK_LIB(nsl, gethostent, , , -lsocket)) AC_CHECK_FUNC(openlog, , AC_CHECK_LIB(gen, openlog, , AC_CHECK_LIB(syslog, openlog, , , -lsocket))) Always quote nested macro calls. Actually, _all_

Re: checking for specific versions of operating system

2005-08-23 Thread Andre Caldas
Hello! It isn't guaranteed that the user has -lkse, and you don't check for it. Well that check is inside a check for FreeBSD, and if it doesn't have pthread then it should have kse. Or am I missing something? Your script will not be really robust, because you are making such