From: Ryan Schmidt Date: April 7, 2008 15:17:21 CDT To: Marco d'Itri Subject: whois 4.7.26 and -lcrypt on Mac OS X Hi Marco. I'm the maintainer of the whois port for MacPorts. I found that version 4.7.26 doesn't compile on Mac OS X: cc -DENABLE_NLS -I/opt/local/include -MM -MG *.c > Makefile.depend perl -w make_ip_del.pl < ip_del_list > ip_del.h perl -w make_ip6_del.pl < ip6_del_list > ip6_del.h perl -w make_as_del.pl < as_del_list > as_del.h perl -w make_tld_serv.pl < tld_serv_list > tld_serv.h cc -DENABLE_NLS -I/opt/local/include -O2 -c whois.c cc -DENABLE_NLS -I/opt/local/include -O2 -c utils.c cc -L/opt/local/lib -lintl -o whois whois.o utils.o cc -DENABLE_NLS -I/opt/local/include -O2 -c mkpasswd.c cc -L/opt/local/lib -lintl -lcrypt -o mkpasswd mkpasswd.o utils.o /usr/bin/ld: can't locate file for: -lcrypt collect2: ld returned 1 exit status make: *** [mkpasswd] Error 1 Seems you're now building mkpasswd by default, and to do this you're adding -lcrypt to the LDFLAGS, but Apple says this option is not supported in Mac OS X: http://developer.apple.com/technotes/tn2002/tn2071.html This message says -lcrypt can simply be omitted, since the crypt function is in Mac OS X's C library: http://lists.apple.com/archives/unix-porting/2005/Dec/msg00018.html So you should probably update your Makefile to not use -lcrypt on Mac OS X. I've already added a patchfile to our port that does this. Here is my ticket on this issue: http://trac.macosforge.org/projects/macports/ticket/14951 Thanks. -Ryan ============================================================================ From: md@Linux.IT (Marco d'Itri) Date: April 8, 2008 01:04:33 CDT To: Ryan Schmidt Subject: Re: whois 4.7.26 and -lcrypt on Mac OS X On Apr 07, Ryan Schmidt wrote: > So you should probably update your Makefile to not use -lcrypt on Mac OS > X. I've already added a patchfile to our port that does this. This would break it on other platforms. The package does not use autoconf, so you are supposed to tweak the Makefile for your platform. -- ciao, Marco ============================================================================ From: Ryan Schmidt Date: April 14, 2008 02:31:10 CDT To: Marco d'Itri Subject: Re: whois 4.7.26 and -lcrypt on Mac OS X On Apr 8, 2008, at 1:04 AM, Marco d'Itri wrote: > On Apr 07, Ryan Schmidt wrote: > >> So you should probably update your Makefile to not use -lcrypt on Mac OS >> X. I've already added a patchfile to our port that does this. > > This would break it on other platforms. Well sure, you shouldn't omit -lcrypt always. You should only omit it on the darwin platform. > The package does not use autoconf, so you are supposed to tweak the > Makefile for your platform. Ok. As I said, in MacPorts, I'm already tweaking the Makefile to not use -lcrypt on Mac OS X. I just thought you might want Mac users to be able to compile whois 4.7.26 without needing to make any changes to the source, as had been the case with 4.7.25 and earlier. But if not, I can keep the patch in the MacPorts portfile. -Ryan ============================================================================ From: md@Linux.IT (Marco d'Itri) Date: April 14, 2008 02:35:10 CDT To: Ryan Schmidt Subject: Re: whois 4.7.26 and -lcrypt on Mac OS X On Apr 14, Ryan Schmidt wrote: > Well sure, you shouldn't omit -lcrypt always. You should only omit it on > the darwin platform. How do you plan to do this without autoconf, exactly? -- ciao, Marco ============================================================================ From: Ryan Schmidt Date: April 14, 2008 02:45:37 CDT To: md@Linux.IT (Marco d'Itri) Subject: Re: whois 4.7.26 and -lcrypt on Mac OS X On Apr 14, 2008, at 2:35 AM, Marco d'Itri wrote: > On Apr 14, Ryan Schmidt wrote: > >> Well sure, you shouldn't omit -lcrypt always. You should only omit it on >> the darwin platform. > > How do you plan to do this without autoconf, exactly? Well I'm not really sure. I don't write compiled software, so you probably have more experience than me in that regard. If there's a way to run a program in a Makefile and do something based on its output, you could use the "uname" command, which returns the word "Darwin" on my system and would probably return something different on other operating systems. If it can't be done in a Makefile, you could write a tiny configure script which finds out the OS using uname and makes platform-specific changes to the Makefile if necessary. Anyway, I just wanted to be sure you're aware of the issue. MacPorts maintainers are encouraged to patch software as little as possible, instead reporting encountered problems upstream so they can be fixed there if appropriate. Since you're now aware of the situation, I'll leave it to you to handle in any way you see fit. -Ryan