source: branches/variant-descs-14482/base/aclocal.m4 @ 42663

Last change on this file since 42663 was 42567, checked in by blb@…, 12 years ago

Merged revisions 41015-41016,41030,41056,41068,41097,41123,41157,41166-41167,41170,41174-41175,41249,41379,41388-41389,41396,41404,41478-41479,41511-41512,41522-41527,41541,41573-41575,41595,41603,41637-41639,41650-41651,41655,41701-41702,41742,41841,41850,41854-41855,41907,41978,42055,42061,42134,42484 via svnmerge from
https://svn.macports.org/repository/macports/trunk/base

........

r41015 | afb@… | 2008-10-20 16:56:28 -0600 (Mon, 20 Oct 2008) | 2 lines


make tclobjc package conditional

........

r41016 | afb@… | 2008-10-20 16:57:00 -0600 (Mon, 20 Oct 2008) | 2 lines


regenerate configure

........

r41030 | afb@… | 2008-10-21 01:27:26 -0600 (Tue, 21 Oct 2008) | 2 lines


update changelog for r41015

........

r41056 | raimue@… | 2008-10-21 08:35:03 -0600 (Tue, 21 Oct 2008) | 3 lines


port/port.tcl:
Remove empty TODO tag

........

r41068 | blb@… | 2008-10-21 22:19:29 -0600 (Tue, 21 Oct 2008) | 2 lines


mirror_sites.tcl - clean out a couple more bad mirrors, found via distcheck

........

r41097 | devans@… | 2008-10-22 17:03:00 -0600 (Wed, 22 Oct 2008) | 2 lines


mirror_sites.tcl: add definition for gimp mirror site.

........

r41123 | jmr@… | 2008-10-24 02:48:57 -0600 (Fri, 24 Oct 2008) | 3 lines


Change documentation of uninstall --recursive to --follow-dependents, to match
the change made to the code in r36160.

........

r41157 | jmr@… | 2008-10-26 06:56:11 -0600 (Sun, 26 Oct 2008) | 2 lines


Apply global variants for all targets (#11897)

........

r41166 | blb@… | 2008-10-26 18:01:47 -0600 (Sun, 26 Oct 2008) | 2 lines


ChangeLog - there will be no 1.6.1, so those changes will also be in 1.7.0

........

r41167 | blb@… | 2008-10-26 19:07:22 -0600 (Sun, 26 Oct 2008) | 2 lines


ChangeLog - add closed 1.7.0 milestone tickets not already noted

........

r41170 | ryandesign@… | 2008-10-26 19:32:41 -0600 (Sun, 26 Oct 2008) | 2 lines


portlint.tcl: No longer nitpick whitespace or patchfile names unless the nitpick option is enabled. There is currently no way to enable this option. A future revision should provide a way to do so. See issue #14799.

........

r41174 | ryandesign@… | 2008-10-26 19:48:47 -0600 (Sun, 26 Oct 2008) | 2 lines


Set svn:eol-style to native on tcl files.

........

r41175 | ryandesign@… | 2008-10-26 19:49:23 -0600 (Sun, 26 Oct 2008) | 2 lines


Set svn:keywords to Id on tcl files

........

r41249 | pguyot@… | 2008-10-29 03:17:40 -0600 (Wed, 29 Oct 2008) | 2 lines


Add support for +universal variants with the xcode portgroup

........

r41379 | jmr@… | 2008-10-31 23:49:19 -0600 (Fri, 31 Oct 2008) | 2 lines


Document the new Norwegian mirror in the relevant config files.

........

r41388 | afb@… | 2008-11-01 04:20:52 -0600 (Sat, 01 Nov 2008) | 2 lines


make sure to expand default prefix (from NONE)

........

r41389 | afb@… | 2008-11-01 04:21:17 -0600 (Sat, 01 Nov 2008) | 2 lines


regenerate configure

........

r41396 | raimue@… | 2008-11-01 13:12:44 -0600 (Sat, 01 Nov 2008) | 4 lines


port/port.tcl:
Add proc wraplabel which outputs a wrapped string with a label. Use the new
wrapping code for output of deps, platforms and maintainers.

........

r41404 | raimue@… | 2008-11-01 16:39:42 -0600 (Sat, 01 Nov 2008) | 3 lines


port1.0/portlivecheck.tcl:
Fix livecheck if using https with invalid certificates, passive ftp, or username and password

........

r41478 | toby@… | 2008-11-03 23:37:10 -0700 (Mon, 03 Nov 2008) | 2 lines


set CURLOPT_MAXREDIRS to 50 to avoid infinite redirection

........

r41479 | jmr@… | 2008-11-03 23:49:20 -0700 (Mon, 03 Nov 2008) | 2 lines


Add new Norwegian distfiles mirror.

........

r41511 | blb@… | 2008-11-04 19:50:05 -0700 (Tue, 04 Nov 2008) | 2 lines


lint command - add --nitpick option; ticket #14799

........

r41512 | blb@… | 2008-11-04 20:18:28 -0700 (Tue, 04 Nov 2008) | 2 lines


port.1 - document --nitpick option added in r41511

........

r41522 | pguyot@… | 2008-11-05 06:33:22 -0700 (Wed, 05 Nov 2008) | 2 lines


Fixed expectations in tests to reflect changes in the code (obviously tests are simply not run)

........

r41523 | pguyot@… | 2008-11-05 06:35:27 -0700 (Wed, 05 Nov 2008) | 2 lines


Add a test that was sleeping on my disk, and that illustrates a buggy behaviour with variants

........

r41524 | pguyot@… | 2008-11-05 06:41:54 -0700 (Wed, 05 Nov 2008) | 2 lines


Include the forgotten test

........

r41525 | pguyot@… | 2008-11-05 06:42:13 -0700 (Wed, 05 Nov 2008) | 2 lines


Partial fix for test trace

........

r41526 | pguyot@… | 2008-11-05 06:45:07 -0700 (Wed, 05 Nov 2008) | 2 lines


Handle new syntax for dependencies, to allow work for dependencies to happen on trunk/ where ports lie, while base/ is frozen for most users (cf bug #126)

........

r41527 | pguyot@… | 2008-11-05 07:38:06 -0700 (Wed, 05 Nov 2008) | 2 lines


Fix switch statement (put comment before the statement) and add a test to check for that

........

r41541 | ryandesign@… | 2008-11-05 15:21:41 -0700 (Wed, 05 Nov 2008) | 2 lines


port.1: --nitpick also checks patchfile names

........

r41573 | ryandesign@… | 2008-11-06 03:44:45 -0700 (Thu, 06 Nov 2008) | 2 lines


portutil.tcl: Fix reinplace for filenames containing spaces; fixes #17098

........

r41574 | ryandesign@… | 2008-11-06 03:50:06 -0700 (Thu, 06 Nov 2008) | 2 lines


ChangeLog: Add note for issue #17098

........

r41575 | ryandesign@… | 2008-11-06 03:52:18 -0700 (Thu, 06 Nov 2008) | 2 lines


ChangeLog: Remove trailing whitespace.

........

r41595 | blb@… | 2008-11-06 13:43:18 -0700 (Thu, 06 Nov 2008) | 2 lines


ChangeLog - note port lint improvements from #14799

........

r41603 | blb@… | 2008-11-06 19:48:44 -0700 (Thu, 06 Nov 2008) | 8 lines


base/src/pextlib1.0/Pextlib.c - this should get the edge case issues of
the Tcl environment bug (#13930); basically, looping through environ while
unsetting stuff changes environ, so not all variables are caught.
clearenv() if it becomes a standard would be best for this, but is not
available everywhere (including Mac OS X/Darwin), so instead use a simple
technique that has been found to work on a number of various platforms (see
<http://lists.freebsd.org/pipermail/freebsd-stable/2008-June/043136.html>).

........

r41637 | blb@… | 2008-11-07 14:00:43 -0700 (Fri, 07 Nov 2008) | 2 lines


pextlib1.0/tests/unsetenv.tcl - remove some spaces on empty lines

........

r41638 | blb@… | 2008-11-07 14:06:17 -0700 (Fri, 07 Nov 2008) | 4 lines


pextlib1.0/tests/unsetenv.tcl - add test for verifying 'unsetenv *' does
empty out the environment; use 'error' instead of 'exit' so the cause for
a failure is shown

........

r41639 | blb@… | 2008-11-07 14:09:31 -0700 (Fri, 07 Nov 2008) | 5 lines


pextlib1.0/Pextlib.c - it turns out Tcl gets a little confused when items
in the environment are removed (either via the complete clear or using
unsetenv()), so we need to force Tcl to sync back with the environment
after changing it (follow up to #13930)

........

r41650 | blb@… | 2008-11-08 02:05:33 -0700 (Sat, 08 Nov 2008) | 8 lines


pextlib1.0/Pextlib.c - move away from "environ = calloc(1, sizeof(char *));"
as that appears to tickle some memory bug on Mac OS X 10.4 tclsh which then
causes apparently-random crashes. Instead, create a list of which variables
are set in the environment, storing in a Tcl list (since that's much easier
for a dynamic list like this), then loop through that list and unsetenv()
each one. No crashing on 10.3-10.5 and tests/unsetenv.tcl pass (hopefully
final bit for #13930).

........

r41651 | afb@… | 2008-11-08 02:33:01 -0700 (Sat, 08 Nov 2008) | 2 lines


use clearenv(3) where available

........

r41655 | toby@… | 2008-11-08 03:50:42 -0700 (Sat, 08 Nov 2008) | 5 lines


SystemCmd:

  • fix major leak (circbuf only freed when command exited non-zero)
  • fix fd leak
  • minor refactoring

........

r41701 | ryandesign@… | 2008-11-09 02:25:36 -0700 (Sun, 09 Nov 2008) | 2 lines


portindex.tcl: Generate the port index in a temporary file first, then replace the PortIndex file all at once; fixes #16234

........

r41702 | ryandesign@… | 2008-11-09 02:28:13 -0700 (Sun, 09 Nov 2008) | 2 lines


ChangeLog: update for issue #16234 (atomic PortIndex regeneration)

........

r41742 | raimue@… | 2008-11-09 19:43:42 -0700 (Sun, 09 Nov 2008) | 4 lines


pextlib1.0/tests/curl.tcl:
The old password protected file no longer exists, use another file from the
same server.

........

r41841 | toby@… | 2008-11-10 19:43:25 -0700 (Mon, 10 Nov 2008) | 2 lines


make setrlimit stop complaining

........

r41850 | ryandesign@… | 2008-11-11 01:44:01 -0700 (Tue, 11 Nov 2008) | 2 lines


portimage.tcl: fix typo in comment

........

r41854 | ryandesign@… | 2008-11-11 02:23:45 -0700 (Tue, 11 Nov 2008) | 2 lines


Registry: Properly handle ports whose version evaluates to 0; see #16740

........

r41855 | ryandesign@… | 2008-11-11 02:27:17 -0700 (Tue, 11 Nov 2008) | 2 lines


receipt_flat.tcl: fix typo in error message

........

r41907 | ryandesign@… | 2008-11-11 21:42:24 -0700 (Tue, 11 Nov 2008) | 2 lines


preflight: fix typo in dp2mp-move code introduced in r26518.

........

r41978 | ryandesign@… | 2008-11-12 16:59:39 -0700 (Wed, 12 Nov 2008) | 2 lines


ChangeLog: add note for ticket #16740

........

r42055 | blb@… | 2008-11-14 00:12:06 -0700 (Fri, 14 Nov 2008) | 2 lines


ChangeLog - note change from ticket #12288

........

r42061 | toby@… | 2008-11-14 01:54:14 -0700 (Fri, 14 Nov 2008) | 2 lines


leak fix

........

r42134 | blb@… | 2008-11-15 18:00:02 -0700 (Sat, 15 Nov 2008) | 2 lines


fetch/mirror_sites.tcl - fix path for a CPAN mirror, ticket #17262

........

r42484 | mcalhoun@… | 2008-11-21 19:54:44 -0700 (Fri, 21 Nov 2008) | 3 lines


group/perl5-1.0.tcl: Change perl dependency from path:...:perl5.8 to path:bin/perl:perl5 (see #16830).
bin/perl is used instead of the full path until #17182 is fixed.

........

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 26.7 KB
Line 
1dnl $Id: aclocal.m4 42567 2008-11-24 09:14:55Z blb@macports.org $
2builtin(include,m4/tcl.m4)
3builtin(include,m4/objc.m4)
4builtin(include,m4/pthread.m4)
5builtin(include,m4/foundation.m4)
6
7#------------------------------------------------------------------------
8# MP_CHECK_FRAMEWORK_COREFOUNDATION --
9#
10#       Check if CoreFoundation framework is available, define HAVE_FRAMEWORK_COREFOUNDATION if so.
11#
12# Arguments:
13#       None.
14#
15# Requires:
16#       None.
17#
18# Depends:
19#               AC_LANG_PROGRAM
20#
21# Results:
22#       Result is cached.
23#
24#       If CoreFoundation framework is available, defines the following variables:
25#               HAVE_FRAMEWORK_COREFOUNDATION
26#
27#------------------------------------------------------------------------
28AC_DEFUN(MP_CHECK_FRAMEWORK_COREFOUNDATION, [
29        FRAMEWORK_LIBS="-framework CoreFoundation"
30
31        AC_MSG_CHECKING([for CoreFoundation framework])
32
33        AC_CACHE_VAL(mp_cv_have_framework_corefoundation, [
34                ac_save_LIBS="$LIBS"
35                LIBS="$FRAMEWORK_LIBS $LIBS"
36               
37                AC_LINK_IFELSE([
38                        AC_LANG_PROGRAM([
39                                        #include <CoreFoundation/CoreFoundation.h>
40                                ], [
41                                        CFURLRef url = CFURLCreateWithFileSystemPath(NULL, CFSTR("/testing"), kCFURLPOSIXPathStyle, 1);
42                                        CFArrayRef bundles = CFBundleCreateBundlesFromDirectory(NULL, url, CFSTR("pkg"));
43                        ])
44                        ], [
45                                mp_cv_have_framework_corefoundation="yes"
46                        ], [
47                                mp_cv_have_framework_corefoundation="no"
48                        ]
49                )
50
51                LIBS="$ac_save_LIBS"
52        ])
53
54        AC_MSG_RESULT(${mp_cv_have_framework_corefoundation})
55
56        if test x"${mp_cv_have_framework_corefoundation}" = "xyes"; then
57                AC_DEFINE([HAVE_FRAMEWORK_COREFOUNDATION], [], [Define if CoreFoundation framework is available])
58        fi
59
60        AC_SUBST(HAVE_FRAMEWORK_COREFOUNDATION)
61])
62
63
64#------------------------------------------------------------------------
65# MP_CHECK_FUNCTION_CFNOTIFICATIONCENTERGETDARWINNOTIFYCENTER --
66#
67#       Check if if the routine CFNOTIFICATIONCENTERGETDARWINNOTIFYCENTER
68#       is available in CoreFoundation.
69#
70# Arguments:
71#       None.
72#
73# Requires:
74#       None.
75#
76# Depends:
77#               AC_LANG_PROGRAM
78#
79# Results:
80#       Result is cached.
81#
82#       If function CFNotificationCenterGetDarwinNotifyCenter is in the CoreFoundation framework, defines the following variables:
83#               HAVE_FUNCTION_CFNOTIFICATIONCENTERGETDARWINNOTIFYCENTER
84#
85#------------------------------------------------------------------------
86AC_DEFUN(MP_CHECK_FUNCTION_CFNOTIFICATIONCENTERGETDARWINNOTIFYCENTER, [
87        FRAMEWORK_LIBS="-framework CoreFoundation"
88
89        AC_MSG_CHECKING([for CFNotificationCenterGetDarwinNotifyCenter])
90
91        AC_CACHE_VAL(mp_cv_have_function_cfnotificationcentergetdarwinnotifycenter, [
92                ac_save_LIBS="$LIBS"
93                LIBS="$FRAMEWORK_LIBS $LIBS"
94               
95                AC_LINK_IFELSE([
96                        AC_LANG_PROGRAM([
97                                        #include <CoreFoundation/CoreFoundation.h>
98                                ], [
99                                        CFNotificationCenterRef ref = CFNotificationCenterGetDarwinNotifyCenter();
100                        ])
101                        ], [
102                                mp_cv_have_function_cfnotificationcentergetdarwinnotifycenter="yes"
103                        ], [
104                                mp_cv_have_function_cfnotificationcentergetdarwinnotifycenter="no"
105                        ]
106                )
107
108                LIBS="$ac_save_LIBS"
109        ])
110
111        AC_MSG_RESULT(${mp_cv_have_function_cfnotificationcentergetdarwinnotifycenter})
112
113        if test x"${mp_cv_have_function_cfnotificationcentergetdarwinnotifycenter}" = "xyes"; then
114                AC_DEFINE([HAVE_FUNCTION_CFNOTIFICATIONCENTERGETDARWINNOTIFYCENTER], [], [Define if function CFNotificationCenterGetDarwinNotifyCenter in CoreFoundation framework])
115        fi
116
117        AC_SUBST(HAVE_FUNCTION_CFNOTIFICATIONCENTERGETDARWINNOTIFYCENTER)
118])
119
120
121#------------------------------------------------------------------------
122# MP_CHECK_FRAMEWORK_SYSTEMCONFIGURATION --
123#
124#       Check if SystemConfiguration framework is available, define HAVE_FRAMEWORK_SYSTEMCONFIGURATION if so.
125#
126# Arguments:
127#       None.
128#
129# Requires:
130#       None.
131#
132# Depends:
133#               AC_LANG_PROGRAM
134#
135# Results:
136#       Result is cached.
137#
138#       If SystemConfiguration framework is available, defines the following variables:
139#               HAVE_FRAMEWORK_SYSTEMCONFIGURATION
140#
141#------------------------------------------------------------------------
142AC_DEFUN(MP_CHECK_FRAMEWORK_SYSTEMCONFIGURATION, [
143        FRAMEWORK_LIBS="-framework SystemConfiguration"
144
145        AC_MSG_CHECKING([for SystemConfiguration framework])
146
147        AC_CACHE_VAL(mp_cv_have_framework_systemconfiguration, [
148                ac_save_LIBS="$LIBS"
149                LIBS="$FRAMEWORK_LIBS $LIBS"
150               
151                AC_LINK_IFELSE([
152                        AC_LANG_PROGRAM([
153                                        #include <SystemConfiguration/SystemConfiguration.h>
154                                ], [
155                                        int err = SCError();
156                                        SCDynamicStoreRef dsRef = SCDynamicStoreCreate(NULL, NULL, NULL, NULL);
157                        ])
158                        ], [
159                                mp_cv_have_framework_systemconfiguration="yes"
160                        ], [
161                                mp_cv_have_framework_systemconfiguration="no"
162                        ]
163                )
164
165                LIBS="$ac_save_LIBS"
166        ])
167
168        AC_MSG_RESULT(${mp_cv_have_framework_systemconfiguration})
169
170        if test x"${mp_cv_have_framework_systemconfiguration}" = "xyes"; then
171                AC_DEFINE([HAVE_FRAMEWORK_SYSTEMCONFIGURATION], [], [Define if SystemConfiguration framework is available])
172        fi
173
174        AC_SUBST(HAVE_FRAMEWORK_SYSTEMCONFIGURATION)
175])
176
177
178#------------------------------------------------------------------------
179# MP_CHECK_FRAMEWORK_IOKIT --
180#
181#       Check if IOKit framework is available, define HAVE_FRAMEWORK_IOKIT if so.
182#
183# Arguments:
184#       None.
185#
186# Requires:
187#       None.
188#
189# Depends:
190#               AC_LANG_PROGRAM
191#
192# Results:
193#       Result is cached.
194#
195#       If IOKit framework is available, defines the following variables:
196#               HAVE_FRAMEWORK_IOKIT
197#
198#------------------------------------------------------------------------
199AC_DEFUN(MP_CHECK_FRAMEWORK_IOKIT, [
200        FRAMEWORK_LIBS="-framework IOKit"
201
202        AC_MSG_CHECKING([for IOKit framework])
203
204        AC_CACHE_VAL(mp_cv_have_framework_iokit, [
205                ac_save_LIBS="$LIBS"
206                LIBS="$FRAMEWORK_LIBS $LIBS"
207               
208                AC_LINK_IFELSE([
209                        AC_LANG_PROGRAM([
210                                        #include <IOKit/IOKitLib.h>
211                                ], [
212                                        IOCreateReceivePort(0, NULL);
213                                        IORegisterForSystemPower(0, NULL, NULL, NULL);
214                        ])
215                        ], [
216                                mp_cv_have_framework_iokit="yes"
217                        ], [
218                                mp_cv_have_framework_iokit="no"
219                        ]
220                )
221
222                LIBS="$ac_save_LIBS"
223        ])
224
225        AC_MSG_RESULT(${mp_cv_have_framework_iokit})
226
227        if test x"${mp_cv_have_framework_iokit}" = "xyes"; then
228                AC_DEFINE([HAVE_FRAMEWORK_IOKIT], [], [Define if IOKit framework is available])
229        fi
230
231        AC_SUBST(HAVE_FRAMEWORK_IOKIT)
232])
233
234
235dnl This macro checks if the user specified a ports tree
236dnl explicitly. If not, search for it
237
238# MP_PATH_PORTSDIR(DEFAULT_PORTSDIR)
239#---------------------------------------
240 AC_DEFUN([MP_PATH_PORTSDIR],[
241        dnl For ease of reading, run after gcc has been found/configured
242        AC_REQUIRE([AC_PROG_CC])
243
244        AC_ARG_WITH(ports-dir, [AC_HELP_STRING([--with-ports-dir=DIR], [Specify alternate ports directory])], [ portsdir="$withval" ] )
245
246
247        AC_MSG_CHECKING([for ports tree])
248        if test "x$portsdir" != "x" ; then
249          if test -d "$portsdir" -a -e "$portsdir/PortIndex" ; then
250                :
251          else
252                AC_MSG_ERROR([$portsdir not a valid ports tree])
253          fi
254        else
255                dnl If the user didn't give a path, look for default
256                if test "x$1" != "x" ; then
257                  if test -d "$1" -a -e "$1/PortIndex" ; then
258                        portsdir=$1
259                  fi
260                fi
261        fi
262
263        if test "x$portsdir" != "x" ; then
264                AC_MSG_RESULT($portsdir)
265                PORTSDIR="$portsdir"
266                AC_SUBST(PORTSDIR)
267        else
268                AC_MSG_WARN([No ports tree found])
269        fi
270
271         ])
272
273
274# MP_PATH_MPCONFIGDIR
275#---------------------------------------
276AC_DEFUN([MP_PATH_MPCONFIGDIR],[
277        dnl if the user actually specified --prefix, shift
278        dnl mpconfigdir to $prefix/etc/macports
279        dnl     AC_REQUIRE([MP_PATH_PORTSDIR])
280       
281        AC_MSG_CHECKING([for MacPorts config directory])
282
283        mpconfigdir='${sysconfdir}/macports'
284
285        AC_MSG_RESULT([$mpconfigdir])
286        MPCONFIGDIR="$mpconfigdir"
287        AC_SUBST(MPCONFIGDIR)
288
289        ])
290
291# MP_CHECK_INSTALLUSER
292#-------------------------------------------------
293AC_DEFUN([MP_CHECK_INSTALLUSER],[
294        dnl if with user specifies --with-install-user,
295        dnl use it. otherwise default to platform defaults
296        AC_REQUIRE([MP_PATH_MPCONFIGDIR])
297
298        AC_ARG_WITH(install-user, [AC_HELP_STRING([--with-install-user=USER], [Specify user ownership of installed files])], [ DSTUSR=$withval ] )
299       
300        AC_MSG_CHECKING([for install user])
301        if test "x$DSTUSR" = "x" ; then
302           DSTUSR=root
303        fi
304
305        AC_MSG_RESULT([$DSTUSR])
306        AC_SUBST(DSTUSR)
307])
308
309# MP_CHECK_INSTALLGROUP
310#-------------------------------------------------
311AC_DEFUN([MP_CHECK_INSTALLGROUP],[
312        dnl if with user specifies --with-install-group,
313        dnl use it. otherwise default to platform defaults
314        AC_REQUIRE([MP_CHECK_INSTALLUSER])
315
316        AC_ARG_WITH(install-group, [AC_HELP_STRING([--with-install-group=GROUP], [Specify group ownership of installed files])], [ DSTGRP=$withval ] )
317
318        AC_MSG_CHECKING([for install group])
319        if test "x$DSTGRP" = "x" ; then
320           
321           case $host_os in
322           darwin*)
323                DSTGRP="admin"
324                ;;
325           freebsd*)
326                DSTGRP="wheel"
327                ;;
328           linux*)
329                DSTGRP="root"
330                ;;
331           *)
332                DSTGRP="wheel"
333                ;;
334           esac
335        fi
336
337        AC_MSG_RESULT([$DSTGRP])
338        AC_SUBST(DSTGRP)
339])
340
341# MP_DIRECTORY_MODE
342#-------------------------------------------------
343AC_DEFUN([MP_DIRECTORY_MODE],[
344        dnl if with user specifies --with-directory-mode,
345        dnl use the specified permissions for ${prefix} directories
346        dnl otherwise use 0755
347        AC_REQUIRE([MP_PATH_MPCONFIGDIR])
348
349        AC_ARG_WITH(directory-mode, [AC_HELP_STRING([--with-directory-mode=MODE], [Specify directory mode of installed directories])], [ DSTMODE=$withval ] )
350       
351        AC_MSG_CHECKING([what permissions to use for installation directories])
352        if test "x$DSTMODE" = "x" ; then
353           DSTMODE=0755
354        fi
355
356        AC_MSG_RESULT([$DSTMODE])
357        AC_SUBST(DSTMODE)
358])
359
360# MP_PATH_APPLICATIONS
361#---------------------------------------
362AC_DEFUN([MP_PATH_APPLICATIONS],[
363        AC_REQUIRE([MP_CHECK_INSTALLUSER])
364
365    AC_ARG_WITH(applications-dir,[AC_HELP_STRING([--with-applications-dir], [Applications installation directory.])], MPAPPLICATIONSDIR=${withval})
366
367    oldprefix=$prefix
368    if test "x$prefix" = "xNONE" ; then
369        prefix=$ac_default_prefix
370    fi
371    AC_MSG_CHECKING([for Applications installation directory])
372
373        if test "x$MPAPPLICATIONSDIR" = "x" ; then
374            if test "$DSTUSR" = "root" ; then
375                MPAPPLICATIONSDIR="/Applications/MacPorts"
376            else
377                MPAPPLICATIONSDIR="~$DSTUSR/Applications/MacPorts"
378            fi
379        fi
380
381        AC_MSG_RESULT([$MPAPPLICATIONSDIR])
382    AC_SUBST(MPAPPLICATIONSDIR)
383    prefix=$oldprefix
384])
385
386# MP_PATH_FRAMEWORKS
387#---------------------------------------
388AC_DEFUN([MP_PATH_FRAMEWORKS],[
389        AC_REQUIRE([MP_CHECK_INSTALLUSER])
390
391    AC_ARG_WITH(frameworks-dir,[AC_HELP_STRING([--with-frameworks-dir], [Frameworks installation directory.])], MPFRAMEWORKSDIR=${withval})
392
393    oldprefix=$prefix
394    if test "x$prefix" = "xNONE" ; then
395        prefix=$ac_default_prefix
396    fi
397    AC_MSG_CHECKING([for Frameworks installation directory])
398
399        if test "x$MPFRAMEWORKSDIR" = "x" ; then
400                MPFRAMEWORKSDIR="${prefix}/Library/Frameworks"
401        fi
402
403        AC_MSG_RESULT([$MPFRAMEWORKSDIR])
404    AC_SUBST(MPFRAMEWORKSDIR)
405    prefix=$oldprefix
406])
407
408
409# MP_UNIVERSAL_OPTIONS
410#---------------------------------------
411AC_DEFUN([MP_UNIVERSAL_OPTIONS],[
412
413    AC_ARG_WITH(universal-target,[AC_HELP_STRING([--with-universal-target=MDT], [Universal MACOSX_DEPLOYMENT_TARGET version])], UNIVERSAL_TARGET=${withval})
414    AC_ARG_WITH(universal-sysroot,[AC_HELP_STRING([--with-universal-sysroot=SDK], [Universal SDK sysroot (with complete path)])], UNIVERSAL_SYSROOT=${withval})
415    AC_ARG_WITH(universal-archs,[AC_HELP_STRING([--with-universal-archs="CPU"], [Universal CPU architectures (space separated)])], UNIVERSAL_ARCHS=${withval})
416
417        if test "x$UNIVERSAL_TARGET" = "x"; then
418            if [test -d /Developer/SDKs/MacOSX10.5.sdk]; then
419                UNIVERSAL_TARGET=10.5
420                UNIVERSAL_SYSROOT=/Developer/SDKs/MacOSX10.5.sdk
421            else
422                UNIVERSAL_TARGET=10.4
423                UNIVERSAL_SYSROOT=/Developer/SDKs/MacOSX10.4u.sdk
424            fi
425        else
426            if test "x$UNIVERSAL_SYSROOT" = "x"; then
427                UNIVERSAL_SYSROOT=/Developer/SDKs/MacOSX${UNIVERSAL_TARGET}.sdk
428            fi
429        fi
430
431        if test "x$UNIVERSAL_ARCHS" = "x"; then
432                #UNIVERSAL_ARCHS="ppc ppc64 i386 x86_64"
433                UNIVERSAL_ARCHS="ppc i386"
434        fi
435   
436    AC_MSG_CHECKING([for Universal MDT version])
437    AC_MSG_RESULT([$UNIVERSAL_TARGET])
438    AC_SUBST(UNIVERSAL_TARGET)
439
440    AC_MSG_CHECKING([for Universal SDK sysroot])
441    AC_MSG_RESULT([$UNIVERSAL_SYSROOT])
442    AC_SUBST(UNIVERSAL_SYSROOT)
443
444    AC_MSG_CHECKING([for Universal CPU architectures])
445    AC_MSG_RESULT([$UNIVERSAL_ARCHS])
446    AC_SUBST(UNIVERSAL_ARCHS)
447])
448
449# MP_LIB_MD5
450#---------------------------------------
451# Check for an md5 implementation
452AC_DEFUN([MP_LIB_MD5],[
453
454        # Check for libmd, which is prefered
455        AC_CHECK_LIB([md], [MD5Update],[
456                AC_CHECK_HEADERS([md5.h], ,[
457                        case $host_os in
458                                darwin*)       
459                                        AC_MSG_NOTICE([Please install the BSD SDK package from the Xcode Developer Tools CD.])
460                                        ;;
461                                *)     
462                                        AC_MSG_NOTICE([Please install the libmd developer headers for your platform.])
463                                        ;;
464                        esac
465                        AC_MSG_ERROR([libmd was found, but md5.h is missing.])
466                ])
467                AC_DEFINE([HAVE_LIBMD], ,[Define if you have the `md' library (-lmd).])
468                MD5_LIBS="-lmd"]
469        )
470        if test "x$MD5_LIBS" = "x" ; then
471                # If libmd is not found, check for libcrypto from OpenSSL
472                AC_CHECK_LIB([crypto], [MD5_Update],[
473                        AC_CHECK_HEADERS([openssl/md5.h],,[
474                                case $host_os in
475                                        darwin*)       
476                                        AC_MSG_NOTICE([Please install the BSD SDK package from the Xcode Developer Tools CD.])
477                                                ;;
478                                        *)     
479                                        AC_MSG_NOTICE([Please install the libmd developer headers for your platform.])
480                                                ;;
481                                esac
482                                AC_MSG_ERROR([libcrypt was found, but header file openssl/md5.h is missing.])
483                        ])
484                        AC_DEFINE([HAVE_LIBCRYPTO],,[Define if you have the `crypto' library (-lcrypto).])
485                        MD5_LIBS="-lcrypto"
486                ], [
487                        AC_MSG_ERROR([Neither OpenSSL or libmd were found. A working md5 implementation is required.])
488                ])
489        fi
490        if test "x$MD5_LIBS" = "x"; then
491                AC_MSG_ERROR([Neither OpenSSL or libmd were found. A working md5 implementation is required.])
492        fi
493        AC_SUBST([MD5_LIBS])
494])
495
496dnl This macro checks for X11 presence. If the libraries are
497dnl present, so must the headers be. If nothing is present,
498dnl print a warning
499
500# MP_CHECK_X11
501# ---------------------
502AC_DEFUN([MP_CHECK_X11], [
503
504        # work around symbolic X11 link in /usr/include by providing explicit defaults
505        case "$host" in
506            *-*-darwin9*)
507                if test "x$x_includes" = xNONE && test "x$x_libraries" = xNONE; then
508                    x_includes="/usr/X11/include"
509                    x_libraries="/usr/X11/lib"
510                fi
511                ;;
512            *-*-darwin*)
513                if test "x$x_includes" = xNONE && test "x$x_libraries" = xNONE; then
514                    x_includes="/usr/X11R6/include"
515                    x_libraries="/usr/X11R6/lib"
516                fi
517                ;;
518        esac
519
520        AC_PATH_X
521        AC_PATH_XTRA
522
523        # Check for libX11
524        AC_CHECK_LIB([X11], [XOpenDisplay],[
525                has_x_runtime=yes
526                ], [ has_x_runtime=no ], [$X_LIBS])
527
528#       echo "------done---------"
529#       echo "x_includes=${x_includes}"
530#       echo "x_libraries=${x_libraries}"
531#       echo "no_x=${no_x}"
532#       echo "X_CFLAGS=${X_CFLAGS}"
533#       echo "X_LIBS=${X_LIBS}"
534#       echo "X_DISPLAY_MISSING=${X_DISPLAY_MISSING}"
535#       echo "has_x_runtime=${has_x_runtime}"
536#       echo "host_os=${host_os}"
537#       echo "------done---------"
538
539        state=
540
541        case "__${has_x_runtime}__${no_x}__" in
542                "__no__yes__")
543                # either the user said --without-x, or it was not found
544                # at all (runtime or headers)
545                        AC_MSG_WARN([X11 not available. You will not be able to use ports that use X11])
546                        state=0
547                        ;;
548                "__yes__yes__")
549                        state=1
550                        ;;
551                "__yes____")
552                        state=2
553                        ;;
554                *)
555                        state=3
556                        ;;
557        esac
558
559        case $host_os in
560                darwin*)       
561                        case $state in
562                                1)
563                                        cat <<EOF;
564Please install the X11 SDK packages from the
565Xcode Developer Tools CD
566EOF
567                                        AC_MSG_ERROR([Broken X11 install. No X11 headers])
568
569                                        ;;
570                                3)
571                                        cat <<EOF;
572Unknown configuration problem. Please install the X11 runtime
573and/or X11 SDK  packages from the Xcode Developer Tools CD
574EOF
575                                        AC_MSG_ERROR([Broken X11 install])
576                                        ;;
577                        esac
578                        ;;
579                *)     
580                        case $state in
581                                1)
582                                        cat <<EOF;
583Please install the X11 developer headers for your platform
584EOF
585                                        AC_MSG_ERROR([Broken X11 install. No X11 headers])
586
587                                        ;;
588                                3)
589                                        cat <<EOF;
590Unknown configuration problem. Please install the X11
591implementation for your platform
592EOF
593                                        AC_MSG_ERROR([Broken X11 install])
594                                        ;;
595                        esac
596                        ;;
597        esac
598
599])
600
601# MP_PROG_XAR
602#---------------------------------------
603AC_DEFUN([MP_PROG_XAR],[
604
605        AC_PATH_PROG([XAR], [xar], ,  [/usr/bin:/usr/sbin:/bin:/sbin])
606
607        if test "x$XAR" = "x" ; then
608                AC_CONFIG_SUBDIRS([src/programs/xar])
609                XAR='$(TOPSRCDIR)/src/programs/xar/xar'
610                REPLACEMENT_PROGS="$REPLACEMENT_PROGS xar"
611        fi
612
613        AC_SUBST(XAR)
614])
615
616# MP_PROG_DAEMONDO
617#---------------------------------------
618AC_DEFUN([MP_PROG_DAEMONDO],[
619        AC_REQUIRE([MP_CHECK_FRAMEWORK_COREFOUNDATION])
620        AC_REQUIRE([MP_CHECK_FRAMEWORK_SYSTEMCONFIGURATION])
621        AC_REQUIRE([MP_CHECK_FRAMEWORK_IOKIT])
622        AC_REQUIRE([MP_CHECK_FUNCTION_CFNOTIFICATIONCENTERGETDARWINNOTIFYCENTER])
623       
624    AC_MSG_CHECKING(for whether we will build daemondo)
625    result=no
626        case $host_os in
627        darwin*)
628                if test "x$mp_cv_have_framework_corefoundation" == "xyes" &&
629                   test "x$mp_cv_have_framework_systemconfiguration" == "xyes" &&
630                   test "x$mp_cv_have_framework_iokit" == "xyes" &&
631                   test "x$mp_cv_have_function_cfnotificationcentergetdarwinnotifycenter" == "xyes"; then
632                        result=yes
633                        EXTRA_PROGS="$EXTRA_PROGS daemondo"
634                        AC_CONFIG_FILES([src/programs/daemondo/Makefile])
635                fi
636                ;;
637        *)
638        esac
639        AC_MSG_RESULT(${result})
640])
641
642#------------------------------------------------------------------------
643# MP_TCL_PACKAGE_DIR --
644#
645#       Locate the correct directory for Tcl package installation
646#
647# Arguments:
648#       None.
649#
650# Requires:
651#       TCLVERSION must be set
652#       CYGPATH must be set
653#       TCLSH must be set
654#
655# Results:
656#
657#       Adds a --with-tclpackage switch to configure.
658#       Result is cached.
659#
660#       Substs the following vars:
661#               TCL_PACKAGE_DIR
662#------------------------------------------------------------------------
663
664AC_DEFUN(MP_TCL_PACKAGE_DIR, [
665        AC_REQUIRE([MP_CHECK_INSTALLUSER])
666
667    AC_MSG_CHECKING(for Tcl package directory)
668
669    AC_ARG_WITH(tclpackage, [  --with-tclpackage       Tcl package installation directory.], with_tclpackagedir=${withval})
670
671    if test x"${with_tclpackagedir}" != x ; then
672        ac_cv_c_tclpkgd=${with_tclpackagedir}
673    else
674        AC_CACHE_VAL(ac_cv_c_tclpkgd, [
675            # Use the value from --with-tclpackage, if it was given
676
677            if test x"${with_tclpackagedir}" != x ; then
678                echo "tclpackagedir"
679                ac_cv_c_tclpkgd=${with_tclpackagedir}
680            else
681                # On darwin we can do some intelligent guessing
682                case $host_os in
683                    darwin*)
684                        tcl_autopath=`echo 'puts -nonewline \$auto_path' | $TCLSH`
685                        for path in $tcl_autopath; do
686                        if test "$DSTUSR" = "root" ; then
687                            if test "$path" = "/Library/Tcl"; then
688                                ac_cv_c_tclpkgd="$path"
689                                break
690                            fi
691                            if test "$path" = "/System/Library/Tcl"; then
692                                if test -d "$path"; then
693                                    ac_cv_c_tclpkgd="$path"
694                                    break
695                                fi
696                            fi
697                        elif test "$path" = "~/Library/Tcl"; then
698                            ac_cv_c_tclpkgd="~$DSTUSR/Library/Tcl"
699                            break
700                        fi
701                        done
702                    ;;
703                esac
704                if test x"${ac_cv_c_tclpkgd}" = x ; then
705                    # Fudge a path from the first entry in the auto_path
706                    tcl_pkgpath=`echo 'puts -nonewline [[lindex \$auto_path 0]]' | $TCLSH`
707                    if test -d "$tcl_pkgpath"; then
708                        ac_cv_c_tclpkgd="$tcl_pkgpath"
709                    fi
710                    # If the first entry does not exist, do nothing
711                fi
712            fi
713        ])
714    fi
715
716    if test x"${ac_cv_c_tclpkgd}" = x ; then
717        AC_MSG_ERROR(Tcl package directory not found.  Please specify its location with --with-tclpackage)
718    else
719        AC_MSG_RESULT(${ac_cv_c_tclpkgd})
720    fi
721
722    # Convert to a native path and substitute into the output files.
723
724    PACKAGE_DIR_NATIVE=`${CYGPATH} ${ac_cv_c_tclpkgd}`
725
726    TCL_PACKAGE_DIR=${PACKAGE_DIR_NATIVE}
727
728    AC_SUBST(TCL_PACKAGE_DIR)
729])
730
731# MP_PROG_TCLSH
732#---------------------------------------
733AC_DEFUN([MP_PROG_TCLSH],[
734
735
736        case $host_os in
737                freebsd*)
738                        # FreeBSD installs a dummy tclsh (annoying)
739                        # Look for a real versioned tclsh with threads first
740                        # Look for a real versioned tclsh without threads second
741                        AC_PATH_PROG([TCLSH], [tclsh${TCL_VERSION}-threads tclsh${TCL_VERSION} tclsh])
742                        ;;
743                *)
744                        # Otherwise, look for a non-versioned tclsh
745                        AC_PATH_PROG([TCLSH], [tclsh tclsh${TCL_VERSION}])
746                        ;;
747        esac
748        if test "x$TCLSH" = "x" ; then
749                AC_MSG_ERROR([Could not find tclsh])
750        fi
751
752        AC_SUBST(TCLSH)
753])
754
755# MP_TCL_PACKAGE
756#       Determine if a Tcl package is present.
757#
758# Arguments:
759#       Package name (may include the version)
760#
761# Syntax:
762#   MP_TCL_PACKAGE (package, [action-if-found], [action-if-not-found])
763#
764# Requires:
765#       TCLSH must be set
766#
767# Results:
768#       Execute action-if-found or action-if-not-found
769#---------------------------------------
770AC_DEFUN([MP_TCL_PACKAGE],[
771        AC_MSG_CHECKING([for Tcl $1 package])
772        package_present=`echo 'if {[[catch {package require $1}]]} {puts -nonewline 0} else {puts -nonewline 1}' | $TCLSH`
773        AS_IF([test "$package_present" = "1"], [$2], [$3])[]
774])
775
776# MP_TCL_THREAD_SUPPORT
777#       Determine if thread support is available in tclsh.
778#
779# Arguments:
780#       None.
781#
782# Requires:
783#       TCLSH must be set
784#
785# Results:
786#   Fails if thread support isn't available.
787#---------------------------------------
788AC_DEFUN([MP_TCL_THREAD_SUPPORT],[
789        AC_MSG_CHECKING([whether tclsh was compiled with threads])
790        tcl_threadenabled=`echo 'puts -nonewline [[info exists tcl_platform(threaded)]]' | $TCLSH`
791        if test "$tcl_threadenabled" = "1" ; then
792                AC_MSG_RESULT([yes])
793        else
794                AC_MSG_RESULT([no])
795                AC_MSG_ERROR([tcl wasn't compiled with threads enabled])
796        fi
797])
798
799# MP_LIBCURL_FLAGS
800#       Sets the flags to compile with libcurl.
801#
802# Arguments:
803#       None.
804#
805# Requires:
806#   curl-config or user parameters to define the flags.
807#
808# Results:
809#   defines some help strings.
810#   sets CFLAGS_LIBCURL and LDFLAGS_LIBCURL
811#---------------------------------------
812AC_DEFUN([MP_LIBCURL_FLAGS],[
813        AC_ARG_WITH(curlprefix,
814                   [  --with-curlprefix       base directory for the cURL install '/usr', '/usr/local',...],
815                   [  curlprefix=$withval ])
816
817        if test "x$curlprefix" = "x"; then
818                AC_PATH_PROG([CURL_CONFIG], [curl-config])
819        else
820                AC_PATH_PROG([CURL_CONFIG], [curl-config], , [$curlprefix/bin])
821        fi
822
823        if test "x$CURL_CONFIG" = "x"; then
824                AC_MSG_ERROR([cannot find curl-config. Is libcurl installed?])
825        fi
826
827        CFLAGS_LIBCURL=$($CURL_CONFIG --cflags)
828        # Due to a bug in dist, --arch flags are improperly supplied by curl-config.
829        # Get rid of them.
830        LDFLAGS_LIBCURL=$($CURL_CONFIG --libs | [sed 's/-arch [A-Za-z0-9_]* //g'])
831
832        AC_SUBST(CFLAGS_LIBCURL)
833        AC_SUBST(LDFLAGS_LIBCURL)
834])
835
836# MP_LIBCURL_VERSION
837#       Determine the version of libcurl.
838#
839# Arguments:
840#       None.
841#
842# Requires:
843#       CURL must be set (AC_PATH_PROG(CURL, [curl], []))
844#
845# Results:
846#   sets libcurl_version to "0" or some number
847#---------------------------------------
848AC_DEFUN([MP_LIBCURL_VERSION],[
849        if test "x$CURL" = "x"; then
850                libcurl_version="0"
851        else
852                AC_MSG_CHECKING([libcurl version])
853                libcurl_version=`$CURL -V | sed '2,$d' | awk '{print $ 2}' | sed -e 's/\.//g' -e 's/-.*//g'`
854                AC_MSG_RESULT([$libcurl_version])
855        fi
856])
857
858
859dnl This macro tests if the compiler supports GCC's
860dnl __attribute__ syntax for unused variables/parameters
861AC_DEFUN([MP_COMPILER_ATTRIBUTE_UNUSED], [
862        AC_MSG_CHECKING([how to mark unused variables])
863        AC_COMPILE_IFELSE(
864                [AC_LANG_SOURCE([[int a __attribute__ ((unused));]])],
865                [AC_DEFINE(UNUSED, [__attribute__((unused))], [Attribute to mark unused variables])],
866                [AC_DEFINE(UNUSED, [])])
867
868        AC_MSG_RESULT([])
869       
870])
871
872dnl This macro ensures MP installation prefix bin/sbin paths are NOT in PATH
873dnl for configure to prevent potential problems when base/ code is updated
874dnl and ports are installed that would match needed items.
875AC_DEFUN([MP_PATH_SCAN],[
876        oldprefix=$prefix
877        if test "x$prefix" = "xNONE" ; then
878                prefix=$ac_default_prefix
879        fi
880        oldPATH=$PATH
881        newPATH=
882        as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
883        for as_dir in $oldPATH
884        do
885                IFS=$as_save_IFS
886                if test "x$as_dir" != "x$prefix/bin" &&
887                        test "x$as_dir" != "x$prefix/sbin"; then
888                        if test -z "$newPATH"; then
889                                newPATH=$as_dir
890                        else
891                                newPATH=$newPATH$PATH_SEPARATOR$as_dir
892                        fi
893                fi
894        done
895        PATH=$newPATH; export PATH
896        prefix=$oldprefix
897])
898
899dnl This macro tests for sed support of -E (BSD) or -r (GNU)
900AC_DEFUN([MP_SED_EXTENDED_REGEXP],[
901        AC_PATH_PROG(SED, [sed])
902
903        if test "x$SED" = "x"; then
904                AC_MSG_ERROR([cannot find sed. Is sed installed?])
905        fi
906
907        AC_MSG_CHECKING([which sed flag to use for extended regexp])
908        [any_sed_flag=`echo foo | $SED    -e s/foo+/OK/ 2>&1 | grep OK`]
909        [bsd_sed_flag=`echo foo | $SED -E -e s/foo+/OK/ 2>&1 | grep OK`]
910        [gnu_sed_flag=`echo foo | $SED -r -e s/foo+/OK/ 2>&1 | grep OK`]
911        if test "x$any_sed_flag" = "xOK" ; then
912                AC_MSG_RESULT([none])
913                SED_EXT=
914        elif test "x$bsd_sed_flag" = "xOK" ; then
915                AC_MSG_RESULT([-E (BSD)])
916                SED_EXT=-E
917        elif test "x$gnu_sed_flag" = "xOK" ; then
918                AC_MSG_RESULT([-r (GNU)])
919                SED_EXT=-r
920        else
921                AC_MSG_RESULT([not available])
922                SED_EXT='N/A'
923        fi
924        AC_SUBST(SED_EXT)
925])
926
927dnl This macro tests for tar support of --no-same-owner
928AC_DEFUN([MP_TAR_NO_SAME_OWNER],[
929        AC_PATH_PROG(TAR, [tar])
930        AC_PATH_PROG(GNUTAR, [gnutar])
931       
932        AC_MSG_CHECKING([for which tar variant to use])
933        AS_IF([test -n "$GNUTAR"], [TAR_CMD=$GNUTAR], [TAR_CMD=$TAR])
934        AC_MSG_RESULT([$TAR_CMD])
935        AC_SUBST(TAR_CMD)
936
937        AC_MSG_CHECKING([for $TAR_CMD --no-same-owner support])
938        [no_same_owner_support=`$TAR_CMD --help 2>&1 | grep no-same-owner`]
939        if test -z "$no_same_owner_support" ; then
940                AC_MSG_RESULT([no])
941        else
942                AC_MSG_RESULT([yes])
943                TAR_CMD="$TAR_CMD --no-same-owner"
944        fi
945])
946
947#------------------------------------------------------------------------
948# MP_CHECK_READLINK_IS_P1003_1A --
949#
950#       Check if readlink conforms to POSIX 1003.1a standard, define
951#       READLINK_IS_NOT_P1003_1A if it doesn't.
952#
953# Arguments:
954#       None.
955#
956# Requires:
957#       None.
958#
959# Depends:
960#               AC_LANG_PROGRAM
961#
962# Results:
963#       Result is cached.
964#
965#       If readlink doesn't conform to POSIX 1003.1a, defines the following variables:
966#               READLINK_IS_NOT_P1003_1A
967#
968#------------------------------------------------------------------------
969AC_DEFUN(MP_CHECK_READLINK_IS_P1003_1A, [
970        AC_MSG_CHECKING([if readlink conforms to POSIX 1003.1a])
971
972        AC_CACHE_VAL(mp_cv_readlink_is_posix_1003_1a, [
973                AC_COMPILE_IFELSE([
974                        AC_LANG_PROGRAM([
975                                        #include <unistd.h>
976                                        ssize_t readlink(const char *, char *, size_t);
977                                ], [
978                        ])
979                        ], [
980                                mp_cv_readlink_is_posix_1003_1a="yes"
981                        ], [
982                                mp_cv_readlink_is_posix_1003_1a="no"
983                        ]
984                )
985        ])
986
987        AC_MSG_RESULT(${mp_cv_readlink_is_posix_1003_1a})
988
989        if test x"${mp_cv_readlink_is_posix_1003_1a}" = "xno"; then
990                AC_DEFINE([READLINK_IS_NOT_P1003_1A], [], [Define to 1 if readlink does not conform with POSIX 1003.1a (where third argument is a size_t and return value is a ssize_t)])
991        fi
992
993        AC_SUBST(READLINK_IS_NOT_P1003_1A)
994])
995
996#------------------------------------------------------------------------
997# MP_WERROR --
998#
999#       Enable -Werror
1000#
1001# Arguments:
1002#       None.
1003#
1004# Requires:
1005#       none
1006#
1007# Depends:
1008#       none
1009#
1010# Results:
1011#       Substitutes WERROR_CFLAGS variable
1012#------------------------------------------------------------------------
1013AC_DEFUN([MP_WERROR],[
1014        AC_REQUIRE([AC_PROG_CC])
1015        AC_ARG_ENABLE(werror, AC_HELP_STRING([--enable-werror], [Add -Werror to CFLAGS. Used for development.]), [enable_werror=${enableval}], [enable_werror=no])
1016        if test x"$enable_werror" != "xno"; then
1017                CFLAGS_WERROR="-Werror"
1018        else
1019                CFLAGS_WERROR=""
1020        fi
1021        AC_SUBST([CFLAGS_WERROR])
1022])
Note: See TracBrowser for help on using the repository browser.