source: trunk/base/configure.ac

Last change on this file was 146453, checked in by snc@…, 4 years ago

vendor: update tcl thread to 2.7.3

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 14.0 KB
Line 
1dnl Process this file with autoconf to produce a configure script.
2dnl $Id: configure.ac 146453 2016-03-08 02:30:56Z snc@macports.org $
3AC_PREREQ(2.63)
4AC_DEFUN([MACPORTS_VERSION_MACRO], [esyscmd(<config/macports_version tr -d '\n')])
5AC_INIT([MacPorts],MACPORTS_VERSION_MACRO,[macports-dev@lists.macosforge.org],[macports])
6AC_CONFIG_SRCDIR([src/pextlib1.0/Pextlib.c])
7AC_CONFIG_HEADERS([src/config.h])
8
9AC_CANONICAL_TARGET
10
11# Read in the MacPorts version from the base/config/macports_version file
12AC_MSG_CHECKING(MacPorts version)
13MACPORTS_VERSION=MACPORTS_VERSION_MACRO
14AC_MSG_RESULT([$MACPORTS_VERSION])
15AC_SUBST(MACPORTS_VERSION)
16
17# Check user PATH for MP paths, and remove as necessary.
18MP_PATH_SCAN
19MP_FLAGS_SCAN
20
21AC_PATH_PROG(SW_VERS, sw_vers)
22AC_PATH_PROG(DEFAULTS, defaults)
23AC_PATH_PROG(XCODE_SELECT, xcode-select)
24
25if test "x$SW_VERS" != "x"; then
26  AC_MSG_CHECKING(Mac OS X version)
27  MACOSX_VERSION=`$SW_VERS -productVersion`
28  AC_MSG_RESULT([$MACOSX_VERSION])
29fi
30
31case "$MACOSX_VERSION" in
32  10.0*|10.1|10.1.*|10.2*|10.3*)
33    AC_MSG_ERROR([This version of Mac OS X is not supported
34                  Please upgrade at http://store.apple.com/])
35    ;;
36  10.4.[[0-9]]|10.4.10|10.5.[[0-7]]|10.6.[[0-7]]|10.7.[[0-4]]|10.8.[[0-4]]|10.9.[[0-4]]|10.10.[[0-3]])
37    AC_MSG_WARN([This version of Mac OS X is out of date])
38    AC_MSG_WARN([Please run Software Update to update it])
39    ;;
40  10.4*|10.5*|10.6*|10.7*|10.8*|10.9*|10.10*)
41    dnl Supported version
42    ;;
43  *)
44    ;;
45esac
46
47# locate currently selected Xcode path
48AC_MSG_CHECKING(Xcode location)
49if test "x$XCODE_SELECT" != "x"; then
50  DEVELOPER_DIR=`$XCODE_SELECT -print-path`
51fi
52if test -z "$DEVELOPER_DIR" -o ! -d "$DEVELOPER_DIR" ; then
53    if test -d /Applications/Xcode.app/Contents/Developer ; then
54        DEVELOPER_DIR=/Applications/Xcode.app/Contents/Developer
55    else
56        DEVELOPER_DIR=/Developer
57    fi
58fi
59AC_MSG_RESULT([$DEVELOPER_DIR])
60AC_SUBST(DEVELOPER_DIR)
61
62case "$DEVELOPER_DIR" in
63  *Xcode.app/Contents/Developer)
64    XCODEPLIST_BASE=`dirname $DEVELOPER_DIR`/version
65    ;;
66  *)
67    XCODEPLIST_BASE=$DEVELOPER_DIR/Applications/Xcode.app/Contents/version
68    ;;
69esac
70XCODEPLIST=${XCODEPLIST_BASE}.plist
71if test -r "$XCODEPLIST"; then
72  AC_MSG_CHECKING(Xcode version)
73  if test "x$DEFAULTS" != "x"; then
74    XCODE_VERSION=`$DEFAULTS read $XCODEPLIST_BASE CFBundleShortVersionString`
75  else
76    XCODE_VERSION=`tr -d '\r\n' < $XCODEPLIST | sed -e 's/.*<key>CFBundleShortVersionString<\/key>.<string>\([[0-9.]]*\)<\/string>.*/\1/'`
77  fi
78  AC_MSG_RESULT([$XCODE_VERSION])
79fi
80
81case "$XCODE_VERSION" in
82  1.*|2.[[0-1]]*)
83    AC_MSG_WARN([This version of Xcode Tools is not supported])
84    AC_MSG_WARN([Please upgrade at https://developer.apple.com/downloads/])
85    ;;
86  2.[[2-3]]*|3.[[0]]*)
87    AC_MSG_WARN([This version of Xcode Tools is out of date])
88    AC_MSG_WARN([Please consider upgrading as some ports fail compiling])
89    ;;
90  2.*|3.*|4.*|5.*|6.*)
91    dnl Supported version
92    ;;
93  *)
94    ;;
95esac
96
97# Checks for programs.
98AC_PROG_CC([clang cc gcc])
99AC_PROG_INSTALL
100AC_PROG_LN_S
101AC_PROG_MAKE_SET
102AC_PROG_OBJC([clang cc gcc])
103
104# Check for user-supplied paths before searching
105
106dnl Beware of conflicts between the variables you set and any tools executed in
107dnl the configure context. Some tools interpret an environment variable with
108dnl their own name as default flags and will fail if it is set to a path. For
109dnl example, these include BZIP2 and GZIP, which is the reason why they are
110dnl named with a _BIN suffix here.
111MP_TOOL_PATH(BSDMAKE, [bsdmake/pmake])
112MP_TOOL_PATH(BZIP2_BIN, [bzip2])
113MP_TOOL_PATH(CVS, [cvs])
114MP_TOOL_PATH(GNUMAKE, [gnumake])
115MP_TOOL_PATH(GNUTAR, [gnutar])
116MP_TOOL_PATH(LZMA, [lzma])
117MP_TOOL_PATH(MAKE, [make])
118MP_TOOL_PATH(MTREE, [mtree])
119MP_TOOL_PATH(OPEN, [open])
120MP_TOOL_PATH(OPENSSL, [openssl])
121MP_TOOL_PATH(RSYNC, [rsync])
122MP_TOOL_PATH(SED, [sed])
123MP_TOOL_PATH(SVN, [svn])
124MP_TOOL_PATH(SWIG, [swig])
125MP_TOOL_PATH(TAR, [tar])
126MP_TOOL_PATH(XAR, [xar])
127MP_TOOL_PATH(XZ, [xz])
128
129# Search for tool paths. Any set above (via --with-pkg=PATH) will be retained
130AC_PATH_PROGS(BSDMAKE, [bsdmake pmake], [])
131AC_PATH_PROG(BZIP2_BIN, [bzip2], [])
132AC_PATH_PROG(BZR, [bzr], [])
133AC_PATH_PROG(CHOWN, [chown], [], [$PATH:/usr/sbin])
134AC_PATH_PROG(CP, [cp], [])
135AC_PATH_PROG(CPIO, [cpio], [])
136AC_PATH_PROG(CVS, [cvs], [])
137AC_PATH_PROG(DIFF, [diff], [])
138AC_PATH_PROG(DSCL, [dscl], [])
139AC_PATH_PROG(DSEDITGROUP, [dseditgroup], [], [$PATH:/usr/sbin])
140AC_PATH_PROG(FILE, [file], [])
141AC_PATH_PROG(FIND, [find], [])
142AC_PATH_PROG(GIT, [git], [])
143AC_PATH_PROGS(GNUMAKE, [gnumake gmake], [])
144AC_PATH_PROGS(GNUPATCH, [gnupatch gpatch], [])
145AC_PATH_PROGS(GNUTAR, [gnutar gtar], [])
146AC_PATH_PROG(GZIP_BIN, [gzip], [])
147AC_PATH_PROG(HDIUTIL, [hdiutil], [])
148AC_PATH_PROG(HG, [hg], [])
149AC_PATH_PROG(LAUNCHCTL, [launchctl], [])
150AC_PATH_PROG(LIPO, [lipo], [])
151AC_PATH_PROG(LSBOM, [lsbom], [])
152AC_PATH_PROG(LZMA, [lzma], [])
153AC_PATH_PROG(MAKE, [make])
154AC_PATH_PROG(MAN, [man])
155AC_PATH_PROG(MDFIND, [mdfind], [])
156AC_PATH_PROG(MDLS, [mdls], [])
157AC_PATH_PROG(MKBOM, [mkbom], [])
158AC_PATH_PROGS(MTREE, [mtree fmtree], [], [$PATH:/usr/sbin])
159AC_PATH_PROG(OPEN, [open], [])
160AC_PATH_PROG(OPENSSL, [openssl], [])
161AC_PATH_PROG(PATCH, [patch], [])
162AC_PATH_PROG(PAX, [pax], [])
163AC_PATH_PROG(RMDIR, [rmdir], [])
164AC_PATH_PROG(RSYNC, [rsync], [])
165AC_PATH_PROG(SANDBOX_EXEC, [sandbox-exec], [], [/usr/bin])
166AC_PATH_PROG(SED, [sed])
167AC_PATH_PROG(SVN, [svn], [])
168AC_PATH_PROG(SWIG, [swig], [])
169AC_PATH_PROG(TAR, [tar])
170AC_PATH_PROG(UNZIP, [unzip])
171AC_PATH_PROG(XAR, [xar], [])
172AC_PATH_PROG(XCODEBUILD, [xcodebuild], [])
173AC_PATH_PROG(XCRUN, [xcrun], [])
174AC_PATH_PROG(XZ, [xz], [])
175AC_PATH_PROG(ZIP, [zip])
176
177AC_CHECK_PROG(HAVE_LAUNCHD, [launchd], [yes], [], [/sbin])
178
179if test "x$MTREE" = "x"; then
180    AC_MSG_ERROR([mtree not found])
181fi
182
183MP_SED_EXTENDED_REGEXP
184MP_TAR_FAST_READ
185MP_TAR_NO_SAME_OWNER
186MP_PATCH_GNU_VERSION
187
188# Quiche eaters options.
189if test x$GCC = xyes; then
190        CFLAGS_QUICHEEATERS='-Wextra -Wall'
191        CFLAGS_PEDANTIC='-pedantic'
192fi
193AC_SUBST(CFLAGS_QUICHEEATERS)
194AC_SUBST(CFLAGS_PEDANTIC)
195MP_WERROR
196
197MP_COMPILER_ATTRIBUTE_UNUSED
198MP_COMPILER_ATTRIBUTE_LF_PRIVATE
199
200# Foundation checks
201ACX_PTHREAD
202MP_OBJC_RUNTIME
203MP_OBJC_FOUNDATION
204
205MP_PROG_DAEMONDO
206
207AC_SUBST(EXTRA_PROGS)
208
209# set default ports-directory
210PORTS_DIR_DEFAULT=`pwd | sed -e "s/base/ports/"`
211
212# Check for paths
213AC_PREFIX_DEFAULT(/opt/local)
214AC_ARG_WITH(
215                unsupported-prefix,
216                AS_HELP_STRING([--with-unsupported-prefix],
217                [Acknowledge that you accept the consequences of using an unsupported prefix.]),
218                [with_unsupported_prefix=$withval],
219                [with_unsupported_prefix=no])
220if test x$prefix = x/usr/local -o x$prefix = x/usr && test x$with_unsupported_prefix != xyes; then
221    AC_MSG_ERROR([Installing MacPorts into $prefix is not supported. If \
222you understand this and wish to do so anyway, pass --with-unsupported-prefix \
223to configure.])
224fi
225MP_PATH_PORTSDIR([$PORTS_DIR_DEFAULT])
226MP_PATH_MPCONFIGDIR
227
228# Check whether to install without root privileges
229MP_CHECK_NOROOTPRIVILEGES
230
231# Check for install ownership
232MP_CHECK_INSTALLUSER
233MP_CHECK_INSTALLGROUP
234MP_CHECK_RUNUSER
235MP_DIRECTORY_MODE
236MP_SHARED_DIRECTORY
237
238# Check for default directories
239MP_PATH_APPLICATIONS
240MP_PATH_FRAMEWORKS
241
242# Check for universal options
243MP_UNIVERSAL_OPTIONS
244
245# Check for standard header files.
246AC_HEADER_STDC
247AC_HEADER_DIRENT
248AC_HEADER_SYS_WAIT
249AC_CHECK_HEADERS([crt_externs.h err.h fcntl.h libkern/OSAtomic.h libproc.h limits.h paths.h pwd.h \
250        readline/history.h readline/readline.h spawn.h sys/cdefs.h sys/event.h sys/fcntl.h sys/file.h \
251        sys/paths.h sys/socket.h sys/sysctl.h utime.h])
252
253# Checks for library functions.
254AC_CHECK_FUNCS([OSAtomicCompareAndSwap32 OSAtomicCompareAndSwap64 \
255        OSAtomicCompareAndSwapPtr __getdirentries64 bzero clearenv copyfile fgetln \
256        flock fls kqueue lockf memset posix_spawn setmode strcasecmp strlcat \
257        strlcpy strncasecmp sysctlbyname])
258AC_SUBST([ac_cv_func_strlcat])
259
260MP_CHECK_READLINK_IS_P1003_1A
261
262# Check for md5 implementation
263AC_CHECK_HEADER([CommonCrypto/CommonDigest.h], [AC_DEFINE([HAVE_COMMONCRYPTO_COMMONDIGEST_H], [1], [Define if CommonCrypto is available.])], [MP_LIB_MD5])
264
265# Check for readline
266AC_ARG_ENABLE(readline, AS_HELP_STRING([--enable-readline],[Enable addition of readline support, if readline present.]),
267[
268        AC_CHECK_LIB([readline], [readline], [
269                                  READLINE_LIBS=-lreadline
270                                  AC_DEFINE([HAVE_LIBREADLINE], [1], [Define to 1 if you have the 'readline' library (-lreadline).])
271                                  ])
272        AC_CHECK_DECLS([rl_username_completion_function,rl_filename_completion_function,rl_completion_matches,username_completion_function,filename_completion_function,completion_matches], [], [],
273        [
274        #include <stdio.h>
275        #if HAVE_READLINE_READLINE_H
276        # include <readline/readline.h>
277        #endif
278        ])
279])
280AC_SUBST(READLINE_LIBS)
281
282# Lowest non-system-reserved uid and gid (Apple claims <500)
283AC_DEFINE([MIN_USABLE_UID], [500], [Lowest non-system-reserved UID.])
284AC_DEFINE([MIN_USABLE_GID], [500], [Lowest non-system-reserved GID.])
285
286# Substitute platform for base compatibility check
287MP_PLATFORM
288
289## libcurl
290MP_LIBCURL_FLAGS
291
292## sqlite3
293MP_SQLITE3_FLAGS
294
295MP_CHECK_SQLITE_VERSION(3003011)
296if test "x${mp_sqlite_version_ge_3003011}" = "xno"; then
297        AC_DEFINE([sqlite3_prepare_v2], [sqlite3_prepare], [define sqlite3_prepare to sqlite_prepare_v2 if the latter is not available])
298fi
299
300# check whether trace mode is supported on this platform
301MP_TRACEMODE_SUPPORT
302
303# misc variables that need to be expanded for substitution into tcl
304oldprefix=$prefix
305oldexec_prefix=$exec_prefix
306if test "x$prefix" = "xNONE" ; then
307   prefix=$ac_default_prefix
308fi
309if test "x$exec_prefix" = "xNONE" ; then
310        exec_prefix=$prefix
311fi
312eval "prefix_expanded=$prefix"
313eval "exec_prefix_expanded=$exec_prefix"
314AC_SUBST(prefix_expanded)
315
316# Define a path where our trace mode workaround for SIP-protected binaries on
317# >= 10.11 puts copies
318AC_DEFINE_UNQUOTED(
319        [DARWINTRACE_SIP_WORKAROUND_PATH],
320        ["${prefix}/var/macports/sip-workaround"],
321        [Absolute path to a directory used by darwintrace to copy SIP-protected files before executing])
322
323# do this twice, since there is a nested variable of
324# ${prefix} inside of ${sysconfdir}
325eval "MPCONFIGDIR_EXPANDED=$MPCONFIGDIR"
326eval "MPCONFIGDIR_EXPANDED=$MPCONFIGDIR_EXPANDED"
327AC_SUBST(MPCONFIGDIR_EXPANDED)
328eval "localstatedir_expanded=$localstatedir"
329AC_SUBST(localstatedir_expanded)
330# Compute the libexec dir for the vendor packages
331eval "macports_libexec_dir=${libexecdir}/macports"
332eval "macports_libexec_dir=$macports_libexec_dir"
333prefix=$oldprefix
334exec_prefix=$oldexec_prefix
335
336## Tcl package
337tcl_version=8.5.18
338tcl_thread_version=2.7.3
339tclx_version=8.4.1
340tcllib_version=1.17
341MP_CONFIG_TARBALL([vendor/tcl${tcl_version}-src.tar.gz], [vendor/tcl${tcl_version}/unix], [--prefix=${macports_libexec_dir} --enable-threads])
342VENDOR_TCL_SUBDIR=tcl${tcl_version}/unix
343VENDOR_TCL_INSTALL="install-binaries install-libraries"
344AC_SUBST(VENDOR_TCL_SUBDIR)
345AC_SUBST(VENDOR_TCL_INSTALL)
346
347# Set up some variables needed by MacPorts' Tcl setup
348VENDOR_DESTROOT=vendor/vendor-destroot
349AC_SUBST(VENDOR_DESTROOT)
350
351## Tcl Thread package
352# Tcl supports Threads internally, but to use threads from Tcl code we need
353# this package
354MP_CONFIG_TARBALL([vendor/thread${tcl_thread_version}.tar.gz], [vendor/thread${tcl_thread_version}], [--prefix=${macports_libexec_dir}])
355VENDOR_TCLTHREAD_SUBDIR=thread${tcl_thread_version}
356VENDOR_TCLTHREAD_INSTALL="install-binaries install-libraries"
357AC_SUBST(VENDOR_TCLTHREAD_SUBDIR)
358AC_SUBST(VENDOR_TCLTHREAD_INSTALL)
359
360## TclX package
361# TclX is required for signal handling
362MP_CONFIG_TARBALL([vendor/tclx${tclx_version}.tar.bz2], [vendor/tclx8.4], [--prefix=${macports_libexec_dir}])
363VENDOR_TCLX_SUBDIR=tclx8.4
364VENDOR_TCLX_INSTALL="install-binaries install-libraries"
365AC_SUBST(VENDOR_TCLX_SUBDIR)
366AC_SUBST(VENDOR_TCLX_INSTALL)
367
368## Tcllib package
369# Note that Tcllib needs a Tcl interpreter during installation; it will *not*
370# be the one we configure above, because that one isn't built yet. That's not
371# a problem, though -- it's only used during installation.
372MP_CONFIG_TARBALL([vendor/tcllib-${tcllib_version}.tar.gz], [vendor/tcllib-${tcllib_version}], [--prefix=${macports_libexec_dir}])
373VENDOR_TCLLIB_SUBDIR=tcllib-${tcllib_version}
374VENDOR_TCLLIB_INSTALL="install-libraries"
375AC_SUBST(VENDOR_TCLLIB_SUBDIR)
376AC_SUBST(VENDOR_TCLLIB_INSTALL)
377
378# Load tclConfig.sh from our private install of Tcl
379AC_MSG_CHECKING([for Tcl configuration])
380TCL_BIN_DIR=`(cd vendor/tcl${tcl_version}/unix; pwd)`
381AC_MSG_RESULT([found $TCL_BIN_DIR/tclConfig.sh])
382SC_LOAD_TCLCONFIG
383SC_ENABLE_SHARED
384
385# Pull compiler/linker values from tclConfig.sh
386SHLIB_LD=${TCL_SHLIB_LD}
387STLIB_LD=${TCL_STLIB_LD}
388SHLIB_CFLAGS=${TCL_SHLIB_CFLAGS}
389SHLIB_SUFFIX=${TCL_SHLIB_SUFFIX}
390TCLSH=${TCL_EXEC_PREFIX}/bin/tclsh${TCL_VERSION}
391INTREE_TCLSH=${TCL_BIN_DIR}/tclsh
392# strip possible whitespace at the end of TCL_PACKAGE_PATH
393eval "TCL_PACKAGE_PATH=${TCL_PACKAGE_PATH}"
394
395AC_SUBST(SHLIB_LD)
396AC_SUBST(STLIB_LD)
397AC_SUBST(SHLIB_CFLAGS)
398AC_SUBST(SHLIB_SUFFIX)
399AC_SUBST(TCL_PREFIX)
400AC_SUBST(TCL_VERSION)
401AC_SUBST(TCL_PACKAGE_PATH)
402AC_SUBST(TCL_STUB_LIB_SPEC)
403AC_SUBST(TCL_SRC_DIR)
404AC_SUBST(TCLSH)
405AC_SUBST(INTREE_TCLSH)
406
407INCLUDES="-I.. -I. $INCLUDES"
408AC_SUBST(INCLUDES)
409
410# Check if there's an existing DP/MP install too old to upgrade
411MP_CHECK_OLDLAYOUT
412
413# Output
414AC_CONFIG_FILES([
415        Doxyfile
416        Makefile
417        Mk/macports.autoconf.mk
418        doc/Makefile
419        doc/base.mtree
420        doc/macosx.mtree
421        doc/macports.conf
422        doc/prefix.mtree
423        doc/pubkeys.conf
424        portmgr/dmg/postflight
425        setupenv.bash
426        src/Makefile
427        src/cregistry/Makefile
428        src/darwintracelib1.0/Makefile
429        src/machista1.0/Makefile
430        src/macports1.0/Makefile
431        src/macports1.0/macports_autoconf.tcl
432        src/macports1.0/macports_test_autoconf.tcl
433        src/package1.0/Makefile
434        src/package1.0/package_test_autoconf.tcl
435        src/pextlib1.0/Makefile
436        src/port/Makefile
437        src/port1.0/Makefile
438        src/port1.0/port_autoconf.tcl
439        src/port1.0/port_test_autoconf.tcl
440        src/programs/Makefile
441        src/registry2.0/Makefile
442        src/registry2.0/registry_autoconf.tcl
443        tests/Makefile
444        tests/test.tcl
445        tests/test/library.tcl
446        tests/test/trace/test.tcl
447        vendor/Makefile
448])
449
450AC_CONFIG_FILES([src/dedup_portfiles.tcl], [chmod +x src/dedup_portfiles.tcl])
451AC_CONFIG_FILES([src/images_to_archives.tcl], [chmod +x src/images_to_archives.tcl])
452AC_CONFIG_FILES([src/pkg_mkindex.sh], [chmod +x src/pkg_mkindex.sh])
453AC_CONFIG_FILES([src/upgrade_sources_conf_default.tcl], [chmod +x src/upgrade_sources_conf_default.tcl])
454
455AC_OUTPUT
Note: See TracBrowser for help on using the repository browser.