source: trunk/base/configure.ac @ 139170

Last change on this file since 139170 was 138947, checked in by raimue@…, 5 years ago

configure: Update OS X versions

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 13.7 KB
Line 
1dnl Process this file with autoconf to produce a configure script.
2dnl $Id: configure.ac 138947 2015-07-24 21:31:09Z raimue@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 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# do this twice, since there is a nested variable of
316# ${prefix} inside of ${sysconfdir}
317eval "MPCONFIGDIR_EXPANDED=$MPCONFIGDIR"
318eval "MPCONFIGDIR_EXPANDED=$MPCONFIGDIR_EXPANDED"
319AC_SUBST(MPCONFIGDIR_EXPANDED)
320eval "localstatedir_expanded=$localstatedir"
321AC_SUBST(localstatedir_expanded)
322# Compute the libexec dir for the vendor packages
323eval "macports_libexec_dir=${libexecdir}/macports"
324eval "macports_libexec_dir=$macports_libexec_dir"
325prefix=$oldprefix
326exec_prefix=$oldexec_prefix
327
328## Tcl package
329tcl_version=8.5.15
330tcl_thread_version=2.7.0
331tclx_version=8.4.1
332tcllib_version=1.15
333MP_CONFIG_TARBALL([vendor/tcl${tcl_version}-src.tar.gz], [vendor/tcl${tcl_version}/unix], [--prefix=${macports_libexec_dir} --enable-threads])
334VENDOR_TCL_SUBDIR=tcl${tcl_version}/unix
335VENDOR_TCL_INSTALL="install-binaries install-libraries"
336AC_SUBST(VENDOR_TCL_SUBDIR)
337AC_SUBST(VENDOR_TCL_INSTALL)
338
339# Set up some variables needed by MacPorts' Tcl setup
340VENDOR_DESTROOT=vendor/vendor-destroot
341AC_SUBST(VENDOR_DESTROOT)
342
343## Tcl Thread package
344# Tcl supports Threads internally, but to use threads from Tcl code we need
345# this package
346MP_CONFIG_TARBALL([vendor/thread${tcl_thread_version}.tar.gz], [vendor/thread${tcl_thread_version}], [--prefix=${macports_libexec_dir}])
347VENDOR_TCLTHREAD_SUBDIR=thread${tcl_thread_version}
348VENDOR_TCLTHREAD_INSTALL="install-binaries install-libraries"
349AC_SUBST(VENDOR_TCLTHREAD_SUBDIR)
350AC_SUBST(VENDOR_TCLTHREAD_INSTALL)
351
352## TclX package
353# TclX is required for signal handling
354MP_CONFIG_TARBALL([vendor/tclx${tclx_version}.tar.bz2], [vendor/tclx8.4], [--prefix=${macports_libexec_dir}])
355VENDOR_TCLX_SUBDIR=tclx8.4
356VENDOR_TCLX_INSTALL="install-binaries install-libraries"
357AC_SUBST(VENDOR_TCLX_SUBDIR)
358AC_SUBST(VENDOR_TCLX_INSTALL)
359
360## Tcllib package
361# Note that Tcllib needs a Tcl interpreter during installation; it will *not*
362# be the one we configure above, because that one isn't built yet. That's not
363# a problem, though -- it's only used during installation.
364MP_CONFIG_TARBALL([vendor/tcllib-${tcllib_version}.tar.gz], [vendor/tcllib-${tcllib_version}], [--prefix=${macports_libexec_dir}])
365VENDOR_TCLLIB_SUBDIR=tcllib-${tcllib_version}
366VENDOR_TCLLIB_INSTALL="install-libraries"
367AC_SUBST(VENDOR_TCLLIB_SUBDIR)
368AC_SUBST(VENDOR_TCLLIB_INSTALL)
369
370# Load tclConfig.sh from our private install of Tcl
371AC_MSG_CHECKING([for Tcl configuration])
372TCL_BIN_DIR=`(cd vendor/tcl${tcl_version}/unix; pwd)`
373AC_MSG_RESULT([found $TCL_BIN_DIR/tclConfig.sh])
374SC_LOAD_TCLCONFIG
375SC_ENABLE_SHARED
376
377# Pull compiler/linker values from tclConfig.sh
378SHLIB_LD=${TCL_SHLIB_LD}
379STLIB_LD=${TCL_STLIB_LD}
380SHLIB_CFLAGS=${TCL_SHLIB_CFLAGS}
381SHLIB_SUFFIX=${TCL_SHLIB_SUFFIX}
382TCLSH=${TCL_EXEC_PREFIX}/bin/tclsh${TCL_VERSION}
383INTREE_TCLSH=${TCL_BIN_DIR}/tclsh
384# strip possible whitespace at the end of TCL_PACKAGE_PATH
385eval "TCL_PACKAGE_PATH=${TCL_PACKAGE_PATH}"
386
387AC_SUBST(SHLIB_LD)
388AC_SUBST(STLIB_LD)
389AC_SUBST(SHLIB_CFLAGS)
390AC_SUBST(SHLIB_SUFFIX)
391AC_SUBST(TCL_PREFIX)
392AC_SUBST(TCL_VERSION)
393AC_SUBST(TCL_PACKAGE_PATH)
394AC_SUBST(TCL_STUB_LIB_SPEC)
395AC_SUBST(TCL_SRC_DIR)
396AC_SUBST(TCLSH)
397AC_SUBST(INTREE_TCLSH)
398
399INCLUDES="-I.. -I. $INCLUDES"
400AC_SUBST(INCLUDES)
401
402# Check if there's an existing DP/MP install too old to upgrade
403MP_CHECK_OLDLAYOUT
404
405# Output
406AC_CONFIG_FILES([
407        Doxyfile
408        Makefile
409        Mk/macports.autoconf.mk
410        doc/Makefile
411        doc/base.mtree
412        doc/macosx.mtree
413        doc/macports.conf
414        doc/prefix.mtree
415        doc/pubkeys.conf
416        portmgr/dmg/postflight
417        setupenv.bash
418        src/Makefile
419        src/cregistry/Makefile
420        src/darwintracelib1.0/Makefile
421        src/machista1.0/Makefile
422        src/macports1.0/Makefile
423        src/macports1.0/macports_autoconf.tcl
424        src/macports1.0/macports_test_autoconf.tcl
425        src/package1.0/Makefile
426        src/package1.0/package_test_autoconf.tcl
427        src/pextlib1.0/Makefile
428        src/port/Makefile
429        src/port1.0/Makefile
430        src/port1.0/port_autoconf.tcl
431        src/port1.0/port_test_autoconf.tcl
432        src/programs/Makefile
433        src/registry2.0/Makefile
434        src/registry2.0/registry_autoconf.tcl
435        tests/Makefile
436        tests/test.tcl
437        tests/test/library.tcl
438        tests/test/trace/test.tcl
439        vendor/Makefile
440])
441
442AC_CONFIG_FILES([src/dedup_portfiles.tcl], [chmod +x src/dedup_portfiles.tcl])
443AC_CONFIG_FILES([src/images_to_archives.tcl], [chmod +x src/images_to_archives.tcl])
444AC_CONFIG_FILES([src/pkg_mkindex.sh], [chmod +x src/pkg_mkindex.sh])
445AC_CONFIG_FILES([src/upgrade_sources_conf_default.tcl], [chmod +x src/upgrade_sources_conf_default.tcl])
446
447AC_OUTPUT
Note: See TracBrowser for help on using the repository browser.