source: trunk/base/configure.ac @ 123007

Last change on this file since 123007 was 123007, checked in by afb@…, 6 years ago

base: remove (MacPorts 1.6) packaging for other operating systems

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 13.4 KB
Line 
1dnl Process this file with autoconf to produce a configure script.
2dnl $Id: configure.ac 123007 2014-08-03 19:05:00Z afb@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]])
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*)
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.*)
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
105MP_TOOL_PATH(BSDMAKE, [bsdmake/pmake])
106MP_TOOL_PATH(BZIP2, [bzip2])
107MP_TOOL_PATH(CVS, [cvs])
108MP_TOOL_PATH(GNUMAKE, [gnumake])
109MP_TOOL_PATH(GNUTAR, [gnutar])
110MP_TOOL_PATH(LZMA, [lzma])
111MP_TOOL_PATH(MAKE, [make])
112MP_TOOL_PATH(MTREE, [mtree])
113MP_TOOL_PATH(OPEN, [open])
114MP_TOOL_PATH(OPENSSL, [openssl])
115MP_TOOL_PATH(RSYNC, [rsync])
116MP_TOOL_PATH(SED, [sed])
117MP_TOOL_PATH(SVN, [svn])
118MP_TOOL_PATH(SWIG, [swig])
119MP_TOOL_PATH(TAR, [tar])
120MP_TOOL_PATH(XAR, [xar])
121MP_TOOL_PATH(XZ, [xz])
122
123# Search for tool paths. Any set above (via --with-pkg=PATH) will be retained
124AC_PATH_PROGS(BSDMAKE, [bsdmake pmake], [])
125AC_PATH_PROG(BZIP2, [bzip2], [])
126AC_PATH_PROG(BZR, [bzr], [])
127AC_PATH_PROG(CHOWN, [chown], [], [$PATH:/usr/sbin])
128AC_PATH_PROG(CP, [cp], [])
129AC_PATH_PROG(CPIO, [cpio], [])
130AC_PATH_PROG(CVS, [cvs], [])
131AC_PATH_PROG(DIFF, [diff], [])
132AC_PATH_PROG(DSCL, [dscl], [])
133AC_PATH_PROG(DSEDITGROUP, [dseditgroup], [], [$PATH:/usr/sbin])
134AC_PATH_PROG(FILE, [file], [])
135AC_PATH_PROG(FIND, [find], [])
136AC_PATH_PROG(GIT, [git], [])
137AC_PATH_PROGS(GNUMAKE, [gnumake gmake], [])
138AC_PATH_PROGS(GNUPATCH, [gnupatch gpatch], [])
139AC_PATH_PROGS(GNUTAR, [gnutar gtar], [])
140AC_PATH_PROG(GZIP, [gzip], [])
141AC_PATH_PROG(HDIUTIL, [hdiutil], [])
142AC_PATH_PROG(HG, [hg], [])
143AC_PATH_PROG(LAUNCHCTL, [launchctl], [])
144AC_PATH_PROG(LIPO, [lipo], [])
145AC_PATH_PROG(LSBOM, [lsbom], [])
146AC_PATH_PROG(LZMA, [lzma], [])
147AC_PATH_PROG(MAKE, [make])
148AC_PATH_PROG(MAN, [man])
149AC_PATH_PROG(MDFIND, [mdfind], [])
150AC_PATH_PROG(MDLS, [mdls], [])
151AC_PATH_PROG(MKBOM, [mkbom], [])
152AC_PATH_PROGS(MTREE, [mtree fmtree], [], [$PATH:/usr/sbin])
153AC_PATH_PROG(OPEN, [open], [])
154AC_PATH_PROG(OPENSSL, [openssl], [])
155AC_PATH_PROG(PATCH, [patch], [])
156AC_PATH_PROG(PAX, [pax], [])
157AC_PATH_PROG(RMDIR, [rmdir], [])
158AC_PATH_PROG(RSYNC, [rsync], [])
159AC_PATH_PROG(SANDBOX_EXEC, [sandbox-exec], [], [/usr/bin])
160AC_PATH_PROG(SED, [sed])
161AC_PATH_PROG(SVN, [svn], [])
162AC_PATH_PROG(SWIG, [swig], [])
163AC_PATH_PROG(TAR, [tar])
164AC_PATH_PROG(UNZIP, [unzip])
165AC_PATH_PROG(XAR, [xar], [])
166AC_PATH_PROG(XCODEBUILD, [xcodebuild], [])
167AC_PATH_PROG(XCRUN, [xcrun], [])
168AC_PATH_PROG(XZ, [xz], [])
169AC_PATH_PROG(ZIP, [zip])
170
171AC_CHECK_PROG(HAVE_LAUNCHD, [launchd], [yes], [], [/sbin])
172
173if test "x$MTREE" = "x"; then
174    AC_MSG_ERROR([mtree not found])
175fi
176
177MP_SED_EXTENDED_REGEXP
178MP_TAR_FAST_READ
179MP_TAR_NO_SAME_OWNER
180MP_PATCH_GNU_VERSION
181
182# Quiche eaters options.
183if test x$GCC = xyes; then
184        CFLAGS_QUICHEEATERS='-Wextra -Wall'
185        CFLAGS_PEDANTIC='-pedantic'
186fi
187AC_SUBST(CFLAGS_QUICHEEATERS)
188AC_SUBST(CFLAGS_PEDANTIC)
189MP_WERROR
190
191MP_COMPILER_ATTRIBUTE_UNUSED
192MP_COMPILER_ATTRIBUTE_LF_PRIVATE
193
194# Foundation checks
195ACX_PTHREAD
196MP_OBJC_RUNTIME
197MP_OBJC_FOUNDATION
198
199MP_PROG_DAEMONDO
200
201AC_SUBST(EXTRA_PROGS)
202
203# set default ports-directory
204PORTS_DIR_DEFAULT=`pwd | sed -e "s/base/ports/"`
205
206# Check for paths
207AC_PREFIX_DEFAULT(/opt/local)
208AC_ARG_WITH(
209                unsupported-prefix,
210                AS_HELP_STRING([--with-unsupported-prefix],
211                [Acknowledge that you accept the consequences of using an unsupported prefix.]),
212                [with_unsupported_prefix=$withval],
213                [with_unsupported_prefix=no])
214if test x$prefix = x/usr/local -o x$prefix = x/usr && test x$with_unsupported_prefix != xyes; then
215    AC_MSG_ERROR([Installing MacPorts into $prefix is not supported. If \
216you understand this and wish to do so anyway, pass --with-unsupported-prefix \
217to configure.])
218fi
219MP_PATH_PORTSDIR([$PORTS_DIR_DEFAULT])
220MP_PATH_MPCONFIGDIR
221
222# Check whether to install without root privileges
223MP_CHECK_NOROOTPRIVILEGES
224
225# Check for install ownership
226MP_CHECK_INSTALLUSER
227MP_CHECK_INSTALLGROUP
228MP_CHECK_RUNUSER
229MP_DIRECTORY_MODE
230MP_SHARED_DIRECTORY
231
232# Check for default directories
233MP_PATH_APPLICATIONS
234MP_PATH_FRAMEWORKS
235
236# Check for universal options
237MP_UNIVERSAL_OPTIONS
238
239# Check for standard header files.
240AC_HEADER_STDC
241AC_HEADER_DIRENT
242AC_HEADER_SYS_WAIT
243AC_CHECK_HEADERS([crt_externs.h err.h fcntl.h libkern/OSAtomic.h limits.h paths.h pwd.h \
244        readline/history.h readline/readline.h spawn.h sys/cdefs.h sys/event.h sys/fcntl.h sys/file.h \
245        sys/paths.h sys/socket.h sys/sysctl.h utime.h])
246
247# Checks for library functions.
248AC_CHECK_FUNCS([OSAtomicCompareAndSwap32 OSAtomicCompareAndSwap64 \
249        OSAtomicCompareAndSwapPtr __getdirentries64 bzero clearenv copyfile fgetln \
250        flock fls kqueue lockf memset posix_spawn setmode strcasecmp strlcat \
251        strlcpy strncasecmp sysctlbyname])
252AC_SUBST([ac_cv_func_strlcat])
253
254MP_CHECK_READLINK_IS_P1003_1A
255
256# Check for md5 implementation
257AC_CHECK_HEADER([CommonCrypto/CommonDigest.h], [AC_DEFINE([HAVE_COMMONCRYPTO_COMMONDIGEST_H], [1], [Define if CommonCrypto is available.])], [MP_LIB_MD5])
258
259# Check for readline
260AC_ARG_ENABLE(readline, AS_HELP_STRING([--enable-readline],[Enable addition of readline support, if readline present.]),
261[
262        AC_CHECK_LIB([readline], [readline], [
263                                  READLINE_LIBS=-lreadline
264                                  AC_DEFINE([HAVE_LIBREADLINE], [1], [Define to 1 if you have the 'readline' library (-lreadline).])
265                                  ])
266        AC_CHECK_DECLS([rl_username_completion_function,rl_filename_completion_function,rl_completion_matches,username_completion_function,filename_completion_function,completion_matches], [], [],
267        [
268        #include <stdio.h>
269        #if HAVE_READLINE_READLINE_H
270        # include <readline/readline.h>
271        #endif
272        ])
273])
274AC_SUBST(READLINE_LIBS)
275
276# Lowest non-system-reserved uid and gid (Apple claims <500)
277AC_DEFINE([MIN_USABLE_UID], [500], [Lowest non-system-reserved UID.])
278AC_DEFINE([MIN_USABLE_GID], [500], [Lowest non-system-reserved GID.])
279
280# Substitute platform for base compatibility check
281MP_PLATFORM
282
283## libcurl
284MP_LIBCURL_FLAGS
285
286## sqlite3
287MP_SQLITE3_FLAGS
288
289MP_CHECK_SQLITE_VERSION(3003011)
290if test "x${mp_sqlite_version_ge_3003011}" = "xno"; then
291        AC_DEFINE([sqlite3_prepare_v2], [sqlite3_prepare], [define sqlite3_prepare to sqlite_prepare_v2 if the latter is not available])
292fi
293
294# check whether trace mode is supported on this platform
295MP_TRACEMODE_SUPPORT
296
297# misc variables that need to be expanded for substitution into tcl
298oldprefix=$prefix
299oldexec_prefix=$exec_prefix
300if test "x$prefix" = "xNONE" ; then
301   prefix=$ac_default_prefix
302fi
303if test "x$exec_prefix" = "xNONE" ; then
304        exec_prefix=$prefix
305fi
306eval "prefix_expanded=$prefix"
307eval "exec_prefix_expanded=$exec_prefix"
308AC_SUBST(prefix_expanded)
309# do this twice, since there is a nested variable of
310# ${prefix} inside of ${sysconfdir}
311eval "MPCONFIGDIR_EXPANDED=$MPCONFIGDIR"
312eval "MPCONFIGDIR_EXPANDED=$MPCONFIGDIR_EXPANDED"
313AC_SUBST(MPCONFIGDIR_EXPANDED)
314eval "localstatedir_expanded=$localstatedir"
315AC_SUBST(localstatedir_expanded)
316# Compute the libexec dir for the vendor packages
317eval "macports_libexec_dir=${libexecdir}/macports"
318eval "macports_libexec_dir=$macports_libexec_dir"
319prefix=$oldprefix
320exec_prefix=$oldexec_prefix
321
322## Tcl package
323tcl_version=8.5.15
324tcl_thread_version=2.7.0
325tclx_version=8.4.1
326tcllib_version=1.15
327MP_CONFIG_TARBALL([vendor/tcl${tcl_version}-src.tar.gz], [vendor/tcl${tcl_version}/unix], [--prefix=${macports_libexec_dir} --enable-threads])
328VENDOR_TCL_SUBDIR=tcl${tcl_version}/unix
329VENDOR_TCL_INSTALL="install-binaries install-libraries"
330AC_SUBST(VENDOR_TCL_SUBDIR)
331AC_SUBST(VENDOR_TCL_INSTALL)
332
333# Set up some variables needed by MacPorts' Tcl setup
334VENDOR_DESTROOT=vendor/vendor-destroot
335AC_SUBST(VENDOR_DESTROOT)
336
337## Tcl Thread package
338# Tcl supports Threads internally, but to use threads from Tcl code we need
339# this package
340MP_CONFIG_TARBALL([vendor/thread${tcl_thread_version}.tar.gz], [vendor/thread${tcl_thread_version}], [--prefix=${macports_libexec_dir}])
341VENDOR_TCLTHREAD_SUBDIR=thread${tcl_thread_version}
342VENDOR_TCLTHREAD_INSTALL="install-binaries install-libraries"
343AC_SUBST(VENDOR_TCLTHREAD_SUBDIR)
344AC_SUBST(VENDOR_TCLTHREAD_INSTALL)
345
346## TclX package
347# TclX is required for signal handling
348MP_CONFIG_TARBALL([vendor/tclx${tclx_version}.tar.bz2], [vendor/tclx8.4], [--prefix=${macports_libexec_dir}])
349VENDOR_TCLX_SUBDIR=tclx8.4
350VENDOR_TCLX_INSTALL="install-binaries install-libraries"
351AC_SUBST(VENDOR_TCLX_SUBDIR)
352AC_SUBST(VENDOR_TCLX_INSTALL)
353
354## Tcllib package
355# Note that Tcllib needs a Tcl interpreter during installation; it will *not*
356# be the one we configure above, because that one isn't built yet. That's not
357# a problem, though -- it's only used during installation.
358MP_CONFIG_TARBALL([vendor/tcllib-${tcllib_version}.tar.gz], [vendor/tcllib-${tcllib_version}], [--prefix=${macports_libexec_dir}])
359VENDOR_TCLLIB_SUBDIR=tcllib-${tcllib_version}
360VENDOR_TCLLIB_INSTALL="install-libraries"
361AC_SUBST(VENDOR_TCLLIB_SUBDIR)
362AC_SUBST(VENDOR_TCLLIB_INSTALL)
363
364# Load tclConfig.sh from our private install of Tcl
365AC_MSG_CHECKING([for Tcl configuration])
366TCL_BIN_DIR=`(cd vendor/tcl${tcl_version}/unix; pwd)`
367AC_MSG_RESULT([found $TCL_BIN_DIR/tclConfig.sh])
368SC_LOAD_TCLCONFIG
369SC_ENABLE_SHARED
370
371# Pull compiler/linker values from tclConfig.sh
372SHLIB_LD=${TCL_SHLIB_LD}
373STLIB_LD=${TCL_STLIB_LD}
374SHLIB_CFLAGS=${TCL_SHLIB_CFLAGS}
375SHLIB_SUFFIX=${TCL_SHLIB_SUFFIX}
376TCLSH=${TCL_EXEC_PREFIX}/bin/tclsh${TCL_VERSION}
377INTREE_TCLSH=${TCL_BIN_DIR}/tclsh
378# strip possible whitespace at the end of TCL_PACKAGE_PATH
379eval "TCL_PACKAGE_PATH=${TCL_PACKAGE_PATH}"
380
381AC_SUBST(SHLIB_LD)
382AC_SUBST(STLIB_LD)
383AC_SUBST(SHLIB_CFLAGS)
384AC_SUBST(SHLIB_SUFFIX)
385AC_SUBST(TCL_PREFIX)
386AC_SUBST(TCL_VERSION)
387AC_SUBST(TCL_PACKAGE_PATH)
388AC_SUBST(TCL_STUB_LIB_SPEC)
389AC_SUBST(TCL_SRC_DIR)
390AC_SUBST(TCLSH)
391AC_SUBST(INTREE_TCLSH)
392
393INCLUDES="-I.. -I. $INCLUDES"
394AC_SUBST(INCLUDES)
395
396# Check if there's an existing DP/MP install too old to upgrade
397MP_CHECK_OLDLAYOUT
398
399# Output
400AC_CONFIG_FILES([
401        Doxyfile
402        Makefile
403        Mk/macports.autoconf.mk
404        doc/Makefile
405        doc/base.mtree
406        doc/macosx.mtree
407        doc/macports.conf
408        doc/prefix.mtree
409        doc/pubkeys.conf
410        portmgr/dmg/postflight
411        setupenv.bash
412        src/Makefile
413        src/cregistry/Makefile
414        src/darwintracelib1.0/Makefile
415        src/machista1.0/Makefile
416        src/macports1.0/Makefile
417        src/macports1.0/macports_autoconf.tcl
418        src/macports1.0/macports_test_autoconf.tcl
419        src/package1.0/Makefile
420        src/package1.0/package_test_autoconf.tcl
421        src/pextlib1.0/Makefile
422        src/port/Makefile
423        src/port1.0/Makefile
424        src/port1.0/port_autoconf.tcl
425        src/port1.0/port_test_autoconf.tcl
426        src/programs/Makefile
427        src/registry2.0/Makefile
428        src/registry2.0/registry_autoconf.tcl
429        tests/Makefile
430        tests/test.tcl
431        tests/test/library.tcl
432        tests/test/trace/test.tcl
433        vendor/Makefile
434])
435
436AC_CONFIG_FILES([src/dedup_portfiles.tcl], [chmod +x src/dedup_portfiles.tcl])
437AC_CONFIG_FILES([src/images_to_archives.tcl], [chmod +x src/images_to_archives.tcl])
438AC_CONFIG_FILES([src/pkg_mkindex.sh], [chmod +x src/pkg_mkindex.sh])
439AC_CONFIG_FILES([src/upgrade_sources_conf_default.tcl], [chmod +x src/upgrade_sources_conf_default.tcl])
440
441AC_OUTPUT
Note: See TracBrowser for help on using the repository browser.