source: trunk/base/configure.ac @ 70583

Last change on this file since 70583 was 68996, checked in by jmr@…, 10 years ago

Added integrity checking for fetched archives via signed digests. New pubkeys.conf file allows configuring keys to trust. The private counterpart of the installed public key will of course need to live on our binary building server.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 10.3 KB
Line 
1dnl Process this file with autoconf to produce a configure script.
2dnl $Id: configure.ac 68996 2010-06-19 23:21:02Z jmr@macports.org $
3AC_PREREQ(2.63)
4AC_DEFUN([MACPORTS_VERSION_MACRO], [esyscmd(cat 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
19
20AC_PATH_PROG(SW_VERS, sw_vers)
21AC_PATH_PROG(DEFAULTS, defaults)
22AC_PATH_PROG(XCODE_SELECT, xcode-select)
23
24if test "x$SW_VERS" != "x"; then
25  AC_MSG_CHECKING(Mac OS X version)
26  MACOSX_VERSION=`$SW_VERS -productVersion`
27  AC_MSG_RESULT([$MACOSX_VERSION])
28fi
29
30case "$MACOSX_VERSION" in
31  10.0*|10.1*|10.2*|10.3*)
32    AC_MSG_ERROR([This version of Mac OS X is not supported
33                  Please upgrade at http://store.apple.com/])
34    ;;
35  10.4.[[0-9]]|10.4.10|10.5.[[0-7]]|10.6.[[0-1]])
36    AC_MSG_WARN([This version of Mac OS X is out of date])
37    AC_MSG_WARN([Please run Software Update to update it])
38    ;;
39  10.4*|10.5*|10.6*)
40    dnl Supported version
41    ;;
42  *)
43    ;;
44esac
45
46# locate currently selected Xcode path
47if test "x$XCODE_SELECT" != "x"; then
48  AC_MSG_CHECKING(Xcode location)
49  DEVELOPER_DIR=`$XCODE_SELECT -print-path`
50  AC_MSG_RESULT([$DEVELOPER_DIR])
51else
52  DEVELOPER_DIR=/Developer
53fi
54AC_SUBST(DEVELOPER_DIR)
55
56XCODEPLIST=$DEVELOPER_DIR/Applications/Xcode.app/Contents/version.plist
57if test -r "$XCODEPLIST"; then
58  AC_MSG_CHECKING(Xcode version)
59  if test "x$DEFAULTS" != "x"; then
60    XCODE_VERSION=`$DEFAULTS read $DEVELOPER_DIR/Applications/Xcode.app/Contents/version CFBundleShortVersionString`
61  else
62    XCODE_VERSION=`tr -d '\r\n' < $XCODEPLIST | sed -e 's/.*<key>CFBundleShortVersionString<\/key>.<string>\([[0-9.]]*\)<\/string>.*/\1/'`
63  fi
64  AC_MSG_RESULT([$XCODE_VERSION])
65fi
66
67case "$XCODE_VERSION" in
68  1.*|2.[[0-1]]*)
69    AC_MSG_WARN([This version of Xcode Tools is not supported])
70    AC_MSG_WARN([Please upgrade at http://connect.apple.com/])
71    ;;
72  2.[[2-3]]*|3.[[0]]*)
73    AC_MSG_WARN([This version of Xcode Tools is out of date])
74    AC_MSG_WARN([Please consider upgrading as some ports fail compiling])
75    ;;
76  2.*|3.*)
77    dnl Supported version
78    ;;
79  *)
80    ;;
81esac
82
83# Checks for programs.
84AC_PROG_CC
85AC_PROG_OBJC
86AC_PROG_INSTALL
87AC_PROG_MAKE_SET
88AC_PROG_LN_S
89AC_PATH_PROG(MTREE, [mtree], [], [$PATH:/usr/sbin])
90AC_PATH_PROG(CHOWN, [chown], [], [$PATH:/usr/sbin])
91AC_PATH_PROG(CP, [cp], [])
92AC_PATH_PROG(CPIO, [cpio], [])
93AC_PATH_PROG(DIFF, [diff], [])
94AC_PATH_PROG(DSCL, [dscl], [])
95AC_PATH_PROG(FILE, [file], [])
96AC_PATH_PROG(BZR, [bzr], [])
97AC_PATH_PROG(CVS, [cvs], [])
98AC_PATH_PROG(SVN, [svn], [])
99AC_PATH_PROG(GIT, [git], [])
100AC_PATH_PROG(HG, [hg], [])
101AC_PATH_PROG(GZIP, [gzip], [])
102AC_PATH_PROG(LIPO, [lipo], [])
103AC_PATH_PROG(PATCH, [patch], [])
104AC_PATH_PROG(RMDIR, [rmdir], [])
105AC_PATH_PROG(RSYNC, [rsync], [])
106AC_PATH_PROG(OPENSSL, [openssl], [])
107AC_PATH_PROG(SED, [sed])
108AC_PATH_PROG(TAR, [tar])
109AC_PATH_PROG(UNZIP, [unzip])
110AC_PATH_PROG(ZIP, [zip])
111AC_PATH_PROGS(BSDMAKE, [bsdmake pmake], [])
112AC_PATH_PROG(MAKE, [make])
113AC_PATH_PROG(HDIUTIL, [hdiutil], [])
114AC_CHECK_PROG(HAVE_LAUNCHD, [launchd], [yes], [])
115AC_PATH_PROG(LAUNCHCTL, [launchctl], [])
116AC_PATH_PROG(XCODEBUILD, [xcodebuild], [])
117AC_PATH_PROGS(GNUTAR, [gnutar gtar], [], [$PATH:/usr/local/bin])
118AC_PATH_PROGS(GNUMAKE, [gnumake gmake], [], [$PATH:/usr/local/bin])
119AC_PATH_PROGS(GNUPATCH, [gnupatch gpatch], [], [$PATH:/usr/local/bin])
120AC_PATH_PROG(BZIP2, [bzip2], [])
121AC_PATH_PROG(LSBOM, [lsbom], [])
122AC_PATH_PROG(MKBOM, [mkbom], [])
123AC_PATH_PROG(PAX, [pax], [])
124AC_PATH_PROG(XAR, [xar], [])
125AC_PATH_PROG(OPEN, [open], [])
126
127# Define some precious variables allowing user to override PATH for some programs
128AC_ARG_VAR(MTREE, [path to mtree command])
129AC_ARG_VAR(CVS, [path to cvs command])
130AC_ARG_VAR(SVN, [path to svn command])
131AC_ARG_VAR(OPENSSL, [path to openssl command])
132AC_ARG_VAR(RSYNC, [path to rsync command])
133AC_ARG_VAR(SED, [path to sed command])
134AC_ARG_VAR(TAR, [path to tar command])
135AC_ARG_VAR(MAKE, [path to make command])
136AC_ARG_VAR(GNUTAR, [path to gnutar command])
137AC_ARG_VAR(BSDMAKE, [path to bsdmake/pmake command])
138AC_ARG_VAR(GNUMAKE, [path to gnumake command])
139AC_ARG_VAR(BZIP2, [path to bzip2 command])
140AC_ARG_VAR(XAR, [path to xar command])
141AC_ARG_VAR(OPEN, [path to open command])
142
143MP_SED_EXTENDED_REGEXP
144MP_TAR_NO_SAME_OWNER
145MP_PATCH_GNU_VERSION
146
147# Quiche eaters options.
148if test x$GCC = xyes; then
149        CFLAGS_QUICHEEATERS='-W -Wall -pedantic'
150fi
151AC_SUBST(CFLAGS_QUICHEEATERS)
152MP_WERROR
153
154MP_COMPILER_ATTRIBUTE_UNUSED
155MP_COMPILER_ATTRIBUTE_LF_PRIVATE
156
157# Foundation checks
158ACX_PTHREAD
159MP_OBJC_RUNTIME
160MP_OBJC_FOUNDATION
161
162MP_PROG_DAEMONDO
163
164AC_SUBST(EXTRA_PROGS)
165
166# set default ports-directory
167PORTS_DIR_DEFAULT=`pwd | sed -e "s/base/ports/"`
168
169# Check for paths
170AC_PREFIX_DEFAULT(/opt/local)
171if test x$prefix = x/usr/local; then
172    AC_MSG_ERROR([Installing MacPorts into /usr/local is not supported])
173fi
174MP_PATH_PORTSDIR([$PORTS_DIR_DEFAULT])
175MP_PATH_MPCONFIGDIR
176
177# Check whether to install without root privileges
178MP_CHECK_NOROOTPRIVILEGES
179
180# Check for install ownership
181MP_CHECK_INSTALLUSER
182MP_CHECK_INSTALLGROUP
183MP_CHECK_RUNUSER
184MP_DIRECTORY_MODE
185MP_SHARED_DIRECTORY
186
187# Check for default directories
188MP_PATH_APPLICATIONS
189MP_PATH_FRAMEWORKS
190
191# Check for universal options
192MP_UNIVERSAL_OPTIONS
193
194# Check for standard header files.
195AC_HEADER_STDC
196AC_HEADER_DIRENT
197AC_HEADER_SYS_WAIT
198AC_CHECK_HEADERS([limits.h paths.h sys/file.h crt_externs.h fcntl.h sys/fcntl.h sys/cdefs.h err.h sys/socket.h \
199        sys/sysctl.h readline/readline.h readline/history.h pwd.h sys/paths.h utime.h])
200
201INCLUDES="-I.. -I. $INCLUDES"
202
203# Checks for library functions.
204AC_CHECK_FUNCS([bzero memset fgetln lockf flock setmode strcasecmp strncasecmp strlcpy copyfile clearenv sysctlbyname])
205MP_CHECK_READLINK_IS_P1003_1A
206
207# Check for md5 implementation
208AC_CHECK_HEADER([CommonCrypto/CommonDigest.h], [AC_DEFINE([HAVE_COMMONCRYPTO_COMMONDIGEST_H], [1], [Define if CommonCrypto is available.])], [MP_LIB_MD5])
209
210# Check for readline
211AC_ARG_ENABLE(readline, AS_HELP_STRING([--enable-readline],[Enable addition of readline support, if readline present.]),
212[
213        AC_CHECK_LIB([readline], [readline], [
214                                  READLINE_LIBS=-lreadline
215                                  AC_DEFINE([HAVE_LIBREADLINE], [1], [Define to 1 if you have the `readline' library (-lreadline).])
216                                  ])
217        AC_CHECK_DECLS([rl_username_completion_function,rl_filename_completion_function,rl_completion_matches,username_completion_function,filename_completion_function,completion_matches], [], [],
218        [
219        #include <stdio.h>
220        #if HAVE_READLINE_READLINE_H
221        # include <readline/readline.h>
222        #endif
223        ])
224])
225AC_SUBST(READLINE_LIBS)
226
227# Lowest non-system-reserved uid and gid (Apple claims <500)
228AC_DEFINE([MIN_USABLE_UID], [500], [Lowest non-system-reserved UID.])
229AC_DEFINE([MIN_USABLE_GID], [500], [Lowest non-system-reserved GID.])
230
231# Load tclConfig.sh
232SC_PATH_TCLCONFIG
233SC_LOAD_TCLCONFIG
234
235# Check for Tcl public headers
236dnl XXX  hardwire CYGPATH (CYGPATH must be set for SC_PUBLIC_TCL_HEADERS)
237CYGPATH=echo
238SC_PUBLIC_TCL_HEADERS
239
240# Check for tclsh binary
241MP_PROG_TCLSH
242
243# Check for Tcl package path
244MP_TCL_PACKAGE_DIR
245
246# Check if thread is enabled.
247MP_TCL_THREAD_SUPPORT
248
249## libcurl
250MP_LIBCURL_FLAGS
251
252## sqlite3
253MP_SQLITE3_FLAGS
254
255# Determine if we need to install some bundled packages
256OUR_INCLUDED_PACKAGES=
257
258## Thread package.
259AC_ARG_WITH(
260                included-tclthread,
261                AS_HELP_STRING([--with-included-tclthread],
262                        [install included Thread package.]),
263                [with_included_tclthread=$withval],
264                [with_included_tclthread="unspecified"])
265
266# Check if thread package is already installed.
267if test "x$with_included_tclthread" = "xunspecified" ; then
268        MP_TCL_PACKAGE(
269                [Thread],
270                [AC_MSG_RESULT([yes]); with_included_tclthread=no],
271                [AC_MSG_RESULT([no]); with_included_tclthread=yes])
272fi
273
274# If thread package isn't installed, configure and install thread package.
275if test "$with_included_tclthread" = "yes"; then
276        OUR_INCLUDED_PACKAGES="$OUR_INCLUDED_PACKAGES thread2.6"
277        AC_CONFIG_SUBDIRS([src/thread2.6])
278        # Extract thread package
279        (cd src/; gzip -d < thread2.6.tar.gz | tar xf -)
280        # Patch thread package (so thread2.6 is the vanilla distribution directory)
281        patch -p0 < src/thread2.6.diff
282fi
283
284AH_TEMPLATE([TRACE_SDK], [SDK for SDK redirect in tracelib])
285AC_ARG_WITH(
286        trace-sdk,
287        AS_HELP_STRING([--with-trace-sdk=SDK],
288                [SDK for redirection in trace lib (for example MacOSX10.4u.sdk)]),
289        [test -d ${DEVELOPER_DIR}/SDKs/$withval && AC_DEFINE_UNQUOTED([TRACE_SDK], "${withval}")], [])
290
291# Allows building of shared libraries
292SC_ENABLE_SHARED
293
294# Pull compiler / linker values from tclConfig.sh
295LDFLAGS_DEBUG=${TCL_LDFLAGS_DEBUG}
296LDFLAGS_OPTIMIZE=${TCL_LDFLAGS_OPTIMIZE}
297SHLIB_LD=${TCL_SHLIB_LD}
298STLIB_LD=${TCL_STLIB_LD}
299SHLIB_CFLAGS=${TCL_SHLIB_CFLAGS}
300SHLIB_SUFFIX=${TCL_SHLIB_SUFFIX}
301
302AC_SUBST(INCLUDES)
303AC_SUBST(PATHCONF)
304AC_SUBST(STLIB_LD)
305AC_SUBST(SHLIB_LD)
306AC_SUBST(SHLIB_CFLAGS)
307AC_SUBST(SHLIB_LDFLAGS)
308AC_SUBST(SHLIB_SUFFIX)
309AC_SUBST(TCL_DEFS)
310AC_SUBST(TCL_STUB_LIB_SPEC)
311AC_SUBST(TCL_CC)
312AC_SUBST(OUR_INCLUDED_PACKAGES)
313
314# misc variables that need to be expanded for substitution into tcl
315
316oldprefix=$prefix
317if test "x$prefix" = "xNONE" ; then
318   prefix=$ac_default_prefix
319fi
320
321# Check if there's an existing DP/MP install too old to upgrade
322MP_CHECK_OLDLAYOUT
323
324eval "prefix_expanded=$prefix"
325AC_SUBST(prefix_expanded)
326# do this twice, since there is a nested variable of
327# ${prefix} inside of ${sysconfdir}
328eval "MPCONFIGDIR_EXPANDED=$MPCONFIGDIR"
329eval "MPCONFIGDIR_EXPANDED=$MPCONFIGDIR_EXPANDED"
330AC_SUBST(MPCONFIGDIR_EXPANDED)
331eval "localstatedir_expanded=$localstatedir"
332AC_SUBST(localstatedir_expanded)
333eval "macports_tcl_dir=${datadir}/macports/Tcl"
334eval "macports_tcl_dir=$macports_tcl_dir"
335AC_SUBST(macports_tcl_dir)
336
337prefix=$oldprefix
338
339dnl man page settings (compressed, links, etc)
340dnl
341dnl SC_CONFIG_MANPAGES
342
343# Output
344AC_CONFIG_FILES([
345        Doxyfile
346        Makefile
347        Mk/macports.autoconf.mk
348        doc/prefix.mtree
349        doc/macosx.mtree
350        doc/macports.conf
351        doc/pubkeys.conf
352        portmgr/freebsd/Makefile
353        src/Makefile
354        src/macports1.0/macports_autoconf.tcl
355        src/port1.0/port_autoconf.tcl
356        src/registry2.0/registry_autoconf.tcl
357        src/programs/Makefile
358        src/macports1.0/macports_fastload.tcl
359        setupenv.bash
360])
361
362AC_CONFIG_FILES([src/pkg_mkindex.sh], [chmod +x src/pkg_mkindex.sh])
363
364AC_OUTPUT
Note: See TracBrowser for help on using the repository browser.