source: branches/gsoc11-statistics/base/configure.ac @ 136298

Last change on this file since 136298 was 107206, checked in by snc@…, 7 years ago

gsoc11-statistics/base: rebase /trunk/base

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