source: branches/gsoc13-tests/configure.ac @ 111299

Last change on this file since 111299 was 111299, checked in by marius@…, 7 years ago

package1.0: use correct macports_fastload.tcl file; added package_test_autoconf file

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