source: trunk/base/configure.ac @ 57343

Last change on this file since 57343 was 55594, checked in by jmr@…, 11 years ago

configure.ac: Xcode 1.x is unsupported along with Panther

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 11.5 KB
Line 
1dnl Process this file with autoconf to produce a configure script.
2dnl $Id: configure.ac 55594 2009-08-14 11:17:38Z 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]])
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(DITTO, [ditto], [])
95AC_PATH_PROG(DSCL, [dscl], [])
96AC_PATH_PROG(FILE, [file], [])
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(NICE, [nice], [])
104AC_PATH_PROG(PATCH, [patch], [])
105AC_PATH_PROG(RMDIR, [rmdir], [])
106AC_PATH_PROG(RSYNC, [rsync], [])
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_PROG(BZIP2, [bzip2], [])
120AC_PATH_PROG(LSBOM, [lsbom], [])
121AC_PATH_PROG(MKBOM, [mkbom], [])
122AC_PATH_PROG(PAX, [pax], [])
123AC_PATH_PROG(XAR, [xar], [])
124AC_PATH_PROG(OPEN, [open], [])
125
126# Define some precious variables allowing user to override PATH for some programs
127AC_ARG_VAR(MTREE, [path to mtree command])
128AC_ARG_VAR(CVS, [path to cvs command])
129AC_ARG_VAR(SVN, [path to svn command])
130AC_ARG_VAR(RSYNC, [path to rsync command])
131AC_ARG_VAR(SED, [path to sed command])
132AC_ARG_VAR(TAR, [path to tar command])
133AC_ARG_VAR(MAKE, [path to make command])
134AC_ARG_VAR(GNUTAR, [path to gnutar command])
135AC_ARG_VAR(BSDMAKE, [path to bsdmake/pmake command])
136AC_ARG_VAR(GNUMAKE, [path to gnumake command])
137AC_ARG_VAR(BZIP2, [path to bzip2 command])
138AC_ARG_VAR(XAR, [path to xar command])
139AC_ARG_VAR(OPEN, [path to open command])
140
141MP_SED_EXTENDED_REGEXP
142MP_TAR_NO_SAME_OWNER
143
144# Quiche eaters options.
145if test x$GCC = xyes; then
146        CFLAGS_QUICHEEATERS='-W -Wall -pedantic'
147fi
148AC_SUBST(CFLAGS_QUICHEEATERS)
149MP_WERROR
150
151MP_COMPILER_ATTRIBUTE_UNUSED
152MP_COMPILER_ATTRIBUTE_LF_PRIVATE
153
154# Foundation checks
155ACX_PTHREAD
156MP_OBJC_RUNTIME
157MP_OBJC_FOUNDATION
158
159MP_PROG_DAEMONDO
160
161AC_SUBST(EXTRA_PROGS)
162
163# set default ports-directory
164PORTS_DIR_DEFAULT=`pwd | sed -e "s/base/ports/"`
165
166# Check for paths
167AC_PREFIX_DEFAULT(/opt/local)
168if test x$prefix = x/usr/local; then
169    AC_MSG_ERROR([Installing MacPorts into /usr/local is not supported])
170fi
171MP_PATH_PORTSDIR([$PORTS_DIR_DEFAULT])
172MP_PATH_MPCONFIGDIR
173
174# Check whether to install without root privileges
175MP_CHECK_NOROOTPRIVILEGES
176
177# Check for install ownership
178MP_CHECK_INSTALLUSER
179MP_CHECK_INSTALLGROUP
180MP_CHECK_RUNUSER
181MP_DIRECTORY_MODE
182MP_SHARED_DIRECTORY
183
184# Check for default directories
185MP_PATH_APPLICATIONS
186MP_PATH_FRAMEWORKS
187
188# Check for universal options
189MP_UNIVERSAL_OPTIONS
190
191# Check for standard header files.
192AC_HEADER_STDC
193AC_HEADER_DIRENT
194AC_HEADER_SYS_WAIT
195AC_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 \
196        readline/readline.h readline/history.h pwd.h sys/paths.h utime.h])
197
198INCLUDES="-I.. -I. $INCLUDES"
199
200# Checks for library functions.
201AC_CHECK_FUNCS([bzero memset fgetln lockf flock setmode strcasecmp strncasecmp strlcpy copyfile clearenv])
202MP_CHECK_READLINK_IS_P1003_1A
203
204# Check for md5 implementation
205MP_LIB_MD5
206
207# Check for readline
208AC_ARG_ENABLE(readline, AS_HELP_STRING([--enable-readline],[Enable addition of readline support, if readline present.]),
209[
210        AC_CHECK_LIB([readline], [readline], [
211                                  READLINE_LIBS=-lreadline
212                                  AC_DEFINE([HAVE_LIBREADLINE], [1], [Define to 1 if you have the `readline' library (-lreadline).])
213                                  ])
214        AC_CHECK_DECLS([rl_username_completion_function,rl_filename_completion_function,rl_completion_matches,username_completion_function,filename_completion_function,completion_matches], [], [],
215        [
216        #include <stdio.h>
217        #if HAVE_READLINE_READLINE_H
218        # include <readline/readline.h>
219        #endif
220        ])
221])
222AC_SUBST(READLINE_LIBS)
223
224# Lowest non-system-reserved uid and gid (Apple claims <500)
225AC_DEFINE([MIN_USABLE_UID], [500], [Lowest non-system-reserved UID.])
226AC_DEFINE([MIN_USABLE_GID], [500], [Lowest non-system-reserved GID.])
227
228# Load tclConfig.sh
229SC_PATH_TCLCONFIG
230SC_LOAD_TCLCONFIG
231
232# Check for Tcl public headers
233dnl XXX  hardwire CYGPATH (CYGPATH must be set for SC_PUBLIC_TCL_HEADERS)
234CYGPATH=echo
235SC_PUBLIC_TCL_HEADERS
236
237# Check for tclsh binary
238MP_PROG_TCLSH
239
240# Check for Tcl package path
241MP_TCL_PACKAGE_DIR
242
243# Check if thread is enabled.
244MP_TCL_THREAD_SUPPORT
245
246## libcurl
247MP_LIBCURL_FLAGS
248
249# Determine if we need to install some bundled packages
250OUR_INCLUDED_PACKAGES=
251
252## Thread package.
253AC_ARG_WITH(
254                included-tclthread,
255                AS_HELP_STRING([--with-included-tclthread],
256                        [install included Thread package.]),
257                [with_included_tclthread=$withval],
258                [with_included_tclthread="unspecified"])
259
260# Check if thread package is already installed.
261if test "x$with_included_tclthread" = "xunspecified" ; then
262        MP_TCL_PACKAGE(
263                [Thread],
264                [AC_MSG_RESULT([yes]); with_included_tclthread=no],
265                [AC_MSG_RESULT([no]); with_included_tclthread=yes])
266fi
267
268# If thread package isn't installed, configure and install thread package.
269if test "$with_included_tclthread" = "yes"; then
270        OUR_INCLUDED_PACKAGES="$OUR_INCLUDED_PACKAGES thread2.6"
271        AC_CONFIG_SUBDIRS([src/thread2.6])
272        # Extract thread package
273        (cd src/; gzip -d < thread2.6.tar.gz | tar xf -)
274        # Patch thread package (so thread2.6 is the vanilla distribution directory)
275        patch -p0 < src/thread2.6.diff
276fi
277
278## sqlite3 package.
279AC_ARG_WITH(
280                included-sqlite3,
281                AS_HELP_STRING([--with-included-sqlite3],
282                        [build using bundled sqlite3 package]),
283                [with_included_sqlite3=$withval],
284                [with_included_sqlite3="unspecified"])
285
286# Check if sqlite3 package is already installed.
287if test "x$with_included_sqlite3" = "xunspecified" ; then
288        AC_CHECK_LIB([sqlite3],[sqlite3_open],
289                [with_included_sqlite3=no],
290                [with_included_sqlite3=yes])
291fi
292
293AC_ARG_WITH(
294                tcl-sqlite3,
295                AS_HELP_STRING([--with-tcl-sqlite3=DIR],
296                        [directory for Tcl sqlite3 (default /usr/lib/sqlite3)]),
297                [mp_sqlite3_dir=$withval],
298                [mp_sqlite3_dir=/usr/lib/sqlite3])
299
300# If sqlite3 package isn't installed, configure and install sqlite3 package.
301if test "$with_included_sqlite3" = "yes"; then
302        OUR_INCLUDED_PACKAGES="$OUR_INCLUDED_PACKAGES sqlite-3.1.3"
303        INCLUDES="$INCLUDES -I../sqlite-3.1.3"
304        AC_CONFIG_SUBDIRS([src/sqlite-3.1.3])
305        # Extract sqlite3 package
306        (cd src/; gzip -d < sqlite-3.1.3.tar.gz | tar xf -)
307        # patch sqlite3 with desired configure options
308        patch -p0 < src/sqlite-3.1.3.diff
309        # the new tclinstaller.tcl needs to have substitution occur
310        mv src/sqlite-3.1.3/tclinstaller.tcl src/sqlite-3.1.3/tclinstaller.tcl.in
311        SQLITE3_LIBS=`pwd`"/src/sqlite-3.1.3/.libs/libsqlite3.a"
312        if test "x$prefix" = "xNONE" ; then
313                SQLITE3_DIR=$ac_default_prefix/share/macports/Tcl/sqlite3
314        else
315                SQLITE3_DIR=$prefix/share/macports/Tcl/sqlite3
316        fi
317else
318        SQLITE3_LIBS="-lsqlite3"
319
320        AC_CACHE_CHECK([for Tcl sqlite3 location], [mp_cv_sqlite3_dir],
321                [mp_cv_sqlite3_dir=
322                test -r "${mp_sqlite3_dir}/pkgIndex.tcl" && mp_cv_sqlite3_dir=$mp_sqlite3_dir
323                ])
324
325        SQLITE3_DIR=$mp_cv_sqlite3_dir
326fi
327
328AC_SUBST(SQLITE3_LIBS)
329AC_SUBST(SQLITE3_DIR)
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(PATHCONF)
351AC_SUBST(STLIB_LD)
352AC_SUBST(SHLIB_LD)
353AC_SUBST(SHLIB_CFLAGS)
354AC_SUBST(SHLIB_LDFLAGS)
355AC_SUBST(SHLIB_SUFFIX)
356AC_SUBST(TCL_DEFS)
357AC_SUBST(TCL_STUB_LIB_SPEC)
358AC_SUBST(TCL_CC)
359AC_SUBST(OUR_INCLUDED_PACKAGES)
360
361# misc variables that need to be expanded for substitution into tcl
362
363oldprefix=$prefix
364if test "x$prefix" = "xNONE" ; then
365   prefix=$ac_default_prefix
366fi
367
368# Check if there's an existing DP/MP install too old to upgrade
369MP_CHECK_OLDLAYOUT
370
371eval "prefix_expanded=$prefix"
372AC_SUBST(prefix_expanded)
373# do this twice, since there is a nested variable of
374# ${prefix} inside of ${sysconfdir}
375eval "MPCONFIGDIR_EXPANDED=$MPCONFIGDIR"
376eval "MPCONFIGDIR_EXPANDED=$MPCONFIGDIR_EXPANDED"
377AC_SUBST(MPCONFIGDIR_EXPANDED)
378eval "localstatedir_expanded=$localstatedir"
379AC_SUBST(localstatedir_expanded)
380
381prefix=$oldprefix
382
383dnl man page settings (compressed, links, etc)
384dnl
385dnl SC_CONFIG_MANPAGES
386
387# Output
388AC_CONFIG_FILES([
389        Doxyfile
390        Makefile
391        Mk/macports.autoconf.mk
392        doc/prefix.mtree
393        doc/macosx.mtree
394        doc/macports.conf
395        portmgr/freebsd/Makefile
396        portmgr/fedora/macports.spec
397        src/Makefile
398        src/macports1.0/macports_autoconf.tcl
399        src/port1.0/port_autoconf.tcl
400        src/registry1.0/registry_autoconf.tcl
401        src/programs/Makefile
402        src/macports1.0/macports_fastload.tcl
403        setupenv.bash
404])
405
406AC_CONFIG_FILES([src/pkg_mkindex.sh], [chmod +x src/pkg_mkindex.sh])
407
408AC_OUTPUT
Note: See TracBrowser for help on using the repository browser.