source: trunk/base/configure.ac @ 24366

Last change on this file since 24366 was 24366, checked in by jmpp@…, 13 years ago

Cruft cleanup: there's no need to keep mtree sources around, since every copy of Mac OS X ships with mtree(8) by default.
We had them around when Mac(Darwin)Ports was targeted at other platforms too, but that's no longer the case.
Therefore I'm removing mtree sources from our repo and references to them from our autoconf macros (default path in Mac OS X
includes /usr/sbin, so there should be no need for autoconf to find the binary).

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 5.8 KB
Line 
1dnl Process this file with autoconf to produce a configure script.
2AC_PREREQ(2.52)
3AC_INIT([MacPorts], [1.5], [macports-dev@lists.macosforge.org], [macports])
4AC_CONFIG_SRCDIR([src/pextlib1.0/Pextlib.c])
5AC_CONFIG_HEADERS([src/config.h])
6AC_CANONICAL_SYSTEM
7
8# Check user PATH for DP paths, and remove as necessary.
9OD_PATH_SCAN
10
11# Checks for programs.
12AC_PROG_CC
13AC_PROG_INSTALL
14AC_PROG_MAKE_SET
15AC_PROG_LN_S
16AC_PATH_PROG(CVS, [cvs], [])
17AC_PATH_PROG(RSYNC, [rsync], [])
18AC_CHECK_PROG(HAVE_LAUNCHD, [launchd], [yes], [])
19AC_PATH_PROG(LAUNCHCTL, [launchctl], [])
20AC_PATH_PROG(XCODEBUILD, [xcodebuild], [])
21AC_PATH_PROG(BZIP2, [bzip2], [])
22AC_PATH_PROG(XAR, [xar], [])
23
24# Define some precious variables allowing user to override PATH for some programs
25AC_ARG_VAR(CVS, [path to cvs command])
26AC_ARG_VAR(RSYNC, [path to rsync command])
27AC_ARG_VAR(TAR, [path to tar command])
28AC_ARG_VAR(GNUTAR, [path to gnutar command])
29AC_ARG_VAR(BZIP2, [path to bzip2 command])
30AC_ARG_VAR(XAR, [path to xar command])
31
32OD_TAR_NO_SAME_OWNER
33
34# Quiche eaters options.
35if test x$GCC = xyes; then
36        CFLAGS_QUICHEEATERS='-W -Wall -pedantic'
37fi
38AC_SUBST(CFLAGS_QUICHEEATERS)
39
40OD_COMPILER_ATTRIBUTE_UNUSED
41
42OD_PROG_DAEMONDO
43#OD_PROG_XAR
44
45AC_SUBST(REPLACEMENT_PROGS)
46AC_SUBST(EXTRA_PROGS)
47
48# set default dports-directory
49DPORTS_DIR_DEFAULT=`pwd | sed -e "s/base/dports/"`
50
51# Check for paths
52AC_PREFIX_DEFAULT(/opt/local)
53OD_PATH_DPORTSDIR([$DPORTS_DIR_DEFAULT])
54OD_PATH_PORTCONFIGDIR
55OD_PATH_SQLITE3
56
57# Check for install ownership
58OD_CHECK_INSTALLUSER
59OD_CHECK_INSTALLGROUP
60OD_DIRECTORY_MODE
61
62# Check for standard header files.
63AC_HEADER_STDC
64AC_HEADER_DIRENT
65AC_HEADER_SYS_WAIT
66AC_HEADER_STAT
67AC_CHECK_HEADERS([limits.h paths.h sys/file.h crt_externs.h fcntl.h sys/fcntl.h sys/cdefs.h err.h libgen.h sys/socket.h \
68        readline/readline.h readline/history.h pwd.h sys/paths.h])
69
70INCLUDES="-I.. -I. $INCLUDES"
71
72# Checks for library functions.
73AC_FUNC_CLOSEDIR_VOID
74AC_FUNC_FORK
75AC_FUNC_STRERROR_R
76AC_CHECK_FUNCS([bzero memset dup2 regcomp strdup strerror strtol fgetln lockf flock setmode strcasecmp strncasecmp strlcpy copyfile])
77DP_CHECK_READLINK_IS_P1003_1A
78
79# Check for md5 implementation
80OD_LIB_MD5
81# Check for X11 and paraphernalia
82OD_CHECK_X11
83
84# Check for readline
85AC_CHECK_LIB([readline], [readline])
86AC_CHECK_DECLS([rl_username_completion_function,rl_filename_completion_function,rl_completion_matches,username_completion_function,filename_completion_function,completion_matches], [], [],
87[
88#include <stdio.h>
89#if HAVE_READLINE_READLINE_H
90# include <readline/readline.h>
91#endif
92])
93
94# Lowest non-system-reserved uid and gid (Apple claims <500)
95AC_DEFINE([MIN_USABLE_UID], [500], [Lowest non-system-reserved UID.])
96AC_DEFINE([MIN_USABLE_GID], [500], [Lowest non-system-reserved GID.])
97
98# Load tclConfig.sh
99SC_PATH_TCLCONFIG
100SC_LOAD_TCLCONFIG
101
102# Check for Tcl public headers
103dnl XXX  hardwire CYGPATH (CYGPATH must be set for SC_PUBLIC_TCL_HEADERS)
104CYGPATH=echo
105SC_PUBLIC_TCL_HEADERS
106
107# Check for tclsh binary
108OD_PROG_TCLSH
109
110# Check for Tcl package path
111OD_TCL_PACKAGE_DIR
112
113# Check if thread is enabled.
114OD_TCL_THREAD_SUPPORT
115
116## libcurl
117OD_LIBCURL_FLAGS
118
119# Do we have curl_easy_strerror?
120AH_TEMPLATE([HAVE_CURL_EASY_STRERROR],
121               [Define to 1 if you have the curl_easy_strerror function.])
122AC_CHECK_LIB([curl], [curl_easy_strerror],
123        [AC_DEFINE([HAVE_CURL_EASY_STRERROR])],[],
124        [$LDFLAGS_LIBCURL])
125
126# Determine if we need to install some bundled packages
127OUR_INCLUDED_PACKAGES=
128
129## Thread package.
130AC_ARG_WITH(
131                included-tclthread,
132                [  --with-included-tclthread install included Thread package.],
133                [with_included_tclthread=$withval],
134                [with_included_tclthread="unspecified"])
135
136# Check if thread package is already installed.
137if test "x$with_included_tclthread" = "xunspecified" ; then
138        OD_TCL_PACKAGE(
139                [Thread],
140                [AC_MSG_RESULT([yes]); with_included_tclthread=no],
141                [AC_MSG_RESULT([no]); with_included_tclthread=yes])
142fi
143
144# If thread package isn't installed, configure and install thread package.
145if test "$with_included_tclthread" = "yes"; then
146        OUR_INCLUDED_PACKAGES="$OUR_INCLUDED_PACKAGES thread2.6"
147        AC_CONFIG_SUBDIRS([src/thread2.6])
148        # Extract thread package
149        (cd src/; gzip -d < thread2.6.tar.gz | tar xf -)
150        # Patch thread package (so thread2.6 is the vanilla distribution directory)
151        patch -p0 < src/thread2.6.diff
152fi
153
154AC_SUBST(OUR_INCLUDED_PACKAGES)
155
156# Allows building of shared libraries
157SC_ENABLE_SHARED
158
159# Pull compiler / linker values from tclConfig.sh
160CFLAGS_DEBUG=${TCL_CFLAGS_DEBUG}
161CFLAGS_OPTIMIZE=${TCL_CFLAGS_OPTIMIZE}
162LDFLAGS_DEBUG=${TCL_LDFLAGS_DEBUG}
163LDFLAGS_OPTIMIZE=${TCL_LDFLAGS_OPTIMIZE}
164SHLIB_LD=${TCL_SHLIB_LD}
165STLIB_LD=${TCL_STLIB_LD}
166SHLIB_CFLAGS=${TCL_SHLIB_CFLAGS}
167SHLIB_SUFFIX=${TCL_SHLIB_SUFFIX}
168
169AC_SUBST(INCLUDES)
170AC_SUBST(CFLAGS_DEBUG)
171AC_SUBST(CFLAGS_OPTIMIZE)
172AC_SUBST(TCL_DEFS)
173AC_SUBST(STLIB_LD)
174AC_SUBST(SHLIB_LD)
175AC_SUBST(SHLIB_CFLAGS)
176AC_SUBST(SHLIB_LDFLAGS)
177AC_SUBST(SHLIB_SUFFIX)
178AC_SUBST(TCL_STUB_LIB_SPEC)
179AC_SUBST(TCL_CC)
180
181#misc variables that need to be expanded for substitution into tcl
182
183oldprefix=$prefix
184if test "x$prefix" = "xNONE" ; then
185   prefix=$ac_default_prefix
186fi
187
188eval "prefix_expanded=$prefix"
189AC_SUBST(prefix_expanded)
190# do this twice, since there is a nested variable of
191# ${prefix} inside of ${sysconfdir}
192eval "PORTCONFIGDIR_EXPANDED=$PORTCONFIGDIR"
193eval "PORTCONFIGDIR_EXPANDED=$PORTCONFIGDIR_EXPANDED"
194AC_SUBST(PORTCONFIGDIR_EXPANDED)
195eval "localstatedir_expanded=$localstatedir"
196AC_SUBST(localstatedir_expanded)
197
198prefix=$oldprefix
199
200dnl man page settings (compressed, links, etc)
201dnl
202dnl SC_CONFIG_MANPAGES
203
204# Output
205
206AC_CONFIG_FILES([
207        Makefile
208        Mk/dports.autoconf.mk
209        doc/prefix.mtree
210        doc/macosx.mtree
211        doc/ports.conf
212        src/Makefile
213        src/darwinports1.0/darwinports_autoconf.tcl
214        src/port1.0/port_autoconf.tcl
215        src/registry1.0/registry_autoconf.tcl
216        src/programs/Makefile
217        src/darwinports1.0/darwinports_fastload.tcl
218])
219
220AC_OUTPUT
Note: See TracBrowser for help on using the repository browser.