source: trunk/base/configure.ac @ 23770

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