source: trunk/base/configure.ac @ 24114

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

Check for xar, but don't build it if it doesn't exist.

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