source: trunk/base/configure.ac @ 23687

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

Add xar code into macports base build.

xar will be built and installed only if xar is not present in the base system, as it is rumored to be on Leopard.
This means that xar will be build and installed into /opt/local on Tiger, and that somebody who has already installed the xar port, or who decides to install the xar port on such a system, might run into a conflict. The number of such people is probably very low, according to bbraun.

  • 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], [])
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# Load tclConfig.sh
98SC_PATH_TCLCONFIG
99SC_LOAD_TCLCONFIG
100
101# Check for Tcl public headers
102dnl XXX  hardwire CYGPATH (CYGPATH must be set for SC_PUBLIC_TCL_HEADERS)
103CYGPATH=echo
104SC_PUBLIC_TCL_HEADERS
105
106# Check for tclsh binary
107OD_PROG_TCLSH
108
109# Check for Tcl package path
110OD_TCL_PACKAGE_DIR
111
112# Check if thread is enabled.
113OD_TCL_THREAD_SUPPORT
114
115## libcurl
116OD_LIBCURL_FLAGS
117
118# Do we have curl_easy_strerror?
119AH_TEMPLATE([HAVE_CURL_EASY_STRERROR],
120               [Define to 1 if you have the curl_easy_strerror function.])
121AC_CHECK_LIB([curl], [curl_easy_strerror],
122        [AC_DEFINE([HAVE_CURL_EASY_STRERROR])],[],
123        [$LDFLAGS_LIBCURL])
124
125# Determine if we need to install some bundled packages
126OUR_INCLUDED_PACKAGES=
127
128## Thread package.
129AC_ARG_WITH(
130                included-tclthread,
131                [  --with-included-tclthread install included Thread package.],
132                [with_included_tclthread=$withval],
133                [with_included_tclthread="unspecified"])
134
135# Check if thread package is already installed.
136if test "x$with_included_tclthread" = "xunspecified" ; then
137        OD_TCL_PACKAGE(
138                [Thread],
139                [AC_MSG_RESULT([yes]); with_included_tclthread=no],
140                [AC_MSG_RESULT([no]); with_included_tclthread=yes])
141fi
142
143# If thread package isn't installed, configure and install thread package.
144if test "$with_included_tclthread" = "yes"; then
145        OUR_INCLUDED_PACKAGES="$OUR_INCLUDED_PACKAGES thread2.6"
146        AC_CONFIG_SUBDIRS([src/thread2.6])
147        # Extract thread package
148        (cd src/; gzip -d < thread2.6.tar.gz | tar xf -)
149        # Patch thread package (so thread2.6 is the vanilla distribution directory)
150        patch -p0 < src/thread2.6.diff
151fi
152
153AC_SUBST(OUR_INCLUDED_PACKAGES)
154
155# Allows building of shared libraries
156SC_ENABLE_SHARED
157
158# Pull compiler / linker values from tclConfig.sh
159CFLAGS_DEBUG=${TCL_CFLAGS_DEBUG}
160CFLAGS_OPTIMIZE=${TCL_CFLAGS_OPTIMIZE}
161LDFLAGS_DEBUG=${TCL_LDFLAGS_DEBUG}
162LDFLAGS_OPTIMIZE=${TCL_LDFLAGS_OPTIMIZE}
163SHLIB_LD=${TCL_SHLIB_LD}
164STLIB_LD=${TCL_STLIB_LD}
165SHLIB_CFLAGS=${TCL_SHLIB_CFLAGS}
166SHLIB_SUFFIX=${TCL_SHLIB_SUFFIX}
167
168AC_SUBST(INCLUDES)
169AC_SUBST(CFLAGS_DEBUG)
170AC_SUBST(CFLAGS_OPTIMIZE)
171AC_SUBST(TCL_DEFS)
172AC_SUBST(STLIB_LD)
173AC_SUBST(SHLIB_LD)
174AC_SUBST(SHLIB_CFLAGS)
175AC_SUBST(SHLIB_LDFLAGS)
176AC_SUBST(SHLIB_SUFFIX)
177AC_SUBST(TCL_STUB_LIB_SPEC)
178AC_SUBST(TCL_CC)
179
180#misc variables that need to be expanded for substitution into tcl
181
182oldprefix=$prefix
183if test "x$prefix" = "xNONE" ; then
184   prefix=$ac_default_prefix
185fi
186
187eval "prefix_expanded=$prefix"
188AC_SUBST(prefix_expanded)
189# do this twice, since there is a nested variable of
190# ${prefix} inside of ${sysconfdir}
191eval "PORTCONFIGDIR_EXPANDED=$PORTCONFIGDIR"
192eval "PORTCONFIGDIR_EXPANDED=$PORTCONFIGDIR_EXPANDED"
193AC_SUBST(PORTCONFIGDIR_EXPANDED)
194eval "localstatedir_expanded=$localstatedir"
195AC_SUBST(localstatedir_expanded)
196
197prefix=$oldprefix
198
199dnl man page settings (compressed, links, etc)
200dnl
201dnl SC_CONFIG_MANPAGES
202
203# Output
204
205AC_CONFIG_FILES([
206        Makefile
207        Mk/dports.autoconf.mk
208        doc/prefix.mtree
209        doc/macosx.mtree
210        doc/ports.conf
211        src/Makefile
212        src/darwinports1.0/darwinports_autoconf.tcl
213        src/port1.0/port_autoconf.tcl
214        src/registry1.0/registry_autoconf.tcl
215        src/programs/Makefile
216        src/darwinports1.0/darwinports_fastload.tcl
217])
218
219AC_OUTPUT
Note: See TracBrowser for help on using the repository browser.