source: trunk/base/configure.ac @ 25570

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

Autoconf for svn command, defining SVN as precious so it can be overridden at configure time

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