source: trunk/base/configure.ac @ 24398

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

Bring back autoconf detection of the mtree(8) binary in the same fashion as we do for tar, rsync and others, per jberry's suggestion.
This differs from what he had before for mtree(8), however, as we don't provide our own copy of the sources any longer in case the binary
can't be found.

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