source: trunk/base/configure.ac @ 24642

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

Autoconf for the open command, which we use in port gohome, and add OPEN as a precious variable, potentially allowing this command to be overridden during configure.

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