source: trunk/base/configure.ac @ 25770

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

Build MacPorts with sqlite3 support in preparation for GSoC work

  • Include sqlite-3.1.3 for Panther; link against static lib
  • Install Tcl sqlite3 to ${prefix}/share/darwinports/Tcl if it's built, thus, it's always available
  • Rename ambiguous configure option "--with-sqlite3" to "--with-tcl-sqlite3"
  • Build our_included_packages before MacPorts so the static lib is there in later stages
  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 7.6 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
61
62# Check for install ownership
63OD_CHECK_INSTALLUSER
64OD_CHECK_INSTALLGROUP
65OD_DIRECTORY_MODE
66
67# Check for standard header files.
68AC_HEADER_STDC
69AC_HEADER_DIRENT
70AC_HEADER_SYS_WAIT
71AC_HEADER_STAT
72AC_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 \
73        readline/readline.h readline/history.h pwd.h sys/paths.h])
74
75INCLUDES="-I.. -I. $INCLUDES"
76
77# Checks for library functions.
78AC_FUNC_CLOSEDIR_VOID
79AC_FUNC_FORK
80AC_FUNC_STRERROR_R
81AC_CHECK_FUNCS([bzero memset dup2 regcomp strdup strerror strtol fgetln lockf flock setmode strcasecmp strncasecmp strlcpy copyfile])
82DP_CHECK_READLINK_IS_P1003_1A
83
84# Check for md5 implementation
85OD_LIB_MD5
86# Check for X11 and paraphernalia
87OD_CHECK_X11
88
89# Check for readline
90AC_CHECK_LIB([readline], [readline])
91AC_CHECK_DECLS([rl_username_completion_function,rl_filename_completion_function,rl_completion_matches,username_completion_function,filename_completion_function,completion_matches], [], [],
92[
93#include <stdio.h>
94#if HAVE_READLINE_READLINE_H
95# include <readline/readline.h>
96#endif
97])
98
99# Lowest non-system-reserved uid and gid (Apple claims <500)
100AC_DEFINE([MIN_USABLE_UID], [500], [Lowest non-system-reserved UID.])
101AC_DEFINE([MIN_USABLE_GID], [500], [Lowest non-system-reserved GID.])
102
103# Load tclConfig.sh
104SC_PATH_TCLCONFIG
105SC_LOAD_TCLCONFIG
106
107# Check for Tcl public headers
108dnl XXX  hardwire CYGPATH (CYGPATH must be set for SC_PUBLIC_TCL_HEADERS)
109CYGPATH=echo
110SC_PUBLIC_TCL_HEADERS
111
112# Check for tclsh binary
113OD_PROG_TCLSH
114
115# Check for Tcl package path
116OD_TCL_PACKAGE_DIR
117
118# Check if thread is enabled.
119OD_TCL_THREAD_SUPPORT
120
121## libcurl
122OD_LIBCURL_FLAGS
123
124# Do we have curl_easy_strerror?
125AH_TEMPLATE([HAVE_CURL_EASY_STRERROR],
126               [Define to 1 if you have the curl_easy_strerror function.])
127AC_CHECK_LIB([curl], [curl_easy_strerror],
128        [AC_DEFINE([HAVE_CURL_EASY_STRERROR])],[],
129        [$LDFLAGS_LIBCURL])
130
131# Determine if we need to install some bundled packages
132OUR_INCLUDED_PACKAGES=
133
134## Thread package.
135AC_ARG_WITH(
136                included-tclthread,
137                AS_HELP_STRING([--with-included-tclthread],
138                        [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
160## sqlite3 package.
161AC_ARG_WITH(
162                included-sqlite3,
163                AS_HELP_STRING([--with-included-sqlite3],
164                        [build using bundled sqlite3 package]),
165                [with_included_sqlite3=$withval],
166                [with_included_sqlite3="unspecified"])
167
168# Check if sqlite3 package is already installed.
169if test "x$with_included_sqlite3" = "xunspecified" ; then
170        AC_CHECK_LIB([sqlite3],[sqlite3_open],
171                [with_included_sqlite3=no],
172                [with_included_sqlite3=yes])
173fi
174
175AC_ARG_WITH(
176                tcl-sqlite3,
177                AS_HELP_STRING([--with-tcl-sqlite3=DIR],
178                        [directory for Tcl sqlite3 (default /usr/lib/sqlite3)]),
179                [od_sqlite3_dir=$withval],
180                [od_sqlite3_dir=/usr/lib/sqlite3])
181
182# If sqlite3 package isn't installed, configure and install sqlite3 package.
183if test "$with_included_sqlite3" = "yes"; then
184        OUR_INCLUDED_PACKAGES="$OUR_INCLUDED_PACKAGES sqlite-3.1.3"
185        AC_CONFIG_SUBDIRS([src/sqlite-3.1.3])
186        # Extract sqlite3 package
187        (cd src/; gzip -d < sqlite-3.1.3.tar.gz | tar xf -)
188        # patch sqlite3 with desired configure options
189        patch -p0 < src/sqlite-3.1.3.diff
190        # the new tclinstaller.tcl needs to have substitution occur
191        mv src/sqlite-3.1.3/tclinstaller.tcl src/sqlite-3.1.3/tclinstaller.tcl.in
192        SQLITE3_LIBS=`pwd`"/src/sqlite-3.1.3/.libs/libsqlite3.a"
193        if test "x$prefix" = "xNONE" ; then
194                SQLITE3_DIR=$ac_default_prefix/share/darwinports/Tcl/sqlite3
195        else
196                SQLITE3_DIR=$prefix/share/darwinports/Tcl/sqlite3
197        fi
198else
199        SQLITE3_LIBS="-lsqlite3"
200
201        AC_CACHE_CHECK([for Tcl sqlite3 location], [od_cv_sqlite3_dir],
202                [od_cv_sqlite3_dir=
203                test -r "${od_sqlite3_dir}/pkgIndex.tcl" && od_cv_sqlite3_dir=$od_sqlite3_dir
204                ])
205
206        SQLITE3_DIR=$od_cv_sqlite3_dir
207fi
208
209AC_SUBST(SQLITE3_LIBS)
210AC_SUBST(SQLITE3_DIR)
211
212AC_SUBST(OUR_INCLUDED_PACKAGES)
213
214# Allows building of shared libraries
215SC_ENABLE_SHARED
216
217# Pull compiler / linker values from tclConfig.sh
218CFLAGS_DEBUG=${TCL_CFLAGS_DEBUG}
219CFLAGS_OPTIMIZE=${TCL_CFLAGS_OPTIMIZE}
220LDFLAGS_DEBUG=${TCL_LDFLAGS_DEBUG}
221LDFLAGS_OPTIMIZE=${TCL_LDFLAGS_OPTIMIZE}
222SHLIB_LD=${TCL_SHLIB_LD}
223STLIB_LD=${TCL_STLIB_LD}
224SHLIB_CFLAGS=${TCL_SHLIB_CFLAGS}
225SHLIB_SUFFIX=${TCL_SHLIB_SUFFIX}
226
227AC_SUBST(INCLUDES)
228AC_SUBST(CFLAGS_DEBUG)
229AC_SUBST(CFLAGS_OPTIMIZE)
230AC_SUBST(TCL_DEFS)
231AC_SUBST(STLIB_LD)
232AC_SUBST(SHLIB_LD)
233AC_SUBST(SHLIB_CFLAGS)
234AC_SUBST(SHLIB_LDFLAGS)
235AC_SUBST(SHLIB_SUFFIX)
236AC_SUBST(TCL_STUB_LIB_SPEC)
237AC_SUBST(TCL_CC)
238
239#misc variables that need to be expanded for substitution into tcl
240
241oldprefix=$prefix
242if test "x$prefix" = "xNONE" ; then
243   prefix=$ac_default_prefix
244fi
245
246eval "prefix_expanded=$prefix"
247AC_SUBST(prefix_expanded)
248# do this twice, since there is a nested variable of
249# ${prefix} inside of ${sysconfdir}
250eval "PORTCONFIGDIR_EXPANDED=$PORTCONFIGDIR"
251eval "PORTCONFIGDIR_EXPANDED=$PORTCONFIGDIR_EXPANDED"
252AC_SUBST(PORTCONFIGDIR_EXPANDED)
253eval "localstatedir_expanded=$localstatedir"
254AC_SUBST(localstatedir_expanded)
255
256prefix=$oldprefix
257
258dnl man page settings (compressed, links, etc)
259dnl
260dnl SC_CONFIG_MANPAGES
261
262# Output
263
264AC_CONFIG_FILES([
265        Makefile
266        Mk/dports.autoconf.mk
267        doc/prefix.mtree
268        doc/macosx.mtree
269        doc/ports.conf
270        src/Makefile
271        src/darwinports1.0/darwinports_autoconf.tcl
272        src/port1.0/port_autoconf.tcl
273        src/registry1.0/registry_autoconf.tcl
274        src/programs/Makefile
275        src/darwinports1.0/darwinports_fastload.tcl
276])
277
278AC_OUTPUT
Note: See TracBrowser for help on using the repository browser.