source: trunk/base/configure.ac @ 17271

Last change on this file since 17271 was 17269, checked in by jberry, 14 years ago

Add support for configuration of sqlite3 tcl library through autoconf
and loading of the library at runtime, based on this setting.

Defaults to location on 10.4, which is /usr/lib/sqlite3. Location may be
specified explicitly for 10.3 systems.

Note: there is no requirement yet for sqlite3 as a dependency for darwinports,
though there may be in the future.

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