source: trunk/base/configure.ac @ 15733

Last change on this file since 15733 was 15732, checked in by jberry, 15 years ago

Merge configuration changes from jberry-preview-13

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