source: trunk/base/configure.ac @ 17114

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

Discover path to rsync at autoconf time (not yet looked at by rsync-using code in dp)
Mark CVS, TAR, GNUTAR, and RSYNC as additional precious variables that can be overridden in configure environment at time of configure to customize the location of these tools.
Note that these tools are not found in the dp prefix, as PATH is sanitized of references to prefix. But you could override the precious variables to acheive that if you really want to shoot yourself.

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