source: trunk/base/configure.ac @ 22768

Last change on this file since 22768 was 22768, checked in by eridius@…, 14 years ago

receipt_flat.tcl no longer uses an absolute path for bzip2
Boy, autoconf is ugly

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