source: trunk/base/configure.ac @ 13584

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

Merge launchd support from branch launchd proto

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