source: trunk/base/configure.ac @ 18769

Last change on this file since 18769 was 18769, checked in by pguyot (Paul Guyot), 14 years ago

Fix darwintrace.c on 10.3 (tentative, no 10.3 box here) by determining with
autoconf if readlink conforms to POSIX 1003.1a as in 10.4+ or not (as in 10.3).

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