source: trunk/base/configure.ac @ 13459

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

Completely get rid of curl in favor in libcurl.

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