source: trunk/base/configure.ac @ 13457

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

Support for libcurl versions that do not have curl_easy_strerror.

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