source: trunk/base/configure.ac @ 13443

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

Clean up autoconf macros.
Test the presence of libcurl.
Compilation & link flags for libcurl.

  • Property svn:eol-style set to native
File size: 4.4 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# Determine if we need to install some bundled packages
90OUR_INCLUDED_PACKAGES=
91
92## Thread package.
93AC_ARG_WITH(
94                included-tclthread,
95                [  --with-included-tclthread install included Thread package.],
96                [with_included_tclthread=$withval],
97                [with_included_tclthread="unspecified"])
98
99# Check if thread package is already installed.
100if test "x$with_included_tclthread" = "xunspecified" ; then
101        OD_TCL_PACKAGE(
102                [Thread],
103                [AC_MSG_RESULT([yes]); with_included_tclthread=no],
104                [AC_MSG_RESULT([no]); with_included_tclthread=yes])
105fi
106
107# If thread package isn't installed, configure and install thread package.
108if test "$with_included_tclthread" = "yes"; then
109        OUR_INCLUDED_PACKAGES="$OUR_INCLUDED_PACKAGES thread2.6"
110        AC_CONFIG_SUBDIRS([src/thread2.6])
111        # Extract thread package
112        (cd src/; gzip -d < thread2.6.tar.gz | tar xf -)
113        # Patch thread package (so thread2.6 is the vanilla distribution directory)
114        patch -p0 < src/thread2.6.diff
115fi
116
117AC_SUBST(OUR_INCLUDED_PACKAGES)
118
119# Allows building of shared libraries
120SC_ENABLE_SHARED
121
122# Pull compiler / linker values from tclConfig.sh
123CFLAGS_DEBUG=${TCL_CFLAGS_DEBUG}
124CFLAGS_OPTIMIZE=${TCL_CFLAGS_OPTIMIZE}
125LDFLAGS_DEBUG=${TCL_LDFLAGS_DEBUG}
126LDFLAGS_OPTIMIZE=${TCL_LDFLAGS_OPTIMIZE}
127SHLIB_LD=${TCL_SHLIB_LD}
128STLIB_LD=${TCL_STLIB_LD}
129SHLIB_CFLAGS=${TCL_SHLIB_CFLAGS}
130SHLIB_SUFFIX=${TCL_SHLIB_SUFFIX}
131
132AC_SUBST(INCLUDES)
133AC_SUBST(CFLAGS_DEBUG)
134AC_SUBST(CFLAGS_OPTIMIZE)
135AC_SUBST(TCL_DEFS)
136AC_SUBST(STLIB_LD)
137AC_SUBST(SHLIB_LD)
138AC_SUBST(SHLIB_CFLAGS)
139AC_SUBST(SHLIB_LDFLAGS)
140AC_SUBST(SHLIB_SUFFIX)
141AC_SUBST(TCL_STUB_LIB_SPEC)
142AC_SUBST(TCL_CC)
143
144#misc variables that need to be expanded for substitution into tcl
145
146oldprefix=$prefix
147if test "x$prefix" = "xNONE" ; then
148   prefix=$ac_default_prefix
149fi
150
151eval "prefix_expanded=$prefix"
152AC_SUBST(prefix_expanded)
153# do this twice, since there is a nested variable of
154# ${prefix} inside of ${sysconfdir}
155eval "PORTCONFIGDIR_EXPANDED=$PORTCONFIGDIR"
156eval "PORTCONFIGDIR_EXPANDED=$PORTCONFIGDIR_EXPANDED"
157AC_SUBST(PORTCONFIGDIR_EXPANDED)
158eval "localstatedir_expanded=$localstatedir"
159AC_SUBST(localstatedir_expanded)
160
161prefix=$oldprefix
162
163dnl man page settings (compressed, links, etc)
164dnl
165dnl SC_CONFIG_MANPAGES
166
167# Output
168
169AC_CONFIG_FILES([
170        Makefile
171        Mk/dports.autoconf.mk
172        doc/prefix.mtree
173        doc/macosx.mtree
174        doc/ports.conf
175        src/Makefile
176        src/darwinports1.0/darwinports_autoconf.tcl
177        src/port1.0/port_autoconf.tcl
178        src/programs/Makefile
179        src/darwinports1.0/darwinports_fastload.tcl
180])
181
182AC_OUTPUT
Note: See TracBrowser for help on using the repository browser.