]> err.no Git - pkg-config/blob - configure.in
Print out \r\n on windows, not just \n
[pkg-config] / configure.in
1
2 AC_INIT(pkg-config.1)
3
4 AM_INIT_AUTOMAKE(pkg-config, 0.23)
5 AM_MAINTAINER_MODE
6
7 AM_CONFIG_HEADER(config.h)
8
9 AM_PROG_LIBTOOL
10
11 AC_PROG_CC
12
13 AC_DEFUN([PKG_CONFIG_FIND_PC_PATH],
14 [
15 AC_MSG_CHECKING([for default search path for .pc files])
16 AC_ARG_WITH(pc_path,
17  [  --with-pc-path          Override the default search path for .pc files ],
18  [ pc_path="$withval" ],
19  [
20 # This is slightly wrong, but hopefully causes less confusion than
21 # people being unable to find their .pc files in the standard location.
22 if test "${prefix}" = "NONE"; then
23         pc_path='${libdir}/pkgconfig:${datadir}/pkgconfig:/usr/lib/pkgconfig:/usr/share/pkgconfig'
24 else
25         pc_path='${libdir}/pkgconfig:${datadir}/pkgconfig'
26 fi
27 ])
28  AC_MSG_RESULT([$pc_path])
29  AC_SUBST([pc_path])
30
31 ])
32
33 PKG_CONFIG_FIND_PC_PATH
34
35 #
36 # Code taken from gtk+-2.0's configure.in.
37 #
38 # This causes pkg-config to not list private dependencies (a very
39 # common example is libm) on platforms which support inter-library
40 # dependencies.
41
42 AC_ARG_ENABLE(indirect-deps,
43         [AC_HELP_STRING([--enable-indirect-deps],
44                               [list both direct and indirect dependencies.])
45 AC_HELP_STRING([--disable-indirect-deps],
46                               [only list direct dependencies.])
47     [default=auto]],use_indirect_deps=$enableval,
48     [use_indirect_deps=auto])
49 echo use_indirect_deps=$use_indirect_deps >&AS_MESSAGE_LOG_FD
50 AC_MSG_CHECKING([whether to list both direct and indirect dependencies])
51 case $use_indirect_deps in
52   auto)
53     deplibs_check_method=`(./libtool --config; echo eval echo \$deplibs_check_method) | sh`
54     if test "X$deplibs_check_method" = Xnone; then
55     echo "foo: $deplibs_check_method" >&AS_MESSAGE_LOG_FD
56       use_indirect_deps=yes
57     else
58       use_indirect_deps=no
59     fi
60   ;;
61   yes|no)
62   ;;
63   *) AC_MSG_ERROR([Value given to --enable-indirect-deps must be one of yes, no
64 or auto])
65   ;;
66 esac
67 AC_MSG_RESULT($use_indirect_deps)
68
69 #
70 # Choose default CFLAGS and warnings depending on compiler.
71 #
72
73 WARN_CFLAGS=""
74 if test "${GCC}" = "yes" && test "${ac_env_CFLAGS_set}" != "set"; then
75    WARN_CFLAGS="-g -Wall -O2"
76 fi
77 AC_SUBST(WARN_CFLAGS)
78
79 AC_DEFINE_UNQUOTED(ENABLE_INDIRECT_DEPS, `test $use_indirect_deps = no; echo $?`, [Link library to all dependent libraries, not only directly needed ones])
80 AC_SUBST(use_indirect_deps)
81
82 AC_MSG_CHECKING([for Win32])
83 case "$host" in
84   *-*-mingw*)
85     native_win32=yes
86   ;;
87   *)
88     native_win32=no
89   ;;
90 esac
91 AC_MSG_RESULT([$native_win32])
92
93 case "$libdir" in
94 *lib64) AC_DEFINE(PREFER_LIB64,1,[Define if your native architecture defines libdir to be $prefix/lib64 instead of $prefix/lib.]) ;;
95 *) : ;;
96 esac
97
98 if test x$native_win32 = xyes; then
99   # On Win32, use the normal installed GLib.  Yes, this is a circular
100   # dependency. But then, only experienced hackers that presumably can
101   # work around that will be building pkg-config and GLib on Win32
102   # anyway (especially using the auto*/configure/libtool
103   # mechanism). Others use prebuilt versions.
104   #
105   # These are correct for GLib 2.x
106   GLIB_CFLAGS="-I$includedir/glib-2.0 -I$libdir/glib-2.0/include"
107   GLIB_LIBS="-L$libdir -lglib-2.0 -liconv -lintl"
108   use_installed_glib=yes
109 else
110   use_installed_glib=no
111   AC_ARG_WITH([installed-glib],
112     [  --with-installed-glib   Use installed Glib-2.x], [
113     if test x$withval = xyes; then
114       # Not on Win32, but the user requested to use the installed Glib-2.x,
115       # therefore we may assume that (some older version of) pkg-config can
116       # be found in the users PATH (otherwise we simply ignore the request).
117       AC_CHECK_PROGS([PKG_CONFIG], [pkg-config], [])
118       if test -n $PKG_CONFIG && $PKG_CONFIG --exists glib-2.0; then
119         GLIB_CFLAGS=`$PKG_CONFIG --cflags glib-2.0`
120         GLIB_LIBS=`$PKG_CONFIG --libs glib-2.0`
121         use_installed_glib=yes
122       fi
123     fi
124   ])
125 fi # !use_installed_glib
126
127 AM_CONDITIONAL(USE_INSTALLED_GLIB, test x$use_installed_glib = xyes)
128
129 if test x$use_installed_glib = xyes; then
130   AC_DEFINE(USE_INSTALLED_GLIB, 1, [We are using an installed GLib])
131   AC_SUBST(GLIB_LIBS)
132   AC_SUBST(GLIB_CFLAGS)
133
134 else
135   AC_CONFIG_SUBDIRS(glib-1.2.10)
136 fi # !native_win32
137
138 AC_FUNC_ALLOCA
139
140 AC_CHECK_FUNCS(setresuid setreuid,break)
141 AC_CHECK_HEADERS([dirent.h unistd.h sys/wait.h malloc.h])
142
143 AC_OUTPUT([Makefile
144            check/Makefile
145            check/config.sh])