summaryrefslogtreecommitdiffstats
path: root/configure.in
blob: f197fe45abe06fd288d8155405afd840d909af24 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
################################################################################
##
##    Copyright 1999-2000 Sistina Software, Inc.
##
##    This is free software released under the GNU General Public License.
##    There is no warranty for this software.  See the file COPYING for
##    details.
##
##    See the file CONTRIBUTORS for a list of contributors.
##
##    This file is maintained by:
##      AJ Lewis <lewis@sistina.com>
## 
##    File name: configure.in
##
##    Description: Input file for autoconf.  Generates the configure script 
##                 that tries to keep everything nice and portable.  It also
##                 simplifies distribution package building considerably.
################################################################################

dnl Process this file with autoconf to produce a configure script.
AC_INIT(lib/dev-mgr/dev-manager.h)

dnl setup the directory where autoconf has auxilary files
AC_CONFIG_AUX_DIR(autoconf) 

dnl Checks for programs.
AC_PROG_AWK
AC_PROG_CC
AC_PROG_INSTALL
AC_PROG_LN_S
AC_PROG_MAKE_SET
AC_PROG_RANLIB

dnl Checks for header files.
AC_HEADER_DIRENT
AC_HEADER_STDC
AC_CHECK_HEADERS(fcntl.h malloc.h sys/ioctl.h unistd.h)

dnl Checks for typedefs, structures, and compiler characteristics.
AC_C_CONST
AC_C_INLINE
AC_TYPE_OFF_T
AC_TYPE_PID_T
AC_TYPE_SIZE_T
AC_STRUCT_ST_RDEV
AC_HEADER_TIME

dnl -- prefix is /usr by default, the exec_prefix default is setup later
AC_PREFIX_DEFAULT(/usr)

dnl -- setup the ownership of the files
AC_ARG_WITH(user,
  [  --with-user=USER        Set the owner of installed files ],
  [ OWNER="$withval" ],
  [ OWNER="root" ])

dnl -- setup the group ownership of the files
AC_ARG_WITH(group,
  [  --with-group=GROUP      Set the group owner of installed files ],
  [ GROUP="$withval" ],
  [ GROUP="root" ])

dnl -- Where the linux src tree is
AC_ARG_WITH(kernel_dir,
  [  --with-kernel_dir=DIR   linux kernel source in DIR [/usr/src/linux]],
  [ kernel_dir="$withval" ],
  [ kernel_dir=/usr/src/linux ])

AC_ARG_ENABLE(jobs, [  --enable-jobs=NUM       Number of jobs to run simultaneously], JOBS=-j$enableval, JOBS=)

dnl Enables staticly linked tools
AC_ARG_ENABLE(static_link, [  --enable-static_link    Use this to link the tools to the liblvm library
                          statically.  Default is dynamic linking],  STATIC_LINK=$enableval, STATIC_LINK=no)

dnl Disable readline
AC_ARG_ENABLE(readline, [  --disable-readline      Disable readline support],  \
READLINE=$enableval, READLINE=yes)

dnl Mess with default exec_prefix
if [[ "x$exec_prefix" = xNONE -a "x$prefix" = xNONE ]];
 then  exec_prefix="";
fi;

dnl Checks for library functions.
AC_PROG_GCC_TRADITIONAL
AC_TYPE_SIGNAL
AC_FUNC_VPRINTF
AC_CHECK_FUNCS(mkdir rmdir uname)

dnl check for termcap (Shamelessly copied from parted 1.4.17)
if test x$READLINE = xyes; then
	AC_SEARCH_LIBS(tgetent, ncurses curses termcap termlib, ,
		AC_MSG_ERROR(
termcap could not be found which is required for the
--enable-readline option (which is enabled by default).  Either disable readline
support with --disable-readline or download and install termcap from:
	ftp.gnu.org/gnu/termcap
Note: if you are using precompiled packages you will also need the development
  package as well (which may be called termcap-devel or something similar).
Note: (n)curses also seems to work as a substitute for termcap.  This was
  not found either - but you could try installing that as well.
)
	exit
	)
fi

dnl Check for readline (Shamelessly copied from parted 1.4.17)
if test x$READLINE = xyes; then
	AC_CHECK_LIB(readline, readline, ,
		AC_MSG_ERROR(
GNU Readline could not be found which is required for the
--enable-readline option (which is enabled by default).  Either disable readline
support with --disable-readline or download and install readline from:
	ftp.gnu.org/gnu/readline
Note: if you are using precompiled packages you will also need the development
package as well (which may be called readline-devel or something similar).
)
		exit
	)
fi

AC_SUBST(JOBS)
AC_SUBST(STATIC_LINK)
AC_SUBST(READLINE)
AC_SUBST(kernel_dir)
AC_SUBST(OWNER)
AC_SUBST(GROUP)
dnl First and last lines should not contain files to generate in order to 
dnl keep utility scripts running properly
AC_OUTPUT( 								\
Makefile								\
make.tmpl                                                               \
include/Makefile						 	\
lib/Makefile							 	\
man/Makefile							 	\
tools/Makefile							 	\
test/mm/Makefile							\
test/device/Makefile							\
test/format1/Makefile							\
)