File: configure.ac

package info (click to toggle)
reiserfsprogs 1:3.6.27-3
  • links: PTS
  • area: main
  • in suites: bullseye, buster, sid
  • size: 3,148 kB
  • sloc: ansic: 27,337; sh: 4,143; makefile: 87
file content (147 lines) | stat: -rw-r--r-- 4,015 bytes parent folder | download
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
142
143
144
145
146
147
dnl Process this file with autoconf to produce a configure script.
AC_INIT([reiserfsprogs], [3.6.27], [reiserfs-devel@vger.kernel.org])
AC_CANONICAL_HOST
AC_PREREQ(2.50)

AH_TEMPLATE([HAVE_LIBUUID], [Define for enable libuuid using.])

AM_INIT_AUTOMAKE([1.11.1 dist-xz silent-rules])
AM_SILENT_RULES([yes])
AM_MAINTAINER_MODE

dnl We install in /sbin, the utils are to be available on boot
dnl AC_PREFIX(/)

AM_CONFIG_HEADER(include/config.h)

dnl Checks for programs.
AC_PROG_CC
AC_PROG_AWK 
AC_PROG_INSTALL
AC_PROG_LN_S
AC_PROG_MAKE_SET
AC_PROG_LIBTOOL

dnl Checks for libraries.

# Check for LIBUUID
AC_CHECK_LIB(uuid, uuid_generate, , AC_MSG_WARN(libuuid could not be found))
UUID_LIBS="$LIBS"
AC_SUBST(UUID_LIBS)

AC_CHECK_LIB(com_err, _et_list, , AC_MSG_ERROR(libcom_err could not be found))
COM_ERR_LIBS="$LIBS"
AC_SUBST(COM_ERR_LIBS)

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

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

# Checking for compiler warning options
AC_CACHE_CHECK([whether -Wuninitialized works], [ac_cv_wuninitialized_flag], [
	saved_CPPFLAGS="$CPPFLAGS"
	CPPFLAGS="-O1 -Wuninitialized"
	AC_TRY_COMPILE(, , [ac_cv_wuninitialized_flag=yes], [ac_cv_wuninitialized_flag=no])
	CPPFLAGS="$saved_CPPFLAGS"
])

AC_CACHE_CHECK([whether -Wno-unused-parameter works], [ac_cv_wno_unused_parameter_flag], [
	saved_CPPFLAGS="$CPPFLAGS"
	CPPFLAGS="-Wno-unused-parameter"
	AC_TRY_COMPILE(, , [ac_cv_wno_unused_parameter_flag=yes], [ac_cv_wno_unused_parameter_flag=no])
	CPPFLAGS="$saved_CPPFLAGS"
])

AC_CACHE_CHECK([whether -Wredundant-decls works], [ac_cv_wredundant_decls_flag], [
	saved_CPPFLAGS="$CPPFLAGS"
	CPPFLAGS="-Wredundant-decls"
	AC_TRY_COMPILE(, , [ac_cv_wredundant_decls_flag=yes], [ac_cv_wredundant_decls_flag=no])
	CPPFLAGS="$saved_CPPFLAGS"
])

# Check for large file
AC_SYS_LARGEFILE

if test -z "${ac_cv_sys_file_offset_bits}"; then
	AC_MSG_WARN(Can't detect right _FILE_OFFSET_BITS. Will be forced to 64bit.)
	ac_cv_sys_file_offset_bits=64
fi

AC_CHECK_SIZEOF(off_t, 64, [ 
	#include <stdio.h>
	#include <sys/types.h>
	#include <unistd.h> 
])

AC_CHECK_SIZEOF(blkcnt_t, 64, [ 
	#include <stdio.h>
	#include <sys/types.h>
	#include <unistd.h> 
])

dnl Checks for library functions.
AC_PROG_GCC_TRADITIONAL
AC_FUNC_MEMCMP
AC_FUNC_STRFTIME
AC_FUNC_VPRINTF
AC_CHECK_FUNCS(strerror strstr strtol statfs getmntent hasmntopt memset time \
	       uname strptime ctime_r register_printf_modifier \
	       register_printf_specifier)

if test -z "${ac_cv_func_register_printf_function}" -a -z "${ac_cv_func_register_printf_specifier}"; then
	AC_MSG_ERROR(reiserfsprogs requires a method to add printf modifiers)
fi


dnl Never enable this. It is for debugging only
AC_ARG_ENABLE(io-failure-emulation,
	[AS_HELP_STRING([--enable-io-failure-emulation], [Never use this. It is for debugging only])])
if test "$enable_io_failure_emulation" = "yes" ; then
	AC_MSG_WARN([Careful! IO failure emulation is ON])
	AC_DEFINE(IO_FAILURE_EMULATION, 1, [gets set when configure --enable-io-failure-emulation])
fi

if test "x$ac_cv_wno_unused_parameter_flag" = xyes; then
	CFLAGS="$CFLAGS -Wno-unused-parameter"
else
	CFLAGS="$CFLAGS -Wno-unused"
fi
	
if test "x$ac_cv_wredundant_decls_flag" = xyes; then
	CFLAGS="$CFLAGS -Wredundant-decls"
fi
	
if test "x$ac_cv_wuninitialized_flag" = xyes; then
	CFLAGS="$CFLAGS -Wuninitialized"
fi

CPPFLAGS="-I\$(top_srcdir)/include $CPPFLAGS"

AC_OUTPUT(
    include/Makefile 
    mkreiserfs/Makefile 
    mkreiserfs/mkreiserfs.8
    resize_reiserfs/Makefile 
    resize_reiserfs/resize_reiserfs.8
    fsck/Makefile 
    fsck/reiserfsck.8
    lib/Makefile 
    Makefile 
    reiserfscore/Makefile 
    reiserfscore/reiserfscore.pc
    debugreiserfs/Makefile 
    debugreiserfs/debugreiserfs.8
    tune/Makefile
    tune/reiserfstune.8
    )

AC_MSG_NOTICE([

Type 'make' to compile reiserfsprogs])