Contents of /code/trunk/configure.ac

(1) Move internal flags out of the options field, to make room.
(2) \r and \n must be explicit to trigger the special CRLF handline exception.
(3) (?J) at the start now sets JCHANGED as well as DUPNAMES.

1

dnl Process this file with autoconf to produce a configure script.

2

3

dnl NOTE FOR MAINTAINERS: Do not use major or minor version numbers with

4

dnl leading zeros, because they may be treated as octal constants. The

5

dnl PCRE_PRERELEASE feature is for identifying release candidates. It might

6

dnl be defined as -RC2, for example. For real releases, it should be defined

7

dnl empty.

8

9

m4_define(pcre_major, [7])

10

m4_define(pcre_minor, [4])

11

m4_define(pcre_prerelease, [-RC1])

12

m4_define(pcre_date, [2007-09-10])

13

14

# Libtool shared library interface versions (current:revision:age)

15

m4_define(libpcre_version, [0:1:0])

16

m4_define(libpcreposix_version, [0:0:0])

17

m4_define(libpcrecpp_version, [0:0:0])

18

19

AC_PREREQ(2.57)

20

AC_INIT(PCRE, pcre_major.pcre_minor[]pcre_prerelease, , pcre)

21

AC_CONFIG_SRCDIR([pcre.h.in])

22

AM_INIT_AUTOMAKE([dist-bzip2 dist-zip])

23

AC_CONFIG_HEADERS(config.h)

24

25

# The default CFLAGS and CXXFLAGS in Autoconf are "-g -O2" for gcc and just

26

# "-g" for any other compiler. There doesn't seem to be a standard way of

27

# getting rid of the -g (which I don't think is needed for a production

28

# library). This fudge seems to achieve the necessary. First, we remember the

29

# externally set values of CFLAGS and CXXFLAGS. Then call the AC_PROG_CC and

30

# AC_PROG_CXX macros to find the compilers - if CFLAGS and CXXFLAGS are not

31

# set, they will be set to Autoconf's defaults. Afterwards, if the original

32

# values were not set, remove the -g from the Autoconf defaults.

33

# (PH 02-May-07)

34

35

remember_set_CFLAGS="$CFLAGS"

36

remember_set_CXXFLAGS="$CXXFLAGS"

37

38

AC_PROG_CC

39

AC_PROG_CXX

40

41

if test "x$remember_set_CFLAGS" = "x"

42

then

43

if test "$CFLAGS" = "-g -O2"

44

then

45

CFLAGS="-O2"

46

elif test "$CFLAGS" = "-g"

47

then

48

CFLAGS=""

49

fi

50

fi

51

52

if test "x$remember_set_CXXFLAGS" = "x"

53

then

54

if test "$CXXFLAGS" = "-g -O2"

55

then

56

CXXFLAGS="-O2"

57

elif test "$CXXFLAGS" = "-g"

58

then

59

CXXFLAGS=""

60

fi

61

fi

62

63

64

AC_PROG_INSTALL

65

AC_LIBTOOL_WIN32_DLL

66

AC_PROG_LIBTOOL

67

AC_PROG_LN_S

68

69

PCRE_MAJOR="pcre_major"

70

PCRE_MINOR="pcre_minor"

71

PCRE_PRERELEASE="pcre_prerelease"

72

PCRE_DATE="pcre_date"

73

74

AC_SUBST(PCRE_MAJOR)

75

AC_SUBST(PCRE_MINOR)

76

AC_SUBST(PCRE_PRERELEASE)

77

AC_SUBST(PCRE_DATE)

78

79

# Set a more sensible default value for $(htmldir).

80

if test "x$htmldir" = 'x${docdir}'

81

then

82

htmldir='${docdir}/html'

83

fi

84

85

# Handle --disable-cpp

86

AC_ARG_ENABLE(cpp,

87

AS_HELP_STRING([--disable-cpp],

88

[disable C++ support]),

89

, enable_cpp=yes)

90

91

# Handle --enable-rebuild-chartables

92

AC_ARG_ENABLE(rebuild-chartables,

93

AS_HELP_STRING([--enable-rebuild-chartables],

94

[rebuild character tables in current locale]),

95

, enable_rebuild_chartables=no)

96

97

# Handle --enable-utf8 (disabled by default)

98

AC_ARG_ENABLE(utf8,

99

AS_HELP_STRING([--enable-utf8],

100

[enable UTF-8 support]),

101

, enable_utf8=unset)

102

103

# Handle --enable-unicode-properties

104

AC_ARG_ENABLE(unicode-properties,

105

AS_HELP_STRING([--enable-unicode-properties],

106

[enable Unicode properties support (implies --enable-utf8)]),

107

, enable_unicode_properties=no)

108

109

# Handle --enable-newline=NL

110

dnl AC_ARG_ENABLE(newline,

111

dnl AS_HELP_STRING([--enable-newline=NL],

112

dnl [use NL as newline (lf, cr, crlf, anycrlf, any; default=lf)]),

113

dnl , enable_newline=lf)

114

115

# Separate newline options

116

ac_pcre_newline=lf

117

AC_ARG_ENABLE(newline-is-cr,

118

AS_HELP_STRING([--enable-newline-is-cr],

119

[use CR as newline character]),

120

ac_pcre_newline=cr)

121

AC_ARG_ENABLE(newline-is-lf,

122

AS_HELP_STRING([--enable-newline-is-lf],

123

[use LF as newline character (default)]),

124

ac_pcre_newline=lf)

125

AC_ARG_ENABLE(newline-is-crlf,

126

AS_HELP_STRING([--enable-newline-is-crlf],

127

[use CRLF as newline sequence]),

128

ac_pcre_newline=crlf)

129

AC_ARG_ENABLE(newline-is-anycrlf,

130

AS_HELP_STRING([--enable-newline-is-anycrlf],

131

[use CR, LF, or CRLF as newline sequence]),

132

ac_pcre_newline=anycrlf)

133

AC_ARG_ENABLE(newline-is-any,

134

AS_HELP_STRING([--enable-newline-is-any],

135

[use any valid Unicode newline sequence]),

136

ac_pcre_newline=any)

137

enable_newline="$ac_pcre_newline"

138

139

# Handle --enable-ebcdic

140

AC_ARG_ENABLE(ebcdic,

141

AS_HELP_STRING([--enable-ebcdic],

142

[assume EBCDIC coding rather than ASCII; use this only in (uncommon) EBCDIC environments; it implies --enable-rebuild-chartables]),

143

, enable_ebcdic=no)

144

145

# Handle --disable-stack-for-recursion

146

AC_ARG_ENABLE(stack-for-recursion,

147

AS_HELP_STRING([--disable-stack-for-recursion],

148

[don't use stack recursion when matching]),

149

, enable_stack_for_recursion=yes)

150

151

# Handle --with-posix-malloc-threshold=NBYTES

152

AC_ARG_WITH(posix-malloc-threshold,

153

AS_HELP_STRING([--with-posix-malloc-threshold=NBYTES],

154

[threshold for POSIX malloc usage (default=10)]),

155

, with_posix_malloc_threshold=10)

156

157

# Handle --with-link-size=N

158

AC_ARG_WITH(link-size,

159

AS_HELP_STRING([--with-link-size=N],

160

[internal link size (2, 3, or 4 allowed; default=2)]),

161

, with_link_size=2)

162

163

# Handle --with-match-limit=N

164

AC_ARG_WITH(match-limit,

165

AS_HELP_STRING([--with-match-limit=N],

166

[default limit on internal looping (default=10000000)]),

167

, with_match_limit=10000000)

168

169

# Handle --with-match-limit_recursion=N

170

#

171

# Note: In config.h, the default is to define MATCH_LIMIT_RECURSION

172

# symbolically as MATCH_LIMIT, which in turn is defined to be some numeric

173

# value (e.g. 10000000). MATCH_LIMIT_RECURSION can otherwise be set to some

174

# different numeric value (or even the same numeric value as MATCH_LIMIT,

175

# though no longer defined in terms of the latter).

176

#

177

AC_ARG_WITH(match-limit-recursion,

178

AS_HELP_STRING([--with-match-limit-recursion=N],

179

[default limit on internal recursion (default=MATCH_LIMIT)]),

180

, with_match_limit_recursion=MATCH_LIMIT)

181

182

# Make sure that if enable_unicode_properties was set, that UTF-8 support

183

# is enabled.

184

#

185

if test "x$enable_unicode_properties" = "xyes"

186

then

187

if test "x$enable_utf8" = "xno"

188

then

189

AC_MSG_ERROR([support for Unicode properties requires UTF-8 support])

190

fi

191

enable_utf8=yes

192

fi

193

194

if test "x$enable_utf8" = "xunset"

195

then

196

enable_utf8=no

197

fi

198

199

# Make sure that if enable_ebcdic is set, rebuild_chartables is also enabled.