File: configure.in

package info (click to toggle)
libpcre%2B%2B 0.9.5-6
  • links: PTS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 2,032 kB
  • ctags: 194
  • sloc: sh: 6,870; cpp: 835; makefile: 41
file content (131 lines) | stat: -rw-r--r-- 2,908 bytes parent folder | download | duplicates (5)
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
# -*-sh-*-
AC_INIT(libpcre++/pcre++.h)
AM_CONFIG_HEADER(libpcre++/config.h)
AM_INIT_AUTOMAKE(libpcre++, `cat VERSION`)

AC_PROG_CXX
AC_PROG_CXXCPP
AC_LANG_CPLUSPLUS
AC_CANONICAL_HOST
AC_PROG_INSTALL
AM_PROG_LIBTOOL

AC_CHECK_HEADERS(string sstream vector stdexcept)

AC_HEADER_STDC

dnl provide flag --enable-debug
AC_ARG_ENABLE(debug,
[  --enable-debug          enable debugging output],
[if test "$enableval" = "yes"; then 
    DEBUG="yes"
    CPPFLAGS="$CPPFLAGS -DDEBUG"
fi]
)


AC_ARG_WITH(pcre_include,
   [  --with-pcre-include=<path> where the PCRE header files are installed],
   [if test "x$with_pcre_include" != "x"; then
       CPPFLAGS="$CPPFLAGS -I$with_pcre_include"
    fi],
)

AC_ARG_WITH(pcre_lib,
   [  --with-pcre-lib=<path> where the PCRE library is installed],
   [if test "x$with_pcre_lib" != "x"; then
       LIBS="$LIBS -L$with_pcre_lib -lpcre"
    fi],
)

case "$host" in
    powerpc-apple-darwin*)
    CC=g++
    ;;
esac

if test "x$with_pcre_include" = "x"; then
   # hm, not defined, so, try these defaults:
   case "$host" in
	*-*-cygwin*)
			# pcre.h in    x:/cygwin/include/
			CPPFLAGS="$CPPFLAGS -I/include"
			;;
	*-*-linux*)
			CPPFLAGS="$CPPFLAGS `pcre-config --cflags` -I/usr/include -I/usr/local/include"
			;;
	*-*-freebsd*)
			CPPFLAGS="$CPPFLAGS `pcre-config --cflags` -I/usr/local/include"
			;;
	*-*-solaris*)
			CPPFLAGS="$CPPFLAGS `pcre-config --cflags` -I$prefix/include -I/usr/local/include"
			;;
	*)
			CPPFLAGS="-I/usr/include -I/usr/local/include"
			;;
   esac
fi


if test "x$with_pcre_lib" = "x"; then
   # hm, not defined, so, try these defaults:
   case "$host" in
	*-*-cygwin*)
			# pcre.dll in  x:/cygwin/lib/
			LIBS="$LIBS -L/lib -lpcre"
			;;
	*-*-linux*)
			LIBS="$LIBS `pcre-config --libs`"
			;;
	*-*-freebsd*)
			LIBS="$LIBS `pcre-config --libs`"
			;;
        *-*-solaris*)
			LIBS="$LIBS -L$prefix/lib -L/usr/local/lib `pcre-config --libs`"
			;;
	*)
			LIBS="$LIBS -lpcre"
			;;
   esac
fi

AC_CHECK_LIB(pcre, pcre_exec)

AC_PREFIX_DEFAULT(/usr/local)

if test "$ac_cv_lib_pcre_pcre_exec" != "yes"; then
    echo
    echo "*** Warning: the PCRE library could not be found!"
    echo "*** You will not be able to compile libpcre++."
    echo "*** Please get a copy from http://www.pcre.org,"
    echo "*** install it and then retry!"
    echo
    exit 1
fi

PCREPP_VERSION=`cat VERSION`
AC_SUBST(PCREPP_VERSION)

AC_OUTPUT(Makefile libpcre++/Makefile examples/Makefile test/Makefile doc/Makefile pcre++-config ,[chmod a+x pcre++-config])

echo
echo " ***"
echo " *** Hosttype is: $host. Using the following compiler flags:"
echo " *** CPPFLAGS: $CPPFLAGS"
echo " ***     LIBS: $LIBS"
echo " ***"
echo " *** You are now ready to build libpcre++:"
echo " *** Enter the following command: make && make install"
echo " *** To read the documentation enter: man 3 Pcre"
echo " ***"
echo " *** Thanks for using GNU software."
echo " ***"