File: configure.ac

package info (click to toggle)
dbh 1.0.24-2
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 1,864 kB
  • ctags: 295
  • sloc: sh: 10,921; ansic: 2,290; makefile: 96
file content (160 lines) | stat: -rw-r--r-- 3,617 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
148
149
150
151
152
153
154
155
156
157
158
159
160
dnl configure.ac
dnl

dnl Version information
m4_define([libdbh_file_compatibility], ["DBH_1.0"])

m4_define([libdbh_version_major], [1])
m4_define([libdbh_version_minor], [0])
m4_define([libdbh_version_micro], [24])
m4_define([libdbh_version], [libdbh_version_major().libdbh_version_minor().libdbh_version_micro()])


AC_INIT([dbh],[libdbh_version()],[dbh-users@lists.sourceforge.net])
AM_INIT_AUTOMAKE([dbh], [libdbh_version()])
AM_CONFIG_HEADER([config.h])
AM_MAINTAINER_MODE
AC_PROG_LIBTOOL

dnl AC_DEFINE([DBH_FILE_VERSION],"DBH_1.0",dbh file compatibility)
DBH_FILE_VERSION=libdbh_file_compatibility()
AC_SUBST([DBH_FILE_VERSION])

DBH_VERSION_MAJOR=libdbh_version_major()
AC_SUBST([DBH_VERSION_MAJOR])

DBH_VERSION_MINOR=libdbh_version_minor()
AC_SUBST([DBH_VERSION_MINOR])

DBH_VERSION_MICRO=libdbh_version_micro()
AC_SUBST([DBH_VERSION_MICRO])

DBH_VERSION=libdbh_version()
AC_SUBST([DBH_VERSION])



dnl Initialize libtool
AC_CANONICAL_HOST
# libtool.m4 is a bit outof sync.
AC_PROG_LIBTOOL


AC_ISC_POSIX
AC_PROG_CC
AM_PROG_CC_STDC
AC_HEADER_STDC
AC_PROG_INSTALL
AC_PROG_MAKE_SET
AC_SUBST(LIBTOOL_DEPS)
AC_SYS_LARGEFILE


# Taken from Jamie Zawinski's configure script for xscreensaver :
#
# By default, autoconf sets INSTALL_SCRIPT to '${INSTALL_PROGRAM}'.
# That's wrong: it should be set to '${INSTALL}', so that one can
# implement the "install-strip" target properly (strip executables,
# but do not try to strip scripts.)
#
INSTALL_SCRIPT='${INSTALL}'

AC_LINK_FILES($nls_cv_header_libgt, $nls_cv_header_intl)

AC_CHECK_HEADERS(limits.h machine/limits.h math.h stdio.h time.h)

AC_HEADER_STAT
AC_HEADER_DIRENT
AC_C_CONST
AC_C_INLINE
AC_HEADER_TIME

AC_TYPE_SIGNAL

#AC_CHECK_FUNCS(wait3 wait4 waitpid)
AC_CHECK_FUNCS(snprintf vsnprintf strcasecmp strncasecmp)
AC_CHECK_FUNCS(memcpy memmove memset)
#AC_CHECK_FUNC(scandir, AC_DEFINE(HAVE_SCANDIR,1,HAVE_SCANDIR),)

compiler_warnings=yes
AC_MSG_CHECKING(if we want compiler warnings)
AC_ARG_ENABLE(
	warnings,
	[  --enable-warnings       [default=yes] enable gcc compiler warnings],
	compiler_warnings="$enableval", compiler_warnings="yes"
	)
AC_MSG_RESULT($compiler_warnings)

case xyes in
x$ac_cv_c_bigendian)
  echo "Checking integer bit order... bigendian"
  CFLAGS="$CFLAGS -DTURN"
  ;;
*)
  echo "Checking integer bit order... littleendian"
  ;;
esac

# At present, only 32 bit system. 

#AC_CHECK_SIZEOF(char)
AC_CHECK_SIZEOF(short)
AC_CHECK_SIZEOF(long)
AC_CHECK_SIZEOF(int)
AC_CHECK_SIZEOF(unsigned char *)
AC_CHECK_SIZEOF(long long)

m4_define([sizeof_file_pointer], [$ac_cv_sizeof_unsigned_char_p])

SIZEOF_FILE_POINTER=sizeof_file_pointer()
AC_SUBST(SIZEOF_FILE_POINTER)

case $ac_cv_sizeof_int in
  2)		
   CFLAGS="$CFLAGS -DI16_32"
  ;;
  4)
   I32_32=1
   AC_SUBST(I32_32)
   AC_DEFINE_UNQUOTED(I32_32,1,file size support)
   CFLAGS="$CFLAGS -DI32_32"
  ;;
  8)
   CFLAGS="$CFLAGS -DI64_32"
  ;;
esac




AC_ARG_ENABLE(dmalloc,
	[  --enable-dmalloc=PFX    [default=no] enable dmalloc library],
        [ DMALLOC_LIB=$enableval/libdmalloc.a
          AC_DEFINE(DMALLOC,"$DMALLOC",dmalloc)],
)
AC_SUBST(DMALLOC_LIB)

AC_MSG_CHECKING(if prototype for gethostname exists)
AC_EGREP_CPP(gethostname,[#include <unistd.h>],
 AC_MSG_RESULT(yes)
  AC_DEFINE(HAVE_GETHOSTNAME_PROTO,1,HAVE_GETHOSTNAME_PROTO),
 AC_MSG_RESULT(no)
)

dnl Check whether to build with debugging support
BM_DEBUG_SUPPORT

dnl Build ldflags for pkg-config file
BM_PKG_LDFLAGS(PKG)

AC_OUTPUT([
Makefile
dbh.spec
src/Makefile
src/dbh-1.0.pc
src/dbh_config.h
])

echo "CFLAGS -> $CFLAGS"
AC_MSG_RESULT(configure step complete: now do a "make" followed by a make "install")