~pbxt-core/pbxt/rc4

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
AC_INIT(src/ha_pbxt.cc)
AC_CONFIG_AUX_DIR(config)
AM_CONFIG_HEADER(config.h)
AM_INIT_AUTOMAKE(pbxt, 1.0.06-beta)

AC_PROG_CC
AC_PROG_CXX
AC_PROG_LIBTOOL
LIBTOOL="$LIBTOOL --preserve-dup-deps"
AC_SUBST(LIBTOOL)dnl

# ----- AC_SUBST(ENG_MYSQL_INC)
AC_SUBST(ENG_MYSQL_INC)
AC_SUBST(mysql_src)

SYSTEM_TYPE="$host_vendor-$host_os"

# ----- Build type
MAX_C_OPTIMIZE="-O3"
MAX_CXX_OPTIMIZE="-O3"

# Build optimized or debug version ?
# First check for gcc and g++
if test "$ac_cv_prog_gcc" = "yes"
then
  DEBUG_CFLAGS="-g"
  DEBUG_OPTIMIZE_CC="-O"
  OPTIMIZE_CFLAGS="$MAX_C_OPTIMIZE"
  PROFILE_CFLAGS="$MAX_C_OPTIMIZE -pg"
  DEBUG_ONLY_CFLAGS="-g"
else
  DEBUG_CFLAGS="-g"
  DEBUG_OPTIMIZE_CC=""
  OPTIMIZE_CFLAGS="-O"
  PROFILE_CFLAGS="-O -pg"
  DEBUG_ONLY_CFLAGS="-g"
fi
if test "$ac_cv_prog_cxx_g" = "yes"
then
  DEBUG_CXXFLAGS="-g"
  DEBUG_OPTIMIZE_CXX="-O"
  OPTIMIZE_CXXFLAGS="$MAX_CXX_OPTIMIZE"
  PROFILE_CXXFLAGS="$MAX_CXX_OPTIMIZE -pg"
  DEBUG_ONLY_CXXFLAGS="-g"
else
  DEBUG_CXXFLAGS="-g"
  DEBUG_OPTIMIZE_CXX=""
  OPTIMIZE_CXXFLAGS="-O"
  PROFILE_CXXFLAGS="-O -pg"
  DEBUG_ONLY_CXXFLAGS="-g"
fi

if expr "$SYSTEM_TYPE" : ".*netware.*" > /dev/null; then
  DEBUG_CFLAGS="-g -DDEBUG -sym internal,codeview4"
  DEBUG_CXXFLAGS="-g -DDEBUG -sym internal,codeview4"
  DEBUG_OPTIMIZE_CC="-DDEBUG"
  DEBUG_OPTIMIZE_CXX="-DDEBUG"
  OPTIMIZE_CFLAGS="-O3 -DNDEBUG"
  OPTIMIZE_CXXFLAGS="-O3 -DNDEBUG"
  DEBUG_ONLY_CFLAGS="-g -DNDEBUG -sym internal,codeview4"
  DEBUG_ONLY_CXXFLAGS="-g -DNDEBUG -sym internal,codeview4"
fi

# ----- AC_ARG_WITH(debug
AC_ARG_WITH(debug,
    [  --with-debug            include debug symbols and code (yes/no/prof), the
                          default depends on --with-debug used to build MySQL],
    [with_debug=$withval],
    [with_debug=$MYSQL_DEBUG_LEVEL])
if test "$with_debug" = "yes" -o "$with_debug" = "only" -o "$with_debug" = "full"
then
  # Debug the plug-in.
  # 'only' and 'full' are include for backward compatibility
  # with old versions of configure
  AC_DEFINE([DBUG_OFF], [1], [Only debug - just compiles with -g])
  CFLAGS="$DEBUG_ONLY_CFLAGS $MYSQL_CFLAGS"
  CXXFLAGS="$DEBUG_ONLY_CXXFLAGS $MYSQL_CXXFLAGS"
elif test "$with_debug" = "prof"
then
 # Profile version. No debug
  AC_DEFINE([DBUG_OFF], [1], [Optimized version -  no debug])
  CFLAGS="$PROFILE_CFLAGS $MYSQL_CFLAGS"
  CXXFLAGS="$PROFILE_CXXFLAGS $MYSQL_CXXFLAGS"
else
  # Optimized version. No debug
  AC_DEFINE([DBUG_OFF], [1], [Optimized version -  no debug])
  CFLAGS="$OPTIMIZE_CFLAGS $MYSQL_CFLAGS"
  CXXFLAGS="$OPTIMIZE_CXXFLAGS $MYSQL_CXXFLAGS"
fi

AC_ARG_WITH(plugindir,
  [[  --with-plugindir[=DIR]  directory to install the engine, the default
                          depends on the MySQL libdir setting]],
  [ENG_PLUGIN_DIR="$withval"],
  [ENG_PLUGIN_DIR=""])
if test "$ENG_PLUGIN_DIR" = "no" -o "$ENG_PLUGIN_DIR" = ""
then
	# For backward compatibility:
	# if libdir ends with plugin, then assume
	# the plugin dir was specified using --libdir
	tmp_libdir=`echo "$libdir" | grep "plugin$"`
	if test "$libdir" = "$tmp_libdir"
	then
	    ENG_PLUGIN_DIR="$libdir"
	else
	    ENG_PLUGIN_DIR="$libdir/mysql/plugin"
    fi
fi
AC_SUBST(ENG_PLUGIN_DIR)

AC_C_CONST
AC_TYPE_SIZE_T
AC_CHECK_HEADERS(limits.h syslimits.h)
AC_OUTPUT(Makefile src/Makefile test/Makefile)