Pullup ticket #3517 - requested by jnemeth
[pkgsrcv2.git] / databases / mysql5-client / Makefile.common
1 # $NetBSD: Makefile.common,v 1.40 2010/11/15 16:24:09 sketch Exp $
2 #
3 # used by databases/mysql5-client/Makefile
4 # used by databases/mysql5-server/Makefile
5 #
6
7 DISTNAME=               mysql-5.0.92
8 CATEGORIES=             databases
9 MASTER_SITES=           http://downloads.mysql.com/archives/mysql-5.0/ \
10                         ${MASTER_SITE_MYSQL:=MySQL-5.0/}
11
12 MAINTAINER=             pkgsrc-users@NetBSD.org
13 HOMEPAGE=               http://www.mysql.com/
14 LICENSE=                gnu-gpl-v2
15
16 USE_LIBTOOL=            yes
17 GNU_CONFIGURE=          yes
18
19 .include "../../mk/bsd.prefs.mk"
20 .include "options.mk"
21
22 EXTRACT_USING=          bsdtar
23
24 # MYSQL_USER            username of the database administrator
25 # MYSQL_GROUP           group of the database administrator
26 # MYSQL_DATADIR         home directory of the database administrator and
27 #                       location of the databases
28 MYSQL_USER?=            mysql
29 MYSQL_GROUP?=           mysql
30 MYSQL_DATADIR?=         ${VARBASE}/mysql
31
32 PKG_USERS_VARS+=        MYSQL_USER
33 PKG_GROUPS_VARS+=       MYSQL_GROUP
34
35 # MYSQL_CHARSET         default character set
36 # MYSQL_EXTRA_CHARSET   additional character set to be compiled in.
37 #
38 MYSQL_CHARSET?=         latin1
39 MYSQL_EXTRA_CHARSET?=   all
40
41 CONFIGURE_ARGS+=        --localstatedir=${MYSQL_DATADIR:Q}
42 CONFIGURE_ARGS+=        --with-named-z-libs=z
43 CONFIGURE_ARGS+=        --without-libwrap
44 CONFIG_SHELL=           ${TOOLS_PATH.bash}
45
46 .if ${OPSYS} == "IRIX"
47 CFLAGS+=                -DIRIX5 -DNEEDS_BSTRING_H
48 # libgen is incorrectly detected
49 CONFIGURE_ENV+=         ac_cv_lib_gen_p2open="no"
50 .endif
51
52 BUILD_DEFS+=            VARBASE
53
54 # We always use our own readline.  Note that these --without-* settings
55 # are confusing, but they just mean "don't use the included readline
56 # or libedit".
57 #
58 CONFIGURE_ARGS+=        --without-readline
59 CONFIGURE_ARGS+=        --without-libedit
60
61 # Speed up production one-time builds; see "./configure --help" for
62 # more information on using or disabling this option.
63 CONFIGURE_ARGS+=        --disable-dependency-tracking
64
65 CONFIGURE_ARGS+=        --without-debug
66 CONFIGURE_ARGS+=        --without-bench
67 CONFIGURE_ARGS+=        --with-low-memory
68 CONFIGURE_ARGS+=        --with-zlib-dir=${BUILDLINK_PREFIX.zlib:Q}
69 CONFIGURE_ARGS+=        --with-vio
70
71 CONFIGURE_ARGS+=        --with-charset=${MYSQL_CHARSET:Q}
72 CONFIGURE_ARGS+=        --with-extra-charsets=${MYSQL_EXTRA_CHARSET:Q}
73
74 .if !empty(MACHINE_ARCH:Mi386) && ${OPSYS} != "Interix" && \
75         ${OPSYS} != "SunOS" && ${OPSYS} != "Darwin"
76 CONFIGURE_ARGS+=        --enable-assembler
77 .endif
78
79 CONFIGURE_ENV+=         mysql_cv_compress="yes"
80
81 CPPFLAGS+=              -Dunix
82 CFLAGS+=                -DUSE_OLD_FUNCTIONS # 3.23.x compat
83
84 # force HAVE_CURSES_H on Solaris since the configure script is broken
85 # and does not properly detect this, breaking the build later on.
86 .if ${OPSYS} == "SunOS"
87 CFLAGS+=                -DHAVE_CURSES_H
88 CXXFLAGS+=              -DHAVE_CURSES_H
89 .endif
90
91 .include "../../mk/pthread.buildlink3.mk"
92
93 .if defined(PTHREAD_TYPE) && (${PTHREAD_TYPE} == "pth")
94 CFLAGS+=                -DSIGNALS_DONT_BREAK_READ
95 CXXFLAGS+=              -DSIGNALS_DONT_BREAK_READ
96 CONFIGURE_ENV+=         ac_cv_func_pthread_setschedparam=no
97 CONFIGURE_ENV+=         ac_cv_func_pthread_attr_setschedparam=no
98 .endif
99
100 USE_LANGUAGES=          c c++
101 USE_TOOLS+=             autoconf bash autoheader gmake perl:run
102 LDFLAGS+=               ${COMPILER_RPATH_FLAG}${PREFIX}/lib/mysql
103
104 SUBST_CLASSES=          mk
105 SUBST_STAGE.mk=         pre-configure
106 SUBST_FILES.mk=         dbug/Makefile.in heap/Makefile.in       \
107                         mysys/Makefile.in strings/Makefile.in
108 SUBST_SED.mk=           -e "/^install-exec:/s/install-pkglibLIBRARIES//"
109 SUBST_MESSAGE.mk=       Fixing Makefiles.
110
111 SUBST_CLASSES+=         scr
112 SUBST_STAGE.scr=        pre-configure
113 SUBST_FILES.scr=        scripts/mysql_install_db.sh scripts/mysqld_safe.sh \
114                         scripts/mysql_secure_installation.sh \
115                         support-files/mysql.server.sh
116 SUBST_SED.scr=          -e "s,chown,${CHOWN},g"
117 SUBST_SED.scr+=         -e "s,/bin/sh,${RCD_SCRIPTS_SHELL},g"
118 SUBST_MESSAGE.scr=      Fixing scripts.
119
120 # Fix broken shared library detection under Mac OS X
121 .if ${OPSYS} == "Darwin"
122 SUBST_CLASSES+=         dylib
123 SUBST_STAGE.dylib=      pre-configure
124 SUBST_FILES.dylib=      configure
125 SUBST_SED.dylib=        -e "s|\\\$$shrext_cmds|\\.dylib|g"
126 .endif
127
128 pre-configure:
129         cd ${WRKSRC} && autoconf && autoheader
130
131 .include "../../devel/zlib/buildlink3.mk"