mariadb/plug.in
marko 06afa81ee1 branches/zip: Pass -prefer-non-pic only on IA-32 (x86) when building
the dynamic InnoDB plugin, ha_innodb.so.  This libtool option cannot
be used on every target platform.  For instance, the AMD64 (x86_64) ABI
mandates position-independent code (PIC) in dynamic shared objects.

Makefile.am: Use $(INNODB_CFLAGS) and $(INNODB_DYNAMIC_CFLAGS) in
target-specific CFLAGS and CXXFLAGS variable definitions.

plug.in: Instead of appending to the MySQL-wide CFLAGS, introduce
the variables INNODB_CFLAGS and INNODB_DYNAMIC_CFLAGS.  Depending on
$target_cpu, append -prefer-non-pic to INNODB_DYNAMIC_CFLAGS.
2008-02-12 22:05:01 +00:00

40 lines
1.3 KiB
Text

MYSQL_STORAGE_ENGINE(innobase, innodb, [InnoDB Storage Engine],
[Transactional Tables using InnoDB], [max,max-no-ndb])
MYSQL_PLUGIN_DIRECTORY(innobase, [storage/innobase])
MYSQL_PLUGIN_STATIC(innobase, [libinnobase.a])
MYSQL_PLUGIN_DYNAMIC(innobase, [ha_innodb.la])
MYSQL_PLUGIN_ACTIONS(innobase, [
AC_CHECK_HEADERS(sched.h)
AC_CHECK_SIZEOF(int, 4)
AC_CHECK_SIZEOF(long, 4)
AC_CHECK_SIZEOF(void*, 4)
AC_CHECK_FUNCS(sched_yield fdatasync localtime_r)
AC_C_BIGENDIAN
case "$target_os" in
lin*)
INNODB_CFLAGS="-DUNIV_LINUX";;
hpux10*)
INNODB_CFLAGS="-DUNIV_MUST_NOT_INLINE -DUNIV_HPUX -DUNIV_HPUX10";;
hp*)
INNODB_CFLAGS="-DUNIV_MUST_NOT_INLINE -DUNIV_HPUX";;
aix*)
INNODB_CFLAGS="-DUNIV_AIX";;
irix*|osf*|sysv5uw7*|openbsd*)
INNODB_CFLAGS="-DUNIV_MUST_NOT_INLINE";;
*solaris*|*SunOS*)
INNODB_CFLAGS="-DUNIV_SOLARIS";;
esac
INNODB_DYNAMIC_CFLAGS="-DMYSQL_DYNAMIC_PLUGIN"
case "$target_cpu" in
x86_64)
# The AMD64 ABI forbids absolute addresses in shared libraries
;;
*86)
# Use absolute addresses on IA-32
INNODB_DYNAMIC_CFLAGS="$INNODB_DYNAMIC_CFLAGS -prefer-non-pic"
;;
esac
AC_SUBST(INNODB_CFLAGS)
AC_SUBST(INNODB_DYNAMIC_CFLAGS)
])