Commit ae5b950c authored by unknown's avatar unknown

got --with-other-libc to work, finally


configure.in:
  updates for --with-other-libc
heap/Makefile.am:
  --with-other-libc
libmysql/Makefile.shared:
  --with-other-libc
mysys/Makefile.am:
  --with-other-libc
regex/Makefile.am:
  --with-other-libc
sql/Makefile.am:
  --with-other-libc
strings/Makefile.am:
  --with-other-libc
parent 3a3e8e99
...@@ -4,7 +4,7 @@ dnl Process this file with autoconf to produce a configure script. ...@@ -4,7 +4,7 @@ dnl Process this file with autoconf to produce a configure script.
AC_INIT(sql/mysqld.cc) AC_INIT(sql/mysqld.cc)
AC_CANONICAL_SYSTEM AC_CANONICAL_SYSTEM
# The Docs Makefile.am parses this line! # The Docs Makefile.am parses this line!
AM_INIT_AUTOMAKE(mysql, 3.23.36) AM_INIT_AUTOMAKE(mysql, 3.23.37)
AM_CONFIG_HEADER(config.h) AM_CONFIG_HEADER(config.h)
PROTOCOL_VERSION=10 PROTOCOL_VERSION=10
...@@ -390,6 +390,38 @@ then ...@@ -390,6 +390,38 @@ then
AC_MSG_ERROR([MySQL requiers a ANSI C compiler (and a C++ compiler). Try gcc. See the Installation chapter in the Reference Manual.]) AC_MSG_ERROR([MySQL requiers a ANSI C compiler (and a C++ compiler). Try gcc. See the Installation chapter in the Reference Manual.])
fi fi
NOINST_LDFLAGS=
AC_ARG_WITH(other-libc,
[ --with-other-libc=/path/to/other/libc/dir Link against libc and other standard libraries installed in the specified non-standard location overriding default. Originally added to be able to link against glibc 2.2 without making the user upgrade the standard libc installation ],
[
other_libc_include="$withval/include"
other_libc_lib="$withval/lib"
with_other_libc="yes"
enable_shared="no"
all_is_static="yes"
CFLAGS="$CFLAGS -I$other_libc_include"
CXXFLAGS="$CXXFLAGS -fpermissive -I$other_libc_include"
#There seems to be a feature in gcc that treats system and libc headers
#leniently when they violatate ANSI C++ standard, but it is strict otherwise
#since gcc cannot now recognize that our headers are libc, we work around
#by telling it to be permissive
LDFLAGS="$LDFLAGS -static -L$other_libc_lib "
with_mysqld_ldflags="-all-static"
with_client_ldflags="-all-static"
NOINST_LDFLAGS="-all-static"
#when linking against custom libc installed separately, we want to force all
#binary builds to be static, including the build done by configure itself
#to test for system features
],
[
other_libc_include=
other_libc_lib=
with_other_libc="no"
]
)
AC_SUBST(NOINST_LDFLAGS)
AC_ARG_WITH(server-suffix, AC_ARG_WITH(server-suffix,
[ --with-server-suffix Append value to the version string.], [ --with-server-suffix Append value to the version string.],
# I heard that 'cut' isn't portable. Isn't there a better way? # I heard that 'cut' isn't portable. Isn't there a better way?
...@@ -1162,7 +1194,7 @@ fi ...@@ -1162,7 +1194,7 @@ fi
AC_SUBST(COMPILATION_COMMENT) AC_SUBST(COMPILATION_COMMENT)
AC_MSG_CHECKING("need of special linking flags") AC_MSG_CHECKING("need of special linking flags")
if test "$IS_LINUX" = "true" if test "$IS_LINUX" = "true" -a "$all_is_static" != "yes"
then then
LDFLAGS="$LDFLAGS -rdynamic" LDFLAGS="$LDFLAGS -rdynamic"
AC_MSG_RESULT("-rdynamic") AC_MSG_RESULT("-rdynamic")
...@@ -1317,7 +1349,10 @@ ac_save_CXXFLAGS="$CXXFLAGS" ...@@ -1317,7 +1349,10 @@ ac_save_CXXFLAGS="$CXXFLAGS"
AC_CACHE_CHECK([style of gethost* routines], mysql_cv_gethost_style, AC_CACHE_CHECK([style of gethost* routines], mysql_cv_gethost_style,
AC_LANG_SAVE AC_LANG_SAVE
AC_LANG_CPLUSPLUS AC_LANG_CPLUSPLUS
if test "$ac_cv_prog_gxx" = "yes" #do not treat warnings as errors if we are linking agaist other libc
#this is to work around gcc not being permissive on non-system includes
#with respect to ANSI C++
if test "$ac_cv_prog_gxx" = "yes" -a "$with_other_libc" = "no"
then then
CXXFLAGS="$CXXFLAGS -Werror" CXXFLAGS="$CXXFLAGS -Werror"
fi fi
...@@ -1349,7 +1384,7 @@ ac_save_CXXFLAGS="$CXXFLAGS" ...@@ -1349,7 +1384,7 @@ ac_save_CXXFLAGS="$CXXFLAGS"
AC_CACHE_CHECK([style of gethostname_r routines], mysql_cv_gethostname_style, AC_CACHE_CHECK([style of gethostname_r routines], mysql_cv_gethostname_style,
AC_LANG_SAVE AC_LANG_SAVE
AC_LANG_CPLUSPLUS AC_LANG_CPLUSPLUS
if test "$ac_cv_prog_gxx" = "yes" if test "$ac_cv_prog_gxx" = "yes" -a "$with_other_libc" = "no"
then then
CXXFLAGS="$CXXFLAGS -Werror" CXXFLAGS="$CXXFLAGS -Werror"
fi fi
...@@ -1380,7 +1415,7 @@ ac_save_CXXFLAGS="$CXXFLAGS" ...@@ -1380,7 +1415,7 @@ ac_save_CXXFLAGS="$CXXFLAGS"
AC_CACHE_CHECK([3 argument to gethostname_r routines], mysql_cv_gethostname_arg, AC_CACHE_CHECK([3 argument to gethostname_r routines], mysql_cv_gethostname_arg,
AC_LANG_SAVE AC_LANG_SAVE
AC_LANG_CPLUSPLUS AC_LANG_CPLUSPLUS
if test "$ac_cv_prog_gxx" = "yes" if test "$ac_cv_prog_gxx" = "yes" -a "$with_other_libc" = "no"
then then
CXXFLAGS="$CXXFLAGS -Werror" CXXFLAGS="$CXXFLAGS -Werror"
fi fi
......
...@@ -19,6 +19,8 @@ LDADD = libheap.a ../mysys/libmysys.a ../dbug/libdbug.a \ ...@@ -19,6 +19,8 @@ LDADD = libheap.a ../mysys/libmysys.a ../dbug/libdbug.a \
../strings/libmystrings.a ../strings/libmystrings.a
pkglib_LIBRARIES = libheap.a pkglib_LIBRARIES = libheap.a
noinst_PROGRAMS = hp_test1 hp_test2 noinst_PROGRAMS = hp_test1 hp_test2
hp_test1_LDFLAGS = @NOINST_LDFLAGS@
hp_test2_LDFLAGS = @NOINST_LDFLAGS@
noinst_HEADERS = heapdef.h noinst_HEADERS = heapdef.h
libheap_a_SOURCES = hp_open.c hp_extra.c hp_close.c hp_panic.c hp_info.c \ libheap_a_SOURCES = hp_open.c hp_extra.c hp_close.c hp_panic.c hp_info.c \
hp_rrnd.c hp_scan.c hp_update.c hp_write.c hp_delete.c \ hp_rrnd.c hp_scan.c hp_update.c hp_write.c hp_delete.c \
......
...@@ -83,6 +83,9 @@ ctype_extra_sources.c: conf_to_src ...@@ -83,6 +83,9 @@ ctype_extra_sources.c: conf_to_src
$(srcdir)/ctype_extra_sources.c $(srcdir)/ctype_extra_sources.c
conf_to_src_SOURCES = conf_to_src.c conf_to_src_SOURCES = conf_to_src.c
conf_to_src_LDADD= conf_to_src_LDADD=
#for --with-other-libc to ensure static linking
#note -all-static rather than -static
#this is needed for libtool to work right
conf_to_src_LDFLAGS=-all-static
# Don't update the files from bitkeeper # Don't update the files from bitkeeper
%::SCCS/s.% %::SCCS/s.%
...@@ -73,7 +73,7 @@ OMIT_DEPENDENCIES = pthread.h stdio.h __stdio.h stdlib.h __stdlib.h math.h\ ...@@ -73,7 +73,7 @@ OMIT_DEPENDENCIES = pthread.h stdio.h __stdio.h stdlib.h __stdlib.h math.h\
cdefs.h machdep.h signal.h __signal.h util.h cdefs.h machdep.h signal.h __signal.h util.h
# I hope this always does the right thing. Otherwise this is only test programs # I hope this always does the right thing. Otherwise this is only test programs
FLAGS=$(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS) FLAGS=$(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS) @NOINST_LDFLAGS@
# #
# The CP .. RM stuff is to avoid problems with some compilers (like alpha ccc) # The CP .. RM stuff is to avoid problems with some compilers (like alpha ccc)
...@@ -81,17 +81,17 @@ FLAGS=$(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS) ...@@ -81,17 +81,17 @@ FLAGS=$(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS)
# #
test_thr_alarm: thr_alarm.c $(LIBRARIES) test_thr_alarm: thr_alarm.c $(LIBRARIES)
$(CP) $(srcdir)/thr_alarm.c ./test_thr_alarm.c $(CP) -f $(srcdir)/thr_alarm.c ./test_thr_alarm.c
$(LINK) $(FLAGS) -DMAIN ./test_thr_alarm.c $(LDADD) $(LIBS) $(LINK) $(FLAGS) -DMAIN ./test_thr_alarm.c $(LDADD) $(LIBS)
$(RM) -f ./test_thr_alarm.* $(RM) -f ./test_thr_alarm.*
test_thr_lock: thr_lock.c $(LIBRARIES) test_thr_lock: thr_lock.c $(LIBRARIES)
$(CP) $(srcdir)/thr_lock.c test_thr_lock.c $(CP) -f $(srcdir)/thr_lock.c test_thr_lock.c
$(LINK) $(FLAGS) -DMAIN ./test_thr_lock.c $(LDADD) $(LIBS) $(LINK) $(FLAGS) -DMAIN ./test_thr_lock.c $(LDADD) $(LIBS)
$(RM) -f ./test_thr_lock.* $(RM) -f ./test_thr_lock.*
test_vsnprintf: my_vsnprintf.c $(LIBRARIES) test_vsnprintf: my_vsnprintf.c $(LIBRARIES)
$(CP) $(srcdir)/my_vsnprintf.c test_vsnprintf.c $(CP) -f $(srcdir)/my_vsnprintf.c test_vsnprintf.c
$(LINK) $(FLAGS) -DMAIN ./test_vsnprintf.c $(LDADD) $(LIBS) $(LINK) $(FLAGS) -DMAIN ./test_vsnprintf.c $(LDADD) $(LIBS)
$(RM) -f test_vsnprintf.* $(RM) -f test_vsnprintf.*
...@@ -101,7 +101,7 @@ test_dir: test_dir.c $(LIBRARIES) ...@@ -101,7 +101,7 @@ test_dir: test_dir.c $(LIBRARIES)
test_charset: test_charset.c $(LIBRARIES) test_charset: test_charset.c $(LIBRARIES)
$(LINK) $(FLAGS) -DMAIN $(srcdir)/test_charset.c $(LDADD) $(LIBS) $(LINK) $(FLAGS) -DMAIN $(srcdir)/test_charset.c $(LDADD) $(LIBS)
test_hash: test_hash.c $(LIBRARIES) testhash: testhash.c $(LIBRARIES)
$(LINK) $(FLAGS) -DMAIN $(srcdir)/test_dir.c $(LDADD) $(LIBS) $(LINK) $(FLAGS) -DMAIN $(srcdir)/test_dir.c $(LDADD) $(LIBS)
# Don't update the files from bitkeeper # Don't update the files from bitkeeper
......
...@@ -23,6 +23,7 @@ libregex_a_SOURCES = regerror.c regcomp.c regexec.c regfree.c reginit.c ...@@ -23,6 +23,7 @@ libregex_a_SOURCES = regerror.c regcomp.c regexec.c regfree.c reginit.c
noinst_PROGRAMS = re noinst_PROGRAMS = re
re_SOURCES = split.c debug.c main.c re_SOURCES = split.c debug.c main.c
re_DEPENDENCIES= $(LIBRARIES) re_DEPENDENCIES= $(LIBRARIES)
re_LDFLAGS= @NOINST_LDFLAGS@
EXTRA_DIST = tests CHANGES COPYRIGHT WHATSNEW regexp.c \ EXTRA_DIST = tests CHANGES COPYRIGHT WHATSNEW regexp.c \
debug.ih engine.ih main.ih regcomp.ih regerror.ih \ debug.ih engine.ih main.ih regcomp.ih regerror.ih \
regex.3 regex.7 regex.3 regex.7
......
...@@ -30,6 +30,7 @@ SUBDIRS = share ...@@ -30,6 +30,7 @@ SUBDIRS = share
bin_PROGRAMS = mysqlbinlog bin_PROGRAMS = mysqlbinlog
libexec_PROGRAMS = mysqld libexec_PROGRAMS = mysqld
noinst_PROGRAMS = gen_lex_hash noinst_PROGRAMS = gen_lex_hash
gen_lex_hash_LDFLAGS = @NOINST_LDFLAGS@
LDADD = ../isam/libnisam.a \ LDADD = ../isam/libnisam.a \
../merge/libmerge.a \ ../merge/libmerge.a \
../myisam/libmyisam.a \ ../myisam/libmyisam.a \
...@@ -81,7 +82,7 @@ gen_lex_hash_SOURCES = gen_lex_hash.cc ...@@ -81,7 +82,7 @@ gen_lex_hash_SOURCES = gen_lex_hash.cc
gen_lex_hash_LDADD = $(LDADD) $(CXXLDFLAGS) gen_lex_hash_LDADD = $(LDADD) $(CXXLDFLAGS)
mysqlbinlog_SOURCES = mysqlbinlog.cc mini_client.cc net_serv.cc \ mysqlbinlog_SOURCES = mysqlbinlog.cc mini_client.cc net_serv.cc \
mini_client_errors.c violite.c password.c mini_client_errors.c violite.c password.c
mysqlbinlog_LDADD = $(LDADD) $(CXXLDFLAGS) mysqlbinlog_LDADD = $(LDADD) $(CXXLDFLAGS) $(mysqld_LDADD)
DEFS = -DMYSQL_SERVER \ DEFS = -DMYSQL_SERVER \
-DDEFAULT_MYSQL_HOME="\"$(MYSQLBASEdir)\"" \ -DDEFAULT_MYSQL_HOME="\"$(MYSQLBASEdir)\"" \
......
...@@ -39,7 +39,6 @@ endif ...@@ -39,7 +39,6 @@ endif
endif endif
libmystrings_a_SOURCES = @CHARSET_SRCS@ $(ASRCS) $(CSRCS) libmystrings_a_SOURCES = @CHARSET_SRCS@ $(ASRCS) $(CSRCS)
noinst_PROGRAMS = conf_to_src noinst_PROGRAMS = conf_to_src
# Default charset definitions # Default charset definitions
EXTRA_DIST = ctype-big5.c ctype-czech.c ctype-euc_kr.c \ EXTRA_DIST = ctype-big5.c ctype-czech.c ctype-euc_kr.c \
...@@ -71,6 +70,9 @@ ctype_extra_sources.c: conf_to_src ...@@ -71,6 +70,9 @@ ctype_extra_sources.c: conf_to_src
$(srcdir)/ctype_extra_sources.c $(srcdir)/ctype_extra_sources.c
conf_to_src_SOURCES = conf_to_src.c conf_to_src_SOURCES = conf_to_src.c
conf_to_src_LDADD= conf_to_src_LDADD=
#force static linking of conf_to_src - essential when linking against
#custom installation of libc
conf_to_src_LDFLAGS= @NOINST_LDFLAGS@
# This is because the dependency tracking misses @FOO@ vars in sources. # This is because the dependency tracking misses @FOO@ vars in sources.
strtoull.o: @CHARSET_OBJS@ strtoull.o: @CHARSET_OBJS@
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment