Commit 18418ff8 authored by kent@mysql.com/kent-amd64.(none)'s avatar kent@mysql.com/kent-amd64.(none)
Browse files

make_win_bin_dist CMakeLists.txt resolveip.c Makefile.am:

  Better Windows support in the scripts directory
mysql_config.pl.in, mysql_install_db.pl.in:
  New Perl version of Unix shell script, mainly for Windows
Many files in scripts directory:
  Use default Perl location "#!/usr/bin/perl" instead of the build host path
parent bf1ba3d4
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -44,6 +44,9 @@ TARGET_LINK_LIBRARIES(my_print_defaults strings mysys debug dbug taocrypt wsock3
ADD_EXECUTABLE(perror perror.c)
TARGET_LINK_LIBRARIES(perror strings mysys debug dbug wsock32)

ADD_EXECUTABLE(resolveip resolveip.c)
TARGET_LINK_LIBRARIES(resolveip strings mysys debug dbug wsock32)

ADD_EXECUTABLE(replace replace.c)
TARGET_LINK_LIBRARIES(replace strings mysys debug dbug wsock32)

+8 −6
Original line number Diff line number Diff line
@@ -21,6 +21,7 @@
#include <m_ctype.h>
#include <my_sys.h>
#include <m_string.h>
#ifndef WIN32
#  include <sys/types.h>
#  include <sys/socket.h>
#  ifndef HAVE_BROKEN_NETINET_INCLUDES
@@ -28,6 +29,7 @@
#  endif
#  include <arpa/inet.h>
#  include <netdb.h>
#endif
#include <my_net.h>
#include <my_getopt.h>

+41 −0
Original line number Diff line number Diff line
@@ -40,3 +40,44 @@ ADD_CUSTOM_COMMAND(OUTPUT ${PROJECT_SOURCE_DIR}/scripts/mysql_fix_privilege_tabl
ADD_CUSTOM_TARGET(GenFixPrivs
                  ALL
                  DEPENDS ${PROJECT_SOURCE_DIR}/scripts/mysql_fix_privilege_tables_sql.c)

# ----------------------------------------------------------------------
# Replace some variables @foo@ in the .in/.sh file, and write the new script
# ----------------------------------------------------------------------

SET(CFLAGS             "-D_WINDOWS ${CMAKE_C_FLAGS_RELWITHDEBINFO}")
SET(prefix             "${CMAKE_INSTALL_PREFIX}/MySQL Server ${MYSQL_BASE_VERSION}")
SET(sysconfdir          ${prefix})
SET(bindir              ${prefix}/bin)
SET(libexecdir          ${prefix}/bin)
SET(scriptdir           ${prefix}/bin)
SET(datadir             ${prefix}/share)
SET(pkgdatadir          ${prefix}/share)
SET(localstatedir       ${prefix}/data)

CONFIGURE_FILE(mysql_config.pl.in
               scripts/mysql_config.pl ESCAPE_QUOTES @ONLY)

CONFIGURE_FILE(mysql_convert_table_format.sh
               scripts/mysql_convert_table_format.pl ESCAPE_QUOTES @ONLY)

CONFIGURE_FILE(mysql_explain_log.sh
               scripts/mysql_explain_log.pl ESCAPE_QUOTES @ONLY)

CONFIGURE_FILE(mysql_install_db.pl.in
               scripts/mysql_install_db.pl ESCAPE_QUOTES @ONLY)

CONFIGURE_FILE(mysql_secure_installation.sh
               scripts/mysql_secure_installation.pl ESCAPE_QUOTES @ONLY)

CONFIGURE_FILE(mysql_tableinfo.sh
               scripts/mysql_tableinfo.pl ESCAPE_QUOTES @ONLY)

CONFIGURE_FILE(mysqld_multi.sh
               scripts/mysqld_multi.pl ESCAPE_QUOTES @ONLY)

CONFIGURE_FILE(mysqldumpslow.sh
               scripts/mysqldumpslow.pl ESCAPE_QUOTES @ONLY)

CONFIGURE_FILE(mysqlhotcopy.sh
               scripts/mysqlhotcopy.pl ESCAPE_QUOTES @ONLY)
+2 −0
Original line number Diff line number Diff line
@@ -48,9 +48,11 @@ EXTRA_SCRIPTS = make_binary_distribution.sh \
			make_win_src_distribution_old.sh \
			msql2mysql.sh \
			mysql_config.sh \
			mysql_config.pl.in \
			mysql_fix_privilege_tables.sh \
			mysql_fix_extensions.sh \
			mysql_install_db.sh \
			mysql_install_db.pl.in \
			mysql_setpermission.sh \
			mysql_secure_installation.sh \
			mysql_zap.sh \
+17 −18
Original line number Diff line number Diff line
@@ -327,27 +327,26 @@ if [ -d mysql-test/extra ] ; then
fi

# ----------------------------------------------------------------------
# Copy what could be usable in the "scripts" directory. Currently
# only SQL files, others are Bourne shell scripts or Perl scripts
# not really usable on Windows.
#
# But to be nice to the few Cygwin users we might have in 5.0 we
# continue to copy the stuff, but don't include it in the WiX install.
# Copy what could be usable in the "scripts" directory
# ----------------------------------------------------------------------

mysql_scripts="\
mysql_config.pl \
mysql_convert_table_format.pl \
mysql_explain_log.pl \
mysql_install_db.pl \
mysql_secure_installation.pl \
mysql_tableinfo.pl \
mysqld_multi.pl \
mysqldumpslow.pl \
mysqlhotcopy.pl \
"

mkdir -p $DESTDIR/scripts

# Uncomment and remove the for loop in 5.1
#cp scripts/*.sql $DESTDIR/scripts/

for i in `cd scripts && ls`; do \
  if echo $i | grep -q '\.sh'; then \
    cp scripts/$i $DESTDIR/scripts/`echo $i | sed -e 's/\.sh$//'`; \
  elif [ -d scripts/$i -o $i = Makefile.am -o $i = Makefile.in -o -e scripts/$i.sh ] ; then \
    : ; \
  else \
    cp scripts/$i $DESTDIR/scripts/$i; \
  fi; \
for i in $mysql_scripts
do
  cp scripts/$i $DESTDIR/scripts/$i
done

cp -pR sql/share $DESTDIR/
@@ -355,7 +354,7 @@ cp -pR sql-bench $DESTDIR/
rm -f $DESTDIR/sql-bench/*.sh $DESTDIR/sql-bench/Makefile*

# The SQL initialisation code is really expected to be in "share"
mv $DESTDIR/scripts/*.sql $DESTDIR/share/ || true
mv $DESTDIR/scripts/*.sql $DESTDIR/share/

# ----------------------------------------------------------------------
# Clean up from possibly copied SCCS directories
Loading