Skip to content

Commit 18418ff

Browse files
author
kent@mysql.com/kent-amd64.(none)
committed
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
1 parent bf1ba3d commit 18418ff

13 files changed

+974
-30
lines changed

extra/CMakeLists.txt

+3
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,9 @@ TARGET_LINK_LIBRARIES(my_print_defaults strings mysys debug dbug taocrypt wsock3
4444
ADD_EXECUTABLE(perror perror.c)
4545
TARGET_LINK_LIBRARIES(perror strings mysys debug dbug wsock32)
4646

47+
ADD_EXECUTABLE(resolveip resolveip.c)
48+
TARGET_LINK_LIBRARIES(resolveip strings mysys debug dbug wsock32)
49+
4750
ADD_EXECUTABLE(replace replace.c)
4851
TARGET_LINK_LIBRARIES(replace strings mysys debug dbug wsock32)
4952

extra/resolveip.c

+8-6
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,15 @@
2121
#include <m_ctype.h>
2222
#include <my_sys.h>
2323
#include <m_string.h>
24-
#include <sys/types.h>
25-
#include <sys/socket.h>
26-
#ifndef HAVE_BROKEN_NETINET_INCLUDES
27-
#include <netinet/in.h>
24+
#ifndef WIN32
25+
# include <sys/types.h>
26+
# include <sys/socket.h>
27+
# ifndef HAVE_BROKEN_NETINET_INCLUDES
28+
# include <netinet/in.h>
29+
# endif
30+
# include <arpa/inet.h>
31+
# include <netdb.h>
2832
#endif
29-
#include <arpa/inet.h>
30-
#include <netdb.h>
3133
#include <my_net.h>
3234
#include <my_getopt.h>
3335

scripts/CMakeLists.txt

+41
Original file line numberDiff line numberDiff line change
@@ -40,3 +40,44 @@ ADD_CUSTOM_COMMAND(OUTPUT ${PROJECT_SOURCE_DIR}/scripts/mysql_fix_privilege_tabl
4040
ADD_CUSTOM_TARGET(GenFixPrivs
4141
ALL
4242
DEPENDS ${PROJECT_SOURCE_DIR}/scripts/mysql_fix_privilege_tables_sql.c)
43+
44+
# ----------------------------------------------------------------------
45+
# Replace some variables @foo@ in the .in/.sh file, and write the new script
46+
# ----------------------------------------------------------------------
47+
48+
SET(CFLAGS "-D_WINDOWS ${CMAKE_C_FLAGS_RELWITHDEBINFO}")
49+
SET(prefix "${CMAKE_INSTALL_PREFIX}/MySQL Server ${MYSQL_BASE_VERSION}")
50+
SET(sysconfdir ${prefix})
51+
SET(bindir ${prefix}/bin)
52+
SET(libexecdir ${prefix}/bin)
53+
SET(scriptdir ${prefix}/bin)
54+
SET(datadir ${prefix}/share)
55+
SET(pkgdatadir ${prefix}/share)
56+
SET(localstatedir ${prefix}/data)
57+
58+
CONFIGURE_FILE(mysql_config.pl.in
59+
scripts/mysql_config.pl ESCAPE_QUOTES @ONLY)
60+
61+
CONFIGURE_FILE(mysql_convert_table_format.sh
62+
scripts/mysql_convert_table_format.pl ESCAPE_QUOTES @ONLY)
63+
64+
CONFIGURE_FILE(mysql_explain_log.sh
65+
scripts/mysql_explain_log.pl ESCAPE_QUOTES @ONLY)
66+
67+
CONFIGURE_FILE(mysql_install_db.pl.in
68+
scripts/mysql_install_db.pl ESCAPE_QUOTES @ONLY)
69+
70+
CONFIGURE_FILE(mysql_secure_installation.sh
71+
scripts/mysql_secure_installation.pl ESCAPE_QUOTES @ONLY)
72+
73+
CONFIGURE_FILE(mysql_tableinfo.sh
74+
scripts/mysql_tableinfo.pl ESCAPE_QUOTES @ONLY)
75+
76+
CONFIGURE_FILE(mysqld_multi.sh
77+
scripts/mysqld_multi.pl ESCAPE_QUOTES @ONLY)
78+
79+
CONFIGURE_FILE(mysqldumpslow.sh
80+
scripts/mysqldumpslow.pl ESCAPE_QUOTES @ONLY)
81+
82+
CONFIGURE_FILE(mysqlhotcopy.sh
83+
scripts/mysqlhotcopy.pl ESCAPE_QUOTES @ONLY)

scripts/Makefile.am

+2
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,11 @@ EXTRA_SCRIPTS = make_binary_distribution.sh \
4848
make_win_src_distribution_old.sh \
4949
msql2mysql.sh \
5050
mysql_config.sh \
51+
mysql_config.pl.in \
5152
mysql_fix_privilege_tables.sh \
5253
mysql_fix_extensions.sh \
5354
mysql_install_db.sh \
55+
mysql_install_db.pl.in \
5456
mysql_setpermission.sh \
5557
mysql_secure_installation.sh \
5658
mysql_zap.sh \

scripts/make_win_bin_dist

+17-18
Original file line numberDiff line numberDiff line change
@@ -327,35 +327,34 @@ if [ -d mysql-test/extra ] ; then
327327
fi
328328

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

333+
mysql_scripts="\
334+
mysql_config.pl \
335+
mysql_convert_table_format.pl \
336+
mysql_explain_log.pl \
337+
mysql_install_db.pl \
338+
mysql_secure_installation.pl \
339+
mysql_tableinfo.pl \
340+
mysqld_multi.pl \
341+
mysqldumpslow.pl \
342+
mysqlhotcopy.pl \
343+
"
344+
338345
mkdir -p $DESTDIR/scripts
339346

340-
# Uncomment and remove the for loop in 5.1
341-
#cp scripts/*.sql $DESTDIR/scripts/
342-
343-
for i in `cd scripts && ls`; do \
344-
if echo $i | grep -q '\.sh'; then \
345-
cp scripts/$i $DESTDIR/scripts/`echo $i | sed -e 's/\.sh$//'`; \
346-
elif [ -d scripts/$i -o $i = Makefile.am -o $i = Makefile.in -o -e scripts/$i.sh ] ; then \
347-
: ; \
348-
else \
349-
cp scripts/$i $DESTDIR/scripts/$i; \
350-
fi; \
347+
for i in $mysql_scripts
348+
do
349+
cp scripts/$i $DESTDIR/scripts/$i
351350
done
352351

353352
cp -pR sql/share $DESTDIR/
354353
cp -pR sql-bench $DESTDIR/
355354
rm -f $DESTDIR/sql-bench/*.sh $DESTDIR/sql-bench/Makefile*
356355

357356
# The SQL initialisation code is really expected to be in "share"
358-
mv $DESTDIR/scripts/*.sql $DESTDIR/share/ || true
357+
mv $DESTDIR/scripts/*.sql $DESTDIR/share/
359358

360359
# ----------------------------------------------------------------------
361360
# Clean up from possibly copied SCCS directories

0 commit comments

Comments
 (0)