~atcurtis/ourdelta/ourdelta-atcurtis

« back to all changes in this revision

Viewing changes to mysql/5.1/antony_curtis/show_ccflags_configure/show_ccflags_configure.patch

  • Committer: Antony T Curtis
  • Date: 2008-10-17 18:56:38 UTC
  • Revision ID: atcurtis@google.com-20081017185638-1mpc3988qji7nzoy
add patch to show CCFLAGS

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
=== added file 'patch_info/show_ccflags_configure.info'
 
2
--- patch_info/show_ccflags_configure.info      1970-01-01 00:00:00 +0000
 
3
+++ patch_info/show_ccflags_configure.info      2008-10-17 18:55:49 +0000
 
4
@@ -0,0 +1,6 @@
 
5
+File=show_ccflags_configure.patch
 
6
+Name=Adds command line option and status var to show CCFLAGS
 
7
+Version=1.0
 
8
+Author=Antony T Curtis <atcurtis@mac.com>
 
9
+License=GPL
 
10
+Comment=
 
11
 
 
12
=== modified file 'configure.in'
 
13
--- configure.in        2008-10-10 11:54:46 +0000
 
14
+++ configure.in        2008-10-17 18:18:37 +0000
 
15
@@ -224,6 +224,8 @@
 
16
   AC_PATH_PROG(AS, as, as)
 
17
 fi
 
18
 
 
19
+AM_PROG_CC_C_O
 
20
+
 
21
 # Still need ranlib for readline; local static use only so no libtool.
 
22
 AC_PROG_RANLIB
 
23
 # We use libtool
 
24
@@ -2781,7 +2783,7 @@
 
25
  man/Makefile BUILD/Makefile vio/Makefile dnl
 
26
  libmysql/Makefile libmysql_r/Makefile client/Makefile dnl
 
27
  sql/Makefile sql/share/Makefile dnl
 
28
- sql/sql_builtin.cc sql-common/Makefile dnl
 
29
+ sql/sql_builtin.cc sql/mysqld.pc sql-common/Makefile dnl
 
30
  dbug/Makefile scripts/Makefile include/Makefile dnl
 
31
  tests/Makefile Docs/Makefile support-files/Makefile dnl
 
32
  support-files/MacOSX/Makefile support-files/RHEL4-SElinux/Makefile dnl
 
33
 
 
34
=== modified file 'sql/Makefile.am'
 
35
--- sql/Makefile.am     2008-06-18 16:17:15 +0000
 
36
+++ sql/Makefile.am     2008-10-17 18:25:46 +0000
 
37
@@ -20,6 +20,7 @@
 
38
 MYSQLBASEdir=          $(prefix)
 
39
 MYSQLLIBdir=            $(pkglibdir)
 
40
 pkgplugindir =         $(pkglibdir)/plugin
 
41
+pkgconfigdir =         $(prefix)/lib/pkgconfig
 
42
 INCLUDES =             @ZLIB_INCLUDES@ \
 
43
                        -I$(top_builddir)/include -I$(top_srcdir)/include \
 
44
                        -I$(top_srcdir)/regex -I$(srcdir) $(openssl_includes)
 
45
@@ -28,6 +29,7 @@
 
46
 libexec_PROGRAMS =     mysqld
 
47
 EXTRA_PROGRAMS =       gen_lex_hash
 
48
 bin_PROGRAMS =         mysql_tzinfo_to_sql
 
49
+pkgconfig_HEADERS =    mysqld.pc
 
50
 
 
51
 noinst_LTLIBRARIES=    libndb.la \
 
52
                        udf_example.la
 
53
 
 
54
=== modified file 'sql/mysqld.cc'
 
55
--- sql/mysqld.cc       2008-10-09 10:39:42 +0000
 
56
+++ sql/mysqld.cc       2008-10-17 18:45:42 +0000
 
57
@@ -229,6 +229,9 @@
 
58
 
 
59
 /* Constants */
 
60
 
 
61
+extern "C" const char build_ccflags_string[];
 
62
+extern "C" const char build_configure_string[];
 
63
+
 
64
 const char *show_comp_option_name[]= {"YES", "NO", "DISABLED"};
 
65
 /*
 
66
   WARNING: When adding new SQL modes don't forget to update the
 
67
@@ -5384,6 +5387,7 @@
 
68
   OPT_BIND_ADDRESS,            OPT_PID_FILE,
 
69
   OPT_SKIP_PRIOR,              OPT_BIG_TABLES,
 
70
   OPT_STANDALONE,              OPT_ONE_THREAD,
 
71
+  OPT_SHOW_CCFLAGS,            OPT_SHOW_CONFIGURE,
 
72
   OPT_CONSOLE,                 OPT_LOW_PRIORITY_UPDATES,
 
73
   OPT_SKIP_HOST_CACHE,         OPT_SHORT_LOG_FORMAT,
 
74
   OPT_FLUSH,                   OPT_SAFE,
 
75
@@ -6282,6 +6286,12 @@
 
76
   "Dummy option to start as a standalone program (NT).", 0, 0, 0, GET_NO_ARG,
 
77
    NO_ARG, 0, 0, 0, 0, 0, 0},
 
78
 #endif
 
79
+  {"cflags", OPT_SHOW_CCFLAGS,
 
80
+   "Display the compile flags used to build mysqld and exit.",
 
81
+   0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
 
82
+  {"conf-command", OPT_SHOW_CONFIGURE,
 
83
+   "Display the configure command used to build mysqld and exit.",
 
84
+   0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
 
85
   {"symbolic-links", 's', "Enable symbolic link support.",
 
86
    (uchar**) &my_use_symdir, (uchar**) &my_use_symdir, 0, GET_BOOL, NO_ARG,
 
87
    /*
 
88
@@ -7219,6 +7229,8 @@
 
89
   {"Aborted_connects",         (char*) &aborted_connects,       SHOW_LONG},
 
90
   {"Binlog_cache_disk_use",    (char*) &binlog_cache_disk_use,  SHOW_LONG},
 
91
   {"Binlog_cache_use",         (char*) &binlog_cache_use,       SHOW_LONG},
 
92
+  {"Build_ccflags",            (char*) build_ccflags_string,    SHOW_CHAR},
 
93
+  {"Build_configure",          (char*) build_configure_string,  SHOW_CHAR},
 
94
   {"Bytes_received",           (char*) offsetof(STATUS_VAR, bytes_received), SHOW_LONGLONG_STATUS},
 
95
   {"Bytes_sent",               (char*) offsetof(STATUS_VAR, bytes_sent), SHOW_LONGLONG_STATUS},
 
96
   {"Com",                      (char*) com_status_vars, SHOW_ARRAY},
 
97
@@ -7337,6 +7349,19 @@
 
98
   {NullS, NullS, SHOW_LONG}
 
99
 };
 
100
 
 
101
+
 
102
+static void print_ccflags(void)
 
103
+{
 
104
+  printf("%s\n", build_ccflags_string);
 
105
+}
 
106
+
 
107
+
 
108
+static void print_configure(void)
 
109
+{
 
110
+  printf("%s\n", build_configure_string);
 
111
+}
 
112
+
 
113
+
 
114
 static void print_version(void)
 
115
 {
 
116
   set_server_version();
 
117
@@ -7697,6 +7722,12 @@
 
118
 #endif
 
119
     break;
 
120
 #include <sslopt-case.h>
 
121
+  case (int) OPT_SHOW_CCFLAGS:
 
122
+    print_ccflags();
 
123
+    exit(0);
 
124
+  case (int) OPT_SHOW_CONFIGURE:
 
125
+    print_configure();
 
126
+    exit(0);
 
127
   case 'V':
 
128
     print_version();
 
129
     exit(0);
 
130
 
 
131
=== added file 'sql/mysqld.pc.in'
 
132
--- sql/mysqld.pc.in    1970-01-01 00:00:00 +0000
 
133
+++ sql/mysqld.pc.in    2008-10-17 18:17:18 +0000
 
134
@@ -0,0 +1,16 @@
 
135
+# MySQL Storage Engines need this info
 
136
+prefix= @prefix@
 
137
+exec_prefix= @exec_prefix@
 
138
+libdir= @libdir@
 
139
+includedir= @includedir@
 
140
+pkglibdir= ${libdir}/@PACKAGE@
 
141
+pkguncludedir= ${includedir}/@PACKAGE@
 
142
+pkgplugindir= ${pkglibdir}/plugin
 
143
+
 
144
+Name: mysqld
 
145
+Description: MySQL Server (@COMPILATION_COMMENT@)
 
146
+Version: @VERSION@
 
147
+URL: http://www.mysql.com/
 
148
+Libs: 
 
149
+Libs.private: 
 
150
+Cflags: @CPPFLAGS@ @CXXFLAGS@
 
151
 
 
152
=== modified file 'sql/sql_builtin.cc.in'
 
153
--- sql/sql_builtin.cc.in       2006-12-31 01:29:11 +0000
 
154
+++ sql/sql_builtin.cc.in       2008-10-17 18:43:26 +0000
 
155
@@ -25,3 +25,8 @@
 
156
   builtin_binlog_plugin@mysql_plugin_defs@,(struct st_mysql_plugin *)0
 
157
 };
 
158
 
 
159
+#define DEFINE_BUILD(name,value) \
 
160
+const char build_ ## name ## _string[] = #value
 
161
+
 
162
+extern "C" DEFINE_BUILD(ccflags,@CPPFLAGS@ @CXXFLAGS@);
 
163
+extern "C" DEFINE_BUILD(configure,@CONF_COMMAND@);
 
164