summaryrefslogtreecommitdiff
blob: 396965439b6d72996b03f1b53f9a94981e015ffd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
--- mysql-old/cmake/install_layout.cmake
+++ mysql/cmake/install_layout.cmake
@@ -55,7 +55,8 @@
 # - INSTALL_SBINDIR         (directory with mysqld)
 # - INSTALL_SCRIPTDIR       (several scripts, rarely used)
 #
-# - INSTALL_LIBDIR          (directory with client end embedded libraries)
+# - INSTALL_LIBDIR          (directory with client libraries)
+# - INSTALL_ELIBDIR         (directory with embedded libraries)
 # - INSTALL_PLUGINDIR       (directory for plugins)
 #
 # - INSTALL_INCLUDEDIR      (directory for MySQL headers)
@@ -156,6 +157,7 @@
 SET(INSTALL_SCRIPTDIR_STANDALONE        "scripts")
 #
 SET(INSTALL_LIBDIR_STANDALONE           "lib")
+SET(INSTALL_ELIBDIR_STANDALONE          "lib")
 SET(INSTALL_PLUGINDIR_STANDALONE        "lib/mysql/plugin")
 #
 SET(INSTALL_INCLUDEDIR_STANDALONE       "include")
@@ -329,9 +331,11 @@
 #
 IF(CMAKE_SYSTEM_PROCESSOR MATCHES "x86_64")
   SET(INSTALL_LIBDIR_RPM                "lib64")
+  SET(INSTALL_ELIBDIR_RPM               "lib64")
   SET(INSTALL_PLUGINDIR_RPM             "lib64/mysql/plugin")
 ELSE()
   SET(INSTALL_LIBDIR_RPM                "lib")
+  SET(INSTALL_ELIBDIR_RPM               "lib")
   SET(INSTALL_PLUGINDIR_RPM             "lib/mysql/plugin")
 ENDIF()
 #
@@ -394,6 +398,7 @@
 SET(INSTALL_SCRIPTDIR_DEB               "scripts")
 #
 SET(INSTALL_LIBDIR_DEB                  "lib")
+SET(INSTALL_ELIBDIR_DEB                 "lib")
 SET(INSTALL_PLUGINDIR_DEB               "lib/mysql/plugin")
 #
 SET(INSTALL_INCLUDEDIR_DEB              "include")
@@ -422,6 +427,7 @@
 SET(INSTALL_SCRIPTDIR_SVR4              "scripts")
 #
 SET(INSTALL_LIBDIR_SVR4                 "lib")
+SET(INSTALL_ELIBDIR_SVR4                "lib")
 SET(INSTALL_PLUGINDIR_SVR4              "lib/plugin")
 #
 SET(INSTALL_INCLUDEDIR_SVR4             "include")
@@ -454,7 +460,7 @@
 # Set INSTALL_FOODIR variables for chosen layout (for example, INSTALL_BINDIR
 # will be defined  as ${INSTALL_BINDIR_STANDALONE} by default if STANDALONE
 # layout is chosen)
-FOREACH(var BIN SBIN LIB MYSQLSHARE SHARE PLUGIN INCLUDE SCRIPT DOC MAN
+FOREACH(var BIN SBIN LIB ELIB MYSQLSHARE SHARE PLUGIN INCLUDE SCRIPT DOC MAN
   INFO MYSQLTEST SQLBENCH DOCREADME SUPPORTFILES MYSQLDATA PLUGINTEST
   SECURE_FILE_PRIV SECURE_FILE_PRIV_EMBEDDED)
   SET(INSTALL_${var}DIR  ${INSTALL_${var}DIR_${INSTALL_LAYOUT}}
--- mysql-old/cmake/libutils.cmake
+++ mysql/cmake/libutils.cmake
@@ -40,6 +40,8 @@
 # - MERGE_LIBRARIES(target [STATIC|SHARED|MODULE]  [linklib1 .... linklibN]
 #  [EXPORTS exported_func1 .... exported_func_N]
 #  [OUTPUT_NAME output_name]
+#  [OUTPUT_DIR output_dir]
+
 # This macro merges several static libraries into a single one or creates a shared
 # library from several convenience libraries
 
@@ -215,7 +217,7 @@
 #)
 MACRO(MERGE_LIBRARIES)
   MYSQL_PARSE_ARGUMENTS(ARG
-    "EXPORTS;OUTPUT_NAME;COMPONENT"
+    "EXPORTS;OUTPUT_NAME;COMPONENT;OUTPUT_DIR"
     "STATIC;SHARED;MODULE;NOINSTALL"
     ${ARGN}
   )
@@ -266,7 +268,11 @@
     IF(ARG_COMPONENT)
       SET(COMP COMPONENT ${ARG_COMPONENT}) 
     ENDIF()
-    MYSQL_INSTALL_TARGETS(${TARGET} DESTINATION "${INSTALL_LIBDIR}" ${COMP})
+    IF(ARG_OUTPUT_DIR)
+      MYSQL_INSTALL_TARGETS(${TARGET} DESTINATION "${ARG_OUTPUT_DIR}" ${COMP})
+    ELSE()
+      MYSQL_INSTALL_TARGETS(${TARGET} DESTINATION "${INSTALL_LIBDIR}" ${COMP})
+    ENDIF()
   ENDIF()
   SET_TARGET_PROPERTIES(${TARGET} PROPERTIES LINK_INTERFACE_LIBRARIES "")
 
--- mysql-old/libmysql/CMakeLists.txt
+++ mysql/libmysql/CMakeLists.txt
@@ -179,8 +179,13 @@
   LIST(APPEND LIBS auth_win_client)
 ENDIF()
 
+SET(INSTALL_STATIC_LIBS "")
+IF(NOT ENABLE_STATIC_LIBS)
+  SET(INSTALL_STATIC_LIBS "NOINSTALL")
+ENDIF()
+
 # Merge several convenience libraries into one big perconaserverclient
-MERGE_LIBRARIES(perconaserverclient STATIC ${LIBS} COMPONENT Development)
+MERGE_LIBRARIES(perconaserverclient STATIC ${LIBS} COMPONENT Development OUTPUT_DIR ${INSTALL_LIBDIR} ${INSTALL_STATIC_LIBS})
 
 # Visual Studio users need debug  static library for debug projects
 IF(MSVC)
@@ -210,9 +215,11 @@
 
 IF(UNIX)
   GET_TARGET_NAME(perconaserverclient lib_name)
-  INSTALL_SYMLINK(perconaserverclient
-    ${lib_name} ${CMAKE_STATIC_LIBRARY_PREFIX}perconaserverclient_r.a
-    ${INSTALL_LIBDIR} Development)
+  IF(ENABLE_STATIC_LIBS)
+    INSTALL_SYMLINK(perconaserverclient
+      ${lib_name} ${CMAKE_STATIC_LIBRARY_PREFIX}perconaserverclient_r.a
+      ${INSTALL_LIBDIR} Development)
+  ENDIF()
 ENDIF()
 
 IF(NOT DISABLE_SHARED)
--- mysql-old/libmysqld/CMakeLists.txt
+++ mysql/libmysqld/CMakeLists.txt
@@ -115,8 +115,13 @@
   ENDIF()
 ENDFOREACH()
 
+SET(INSTALL_STATIC_LIBS "")
+IF(NOT ENABLE_STATIC_LIBS)
+  SET(INSTALL_STATIC_LIBS "NOINSTALL")
+ENDIF()
+
 MERGE_LIBRARIES(mysqlserver STATIC ${EMBEDDED_LIBS} 
-  OUTPUT_NAME ${MYSQLSERVER_OUTPUT_NAME} COMPONENT Embedded)
+  OUTPUT_NAME ${MYSQLSERVER_OUTPUT_NAME} COMPONENT Embedded OUTPUT_DIR ${INSTALL_ELIBDIR} ${INSTALL_STATIC_LIBS})
 
 # Visual Studio users need debug  static library 
 IF(MSVC)
@@ -124,12 +129,14 @@
 ENDIF()
 
 IF(UNIX)
- INSTALL_DEBUG_TARGET(mysqlserver DESTINATION ${INSTALL_LIBDIR} RENAME
+ INSTALL_DEBUG_TARGET(mysqlserver DESTINATION ${INSTALL_ELIBDIR} RENAME
   ${CMAKE_STATIC_LIBRARY_PREFIX}mysqld-debug)
 ENDIF()
 
 IF(NOT DISABLE_SHARED)
-  MERGE_LIBRARIES(libmysqld SHARED mysqlserver EXPORTS ${CLIENT_API_FUNCTIONS})
+  MERGE_LIBRARIES(libmysqld SHARED mysqlserver EXPORTS ${CLIENT_API_FUNCTIONS}
+  COMPONENT Embedded OUTPUT_DIR ${INSTALL_ELIBDIR})
+
   IF(UNIX)
     # Name the shared library, handle versioning (provides same api as client library
     # hence the same version)
--- mysql-old/libservices/CMakeLists.txt
+++ mysql/libservices/CMakeLists.txt
@@ -24,4 +24,6 @@
   mysql_string_service.c)
 
 ADD_LIBRARY(mysqlservices ${MYSQLSERVICES_SOURCES})
-INSTALL(TARGETS mysqlservices DESTINATION ${INSTALL_LIBDIR} COMPONENT Development)
+IF(ENABLE_STATIC_LIBS)
+  INSTALL(TARGETS mysqlservices DESTINATION ${INSTALL_LIBDIR} COMPONENT Development)
+ENDIF()
--- mysql-old/scripts/CMakeLists.txt
+++ mysql/scripts/CMakeLists.txt
@@ -249,6 +249,7 @@
 SET(pkglibdir ${prefix}/${INSTALL_LIBDIR})
 SET(pkgplugindir ${prefix}/${INSTALL_PLUGINDIR})
 SET(localstatedir ${MYSQL_DATADIR})
+SET(elibdir ${prefix}/${INSTALL_ELIBDIR})
 
 SET(RPATH_OPTION "")
 IF(CMAKE_SYSTEM_NAME STREQUAL "SunOS")
--- mysql-old/scripts/mysql_config.sh
+++ mysql/scripts/mysql_config.sh
@@ -92,6 +92,10 @@
 plugindir_rel=`echo $plugindir | sed -e "s;^$basedir/;;"`
 fix_path plugindir $plugindir_rel @libsubdir@/mysql/plugin @libsubdir@/plugin
 
+elibdir='@elibdir@'
+elibdir_rel=`echo $elibdir | sed -e "s;^$basedir/;;"`
+fix_path elibdir $elibdir_rel lib64/mysql lib64 lib/mysql lib
+
 pkgincludedir='@pkgincludedir@'
 if [ -f "$basedir/include/mysql/mysql.h" ]; then
   pkgincludedir="$basedir/include/mysql"
@@ -116,7 +120,7 @@
 libs="$libs @QUOTED_CMAKE_C_LINK_FLAGS@"
 libs_r=" $ldflags -L$pkglibdir @RPATH_OPTION@ -lperconaserverclient @ZLIB_DEPS@ @CLIENT_LIBS@ @openssl_libs@ "
 libs_r="$libs_r @QUOTED_CMAKE_C_LINK_FLAGS@"
-embedded_libs=" $ldflags -L$pkglibdir @RPATH_OPTION@ -lmysqld @LIBDL@ @ZLIB_DEPS@ @LIBS@ @WRAPLIBS@ @openssl_libs@ "
+embedded_libs=" $ldflags -L$elibdir @RPATH_OPTION@ -lmysqld @LIBDL@ @ZLIB_DEPS@ @LIBS@ @WRAPLIBS@ @openssl_libs@ "
 embedded_libs="$embedded_libs @QUOTED_CMAKE_CXX_LINK_FLAGS@"
 
 cflags="-I$pkgincludedir @CFLAGS@ " #note: end space!