wxwin.m4 42 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112
  1. dnl wxWindows Library Licence, Version 3.1
  2. dnl ======================================
  3. dnl
  4. dnl Copyright (c) 1998-2005 Julian Smart, Robert Roebling et al
  5. dnl
  6. dnl Everyone is permitted to copy and distribute verbatim copies
  7. dnl of this licence document, but changing it is not allowed.
  8. dnl
  9. dnl WXWINDOWS LIBRARY LICENCE
  10. dnl TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
  11. dnl
  12. dnl This library is free software; you can redistribute it and/or modify it
  13. dnl under the terms of the GNU Library General Public Licence as published by
  14. dnl the Free Software Foundation; either version 2 of the Licence, or (at
  15. dnl your option) any later version.
  16. dnl
  17. dnl This library is distributed in the hope that it will be useful, but
  18. dnl WITHOUT ANY WARRANTY; without even the implied warranty of
  19. dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library
  20. dnl General Public Licence for more details.
  21. dnl
  22. dnl You should have received a copy of the GNU Library General Public Licence
  23. dnl along with this software, usually in a file named COPYING.LIB. If not,
  24. dnl write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
  25. dnl Boston, MA 02110-1301 USA.
  26. dnl
  27. dnl EXCEPTION NOTICE
  28. dnl
  29. dnl 1. As a special exception, the copyright holders of this library give
  30. dnl permission for additional uses of the text contained in this release of
  31. dnl the library as licenced under the wxWindows Library Licence, applying
  32. dnl either version 3.1 of the Licence, or (at your option) any later version of
  33. dnl the Licence as published by the copyright holders of version
  34. dnl 3.1 of the Licence document.
  35. dnl
  36. dnl 2. The exception is that you may use, copy, link, modify and distribute
  37. dnl under your own terms, binary object code versions of works based
  38. dnl on the Library.
  39. dnl
  40. dnl 3. If you copy code from files distributed under the terms of the GNU
  41. dnl General Public Licence or the GNU Library General Public Licence into a
  42. dnl copy of this library, as this licence permits, the exception does not
  43. dnl apply to the code that you add in this way. To avoid misleading anyone as
  44. dnl to the status of such modified files, you must delete this exception
  45. dnl notice from such code and/or adjust the licensing conditions notice
  46. dnl accordingly.
  47. dnl
  48. dnl 4. If you write modifications of your own for this library, it is your
  49. dnl choice whether to permit this exception to apply to your modifications.
  50. dnl If you do not wish that, you must delete the exception notice from such
  51. dnl code and/or adjust the licensing conditions notice accordingly.
  52. dnl ---------------------------------------------------------------------------
  53. dnl Author: wxWidgets development team,
  54. dnl Francesco Montorsi,
  55. dnl Bob McCown (Mac-testing)
  56. dnl Creation date: 24/11/2001
  57. dnl ---------------------------------------------------------------------------
  58. dnl ===========================================================================
  59. dnl Table of Contents of this macro file:
  60. dnl -------------------------------------
  61. dnl
  62. dnl SECTION A: wxWidgets main macros
  63. dnl - WX_CONFIG_OPTIONS
  64. dnl - WX_CONFIG_CHECK
  65. dnl - WXRC_CHECK
  66. dnl - WX_STANDARD_OPTIONS
  67. dnl - WX_CONVERT_STANDARD_OPTIONS_TO_WXCONFIG_FLAGS
  68. dnl - WX_DETECT_STANDARD_OPTION_VALUES
  69. dnl
  70. dnl SECTION B: wxWidgets-related utilities
  71. dnl - WX_LIKE_LIBNAME
  72. dnl - WX_ARG_ENABLE_YESNOAUTO
  73. dnl - WX_ARG_WITH_YESNOAUTO
  74. dnl
  75. dnl SECTION C: messages to the user
  76. dnl - WX_STANDARD_OPTIONS_SUMMARY_MSG
  77. dnl - WX_STANDARD_OPTIONS_SUMMARY_MSG_BEGIN
  78. dnl - WX_STANDARD_OPTIONS_SUMMARY_MSG_END
  79. dnl - WX_BOOLOPT_SUMMARY
  80. dnl
  81. dnl The special "WX_DEBUG_CONFIGURE" variable can be set to 1 to enable extra
  82. dnl debug output on stdout from these macros.
  83. dnl ===========================================================================
  84. dnl ---------------------------------------------------------------------------
  85. dnl Macros for wxWidgets detection. Typically used in configure.in as:
  86. dnl
  87. dnl AC_ARG_ENABLE(...)
  88. dnl AC_ARG_WITH(...)
  89. dnl ...
  90. dnl WX_CONFIG_OPTIONS
  91. dnl ...
  92. dnl ...
  93. dnl WX_CONFIG_CHECK([2.6.0], [wxWin=1])
  94. dnl if test "$wxWin" != 1; then
  95. dnl AC_MSG_ERROR([
  96. dnl wxWidgets must be installed on your system
  97. dnl but wx-config script couldn't be found.
  98. dnl
  99. dnl Please check that wx-config is in path, the directory
  100. dnl where wxWidgets libraries are installed (returned by
  101. dnl 'wx-config --libs' command) is in LD_LIBRARY_PATH or
  102. dnl equivalent variable and wxWidgets version is 2.3.4 or above.
  103. dnl ])
  104. dnl fi
  105. dnl CPPFLAGS="$CPPFLAGS $WX_CPPFLAGS"
  106. dnl CXXFLAGS="$CXXFLAGS $WX_CXXFLAGS_ONLY"
  107. dnl CFLAGS="$CFLAGS $WX_CFLAGS_ONLY"
  108. dnl
  109. dnl LIBS="$LIBS $WX_LIBS"
  110. dnl
  111. dnl If you want to support standard --enable-debug/unicode/shared options, you
  112. dnl may do the following:
  113. dnl
  114. dnl ...
  115. dnl AC_CANONICAL_SYSTEM
  116. dnl
  117. dnl # define configure options
  118. dnl WX_CONFIG_OPTIONS
  119. dnl WX_STANDARD_OPTIONS([debug,unicode,shared,toolkit,wxshared])
  120. dnl
  121. dnl # basic configure checks
  122. dnl ...
  123. dnl
  124. dnl # we want to always have DEBUG==WX_DEBUG and UNICODE==WX_UNICODE
  125. dnl WX_DEBUG=$DEBUG
  126. dnl WX_UNICODE=$UNICODE
  127. dnl
  128. dnl WX_CONVERT_STANDARD_OPTIONS_TO_WXCONFIG_FLAGS
  129. dnl WX_CONFIG_CHECK([2.8.0], [wxWin=1],,[html,core,net,base],[$WXCONFIG_FLAGS])
  130. dnl WX_DETECT_STANDARD_OPTION_VALUES
  131. dnl
  132. dnl # write the output files
  133. dnl AC_CONFIG_FILES([Makefile ...])
  134. dnl AC_OUTPUT
  135. dnl
  136. dnl # optional: just to show a message to the user
  137. dnl WX_STANDARD_OPTIONS_SUMMARY_MSG
  138. dnl
  139. dnl ---------------------------------------------------------------------------
  140. dnl ---------------------------------------------------------------------------
  141. dnl WX_CONFIG_OPTIONS
  142. dnl
  143. dnl adds support for --wx-prefix, --wx-exec-prefix, --with-wxdir and
  144. dnl --wx-config command line options
  145. dnl ---------------------------------------------------------------------------
  146. AC_DEFUN([WX_CONFIG_OPTIONS],
  147. [
  148. AC_ARG_WITH(wxdir,
  149. [ --with-wxdir=PATH Use uninstalled version of wxWidgets in PATH],
  150. [ wx_config_name="$withval/wx-config"
  151. wx_config_args="--inplace"])
  152. AC_ARG_WITH(wx-config,
  153. [ --with-wx-config=CONFIG wx-config script to use (optional)],
  154. wx_config_name="$withval" )
  155. AC_ARG_WITH(wx-prefix,
  156. [ --with-wx-prefix=PREFIX Prefix where wxWidgets is installed (optional)],
  157. wx_config_prefix="$withval", wx_config_prefix="")
  158. AC_ARG_WITH(wx-exec-prefix,
  159. [ --with-wx-exec-prefix=PREFIX
  160. Exec prefix where wxWidgets is installed (optional)],
  161. wx_config_exec_prefix="$withval", wx_config_exec_prefix="")
  162. ])
  163. dnl Helper macro for checking if wx version is at least $1.$2.$3, set's
  164. dnl wx_ver_ok=yes if it is:
  165. AC_DEFUN([_WX_PRIVATE_CHECK_VERSION],
  166. [
  167. wx_ver_ok=""
  168. if test "x$WX_VERSION" != x ; then
  169. if test $wx_config_major_version -gt $1; then
  170. wx_ver_ok=yes
  171. else
  172. if test $wx_config_major_version -eq $1; then
  173. if test $wx_config_minor_version -gt $2; then
  174. wx_ver_ok=yes
  175. else
  176. if test $wx_config_minor_version -eq $2; then
  177. if test $wx_config_micro_version -ge $3; then
  178. wx_ver_ok=yes
  179. fi
  180. fi
  181. fi
  182. fi
  183. fi
  184. fi
  185. ])
  186. dnl ---------------------------------------------------------------------------
  187. dnl WX_CONFIG_CHECK(VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND
  188. dnl [, WX-LIBS [, ADDITIONAL-WX-CONFIG-FLAGS]]]])
  189. dnl
  190. dnl Test for wxWidgets, and define WX_C*FLAGS, WX_LIBS and WX_LIBS_STATIC
  191. dnl (the latter is for static linking against wxWidgets). Set WX_CONFIG_NAME
  192. dnl environment variable to override the default name of the wx-config script
  193. dnl to use. Set WX_CONFIG_PATH to specify the full path to wx-config - in this
  194. dnl case the macro won't even waste time on tests for its existence.
  195. dnl
  196. dnl Optional WX-LIBS argument contains comma- or space-separated list of
  197. dnl wxWidgets libraries to link against. If it is not specified then WX_LIBS
  198. dnl and WX_LIBS_STATIC will contain flags to link with all of the core
  199. dnl wxWidgets libraries.
  200. dnl
  201. dnl Optional ADDITIONAL-WX-CONFIG-FLAGS argument is appended to wx-config
  202. dnl invocation command in present. It can be used to fine-tune lookup of
  203. dnl best wxWidgets build available.
  204. dnl
  205. dnl Example use:
  206. dnl WX_CONFIG_CHECK([2.6.0], [wxWin=1], [wxWin=0], [html,core,net]
  207. dnl [--unicode --debug])
  208. dnl ---------------------------------------------------------------------------
  209. dnl
  210. dnl Get the cflags and libraries from the wx-config script
  211. dnl
  212. AC_DEFUN([WX_CONFIG_CHECK],
  213. [
  214. dnl do we have wx-config name: it can be wx-config or wxd-config or ...
  215. if test x${WX_CONFIG_NAME+set} != xset ; then
  216. WX_CONFIG_NAME=wx-config
  217. fi
  218. if test "x$wx_config_name" != x ; then
  219. WX_CONFIG_NAME="$wx_config_name"
  220. fi
  221. dnl deal with optional prefixes
  222. if test x$wx_config_exec_prefix != x ; then
  223. wx_config_args="$wx_config_args --exec-prefix=$wx_config_exec_prefix"
  224. WX_LOOKUP_PATH="$wx_config_exec_prefix/bin"
  225. fi
  226. if test x$wx_config_prefix != x ; then
  227. wx_config_args="$wx_config_args --prefix=$wx_config_prefix"
  228. WX_LOOKUP_PATH="$WX_LOOKUP_PATH:$wx_config_prefix/bin"
  229. fi
  230. if test "$cross_compiling" = "yes"; then
  231. wx_config_args="$wx_config_args --host=$host_alias"
  232. fi
  233. dnl don't search the PATH if WX_CONFIG_NAME is absolute filename
  234. if test -x "$WX_CONFIG_NAME" ; then
  235. AC_MSG_CHECKING(for wx-config)
  236. WX_CONFIG_PATH="$WX_CONFIG_NAME"
  237. AC_MSG_RESULT($WX_CONFIG_PATH)
  238. else
  239. AC_PATH_PROG(WX_CONFIG_PATH, $WX_CONFIG_NAME, no, "$WX_LOOKUP_PATH:$PATH")
  240. fi
  241. if test "$WX_CONFIG_PATH" != "no" ; then
  242. WX_VERSION=""
  243. min_wx_version=ifelse([$1], ,2.2.1,$1)
  244. if test -z "$5" ; then
  245. AC_MSG_CHECKING([for wxWidgets version >= $min_wx_version])
  246. else
  247. AC_MSG_CHECKING([for wxWidgets version >= $min_wx_version ($5)])
  248. fi
  249. dnl don't add the libraries ($4) to this variable as this would result in
  250. dnl an error when it's used with --version below
  251. WX_CONFIG_WITH_ARGS="$WX_CONFIG_PATH $wx_config_args $5"
  252. WX_VERSION=`$WX_CONFIG_WITH_ARGS --version 2>/dev/null`
  253. wx_config_major_version=`echo $WX_VERSION | \
  254. sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
  255. wx_config_minor_version=`echo $WX_VERSION | \
  256. sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
  257. wx_config_micro_version=`echo $WX_VERSION | \
  258. sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
  259. wx_requested_major_version=`echo $min_wx_version | \
  260. sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
  261. wx_requested_minor_version=`echo $min_wx_version | \
  262. sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
  263. wx_requested_micro_version=`echo $min_wx_version | \
  264. sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
  265. _WX_PRIVATE_CHECK_VERSION([$wx_requested_major_version],
  266. [$wx_requested_minor_version],
  267. [$wx_requested_micro_version])
  268. if test -n "$wx_ver_ok"; then
  269. AC_MSG_RESULT(yes (version $WX_VERSION))
  270. WX_LIBS=`$WX_CONFIG_WITH_ARGS --libs $4`
  271. dnl is this even still appropriate? --static is a real option now
  272. dnl and WX_CONFIG_WITH_ARGS is likely to contain it if that is
  273. dnl what the user actually wants, making this redundant at best.
  274. dnl For now keep it in case anyone actually used it in the past.
  275. AC_MSG_CHECKING([for wxWidgets static library])
  276. WX_LIBS_STATIC=`$WX_CONFIG_WITH_ARGS --static --libs $4 2>/dev/null`
  277. if test "x$WX_LIBS_STATIC" = "x"; then
  278. AC_MSG_RESULT(no)
  279. else
  280. AC_MSG_RESULT(yes)
  281. fi
  282. dnl starting with version 2.2.6 wx-config has --cppflags argument
  283. wx_has_cppflags=""
  284. if test $wx_config_major_version -gt 2; then
  285. wx_has_cppflags=yes
  286. else
  287. if test $wx_config_major_version -eq 2; then
  288. if test $wx_config_minor_version -gt 2; then
  289. wx_has_cppflags=yes
  290. else
  291. if test $wx_config_minor_version -eq 2; then
  292. if test $wx_config_micro_version -ge 6; then
  293. wx_has_cppflags=yes
  294. fi
  295. fi
  296. fi
  297. fi
  298. fi
  299. dnl starting with version 2.7.0 wx-config has --rescomp option
  300. wx_has_rescomp=""
  301. if test $wx_config_major_version -gt 2; then
  302. wx_has_rescomp=yes
  303. else
  304. if test $wx_config_major_version -eq 2; then
  305. if test $wx_config_minor_version -ge 7; then
  306. wx_has_rescomp=yes
  307. fi
  308. fi
  309. fi
  310. if test "x$wx_has_rescomp" = x ; then
  311. dnl cannot give any useful info for resource compiler
  312. WX_RESCOMP=
  313. else
  314. WX_RESCOMP=`$WX_CONFIG_WITH_ARGS --rescomp`
  315. fi
  316. if test "x$wx_has_cppflags" = x ; then
  317. dnl no choice but to define all flags like CFLAGS
  318. WX_CFLAGS=`$WX_CONFIG_WITH_ARGS --cflags $4`
  319. WX_CPPFLAGS=$WX_CFLAGS
  320. WX_CXXFLAGS=$WX_CFLAGS
  321. WX_CFLAGS_ONLY=$WX_CFLAGS
  322. WX_CXXFLAGS_ONLY=$WX_CFLAGS
  323. else
  324. dnl we have CPPFLAGS included in CFLAGS included in CXXFLAGS
  325. WX_CPPFLAGS=`$WX_CONFIG_WITH_ARGS --cppflags $4`
  326. WX_CXXFLAGS=`$WX_CONFIG_WITH_ARGS --cxxflags $4`
  327. WX_CFLAGS=`$WX_CONFIG_WITH_ARGS --cflags $4`
  328. WX_CFLAGS_ONLY=`echo $WX_CFLAGS | sed "s@^$WX_CPPFLAGS *@@"`
  329. WX_CXXFLAGS_ONLY=`echo $WX_CXXFLAGS | sed "s@^$WX_CFLAGS *@@"`
  330. fi
  331. ifelse([$2], , :, [$2])
  332. else
  333. if test "x$WX_VERSION" = x; then
  334. dnl no wx-config at all
  335. AC_MSG_RESULT(no)
  336. else
  337. AC_MSG_RESULT(no (version $WX_VERSION is not new enough))
  338. fi
  339. WX_CFLAGS=""
  340. WX_CPPFLAGS=""
  341. WX_CXXFLAGS=""
  342. WX_LIBS=""
  343. WX_LIBS_STATIC=""
  344. WX_RESCOMP=""
  345. if test ! -z "$5"; then
  346. wx_error_message="
  347. The configuration you asked for $PACKAGE_NAME requires a wxWidgets
  348. build with the following settings:
  349. $5
  350. but such build is not available.
  351. To see the wxWidgets builds available on this system, please use
  352. 'wx-config --list' command. To use the default build, returned by
  353. 'wx-config --selected-config', use the options with their 'auto'
  354. default values."
  355. fi
  356. wx_error_message="
  357. The requested wxWidgets build couldn't be found.
  358. $wx_error_message
  359. If you still get this error, then check that 'wx-config' is
  360. in path, the directory where wxWidgets libraries are installed
  361. (returned by 'wx-config --libs' command) is in LD_LIBRARY_PATH
  362. or equivalent variable and wxWidgets version is $1 or above."
  363. ifelse([$3], , AC_MSG_ERROR([$wx_error_message]), [$3])
  364. fi
  365. else
  366. WX_CFLAGS=""
  367. WX_CPPFLAGS=""
  368. WX_CXXFLAGS=""
  369. WX_LIBS=""
  370. WX_LIBS_STATIC=""
  371. WX_RESCOMP=""
  372. ifelse([$3], , :, [$3])
  373. fi
  374. AC_SUBST(WX_CPPFLAGS)
  375. AC_SUBST(WX_CFLAGS)
  376. AC_SUBST(WX_CXXFLAGS)
  377. AC_SUBST(WX_CFLAGS_ONLY)
  378. AC_SUBST(WX_CXXFLAGS_ONLY)
  379. AC_SUBST(WX_LIBS)
  380. AC_SUBST(WX_LIBS_STATIC)
  381. AC_SUBST(WX_VERSION)
  382. AC_SUBST(WX_RESCOMP)
  383. dnl need to export also WX_VERSION_MINOR and WX_VERSION_MAJOR symbols
  384. dnl to support wxpresets bakefiles (we export also WX_VERSION_MICRO for completeness):
  385. WX_VERSION_MAJOR="$wx_config_major_version"
  386. WX_VERSION_MINOR="$wx_config_minor_version"
  387. WX_VERSION_MICRO="$wx_config_micro_version"
  388. AC_SUBST(WX_VERSION_MAJOR)
  389. AC_SUBST(WX_VERSION_MINOR)
  390. AC_SUBST(WX_VERSION_MICRO)
  391. ])
  392. dnl ---------------------------------------------------------------------------
  393. dnl Get information on the wxrc program for making C++, Python and xrs
  394. dnl resource files.
  395. dnl
  396. dnl AC_ARG_ENABLE(...)
  397. dnl AC_ARG_WITH(...)
  398. dnl ...
  399. dnl WX_CONFIG_OPTIONS
  400. dnl ...
  401. dnl WX_CONFIG_CHECK(2.6.0, wxWin=1)
  402. dnl if test "$wxWin" != 1; then
  403. dnl AC_MSG_ERROR([
  404. dnl wxWidgets must be installed on your system
  405. dnl but wx-config script couldn't be found.
  406. dnl
  407. dnl Please check that wx-config is in path, the directory
  408. dnl where wxWidgets libraries are installed (returned by
  409. dnl 'wx-config --libs' command) is in LD_LIBRARY_PATH or
  410. dnl equivalent variable and wxWidgets version is 2.6.0 or above.
  411. dnl ])
  412. dnl fi
  413. dnl
  414. dnl WXRC_CHECK([HAVE_WXRC=1], [HAVE_WXRC=0])
  415. dnl if test "x$HAVE_WXRC" != x1; then
  416. dnl AC_MSG_ERROR([
  417. dnl The wxrc program was not installed or not found.
  418. dnl
  419. dnl Please check the wxWidgets installation.
  420. dnl ])
  421. dnl fi
  422. dnl
  423. dnl CPPFLAGS="$CPPFLAGS $WX_CPPFLAGS"
  424. dnl CXXFLAGS="$CXXFLAGS $WX_CXXFLAGS_ONLY"
  425. dnl CFLAGS="$CFLAGS $WX_CFLAGS_ONLY"
  426. dnl
  427. dnl LDFLAGS="$LDFLAGS $WX_LIBS"
  428. dnl ---------------------------------------------------------------------------
  429. dnl ---------------------------------------------------------------------------
  430. dnl WXRC_CHECK([ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]])
  431. dnl
  432. dnl Test for wxWidgets' wxrc program for creating either C++, Python or XRS
  433. dnl resources. The variable WXRC will be set and substituted in the configure
  434. dnl script and Makefiles.
  435. dnl
  436. dnl Example use:
  437. dnl WXRC_CHECK([wxrc=1], [wxrc=0])
  438. dnl ---------------------------------------------------------------------------
  439. dnl
  440. dnl wxrc program from the wx-config script
  441. dnl
  442. AC_DEFUN([WXRC_CHECK],
  443. [
  444. AC_ARG_VAR([WXRC], [Path to wxWidget's wxrc resource compiler])
  445. if test "x$WX_CONFIG_NAME" = x; then
  446. AC_MSG_ERROR([The wxrc tests must run after wxWidgets test.])
  447. else
  448. AC_MSG_CHECKING([for wxrc])
  449. if test "x$WXRC" = x ; then
  450. dnl wx-config --utility is a new addition to wxWidgets:
  451. _WX_PRIVATE_CHECK_VERSION(2,5,3)
  452. if test -n "$wx_ver_ok"; then
  453. WXRC=`$WX_CONFIG_WITH_ARGS --utility=wxrc`
  454. fi
  455. fi
  456. if test "x$WXRC" = x ; then
  457. AC_MSG_RESULT([not found])
  458. ifelse([$2], , :, [$2])
  459. else
  460. AC_MSG_RESULT([$WXRC])
  461. ifelse([$1], , :, [$1])
  462. fi
  463. AC_SUBST(WXRC)
  464. fi
  465. ])
  466. dnl ---------------------------------------------------------------------------
  467. dnl WX_LIKE_LIBNAME([output-var] [prefix], [name])
  468. dnl
  469. dnl Sets the "output-var" variable to the name of a library named with same
  470. dnl wxWidgets rule.
  471. dnl E.g. for output-var=='lib', name=='test', prefix='mine', sets
  472. dnl the $lib variable to:
  473. dnl 'mine_gtk2ud_test-2.8'
  474. dnl if WX_PORT=gtk2, WX_UNICODE=1, WX_DEBUG=1 and WX_RELEASE=28
  475. dnl ---------------------------------------------------------------------------
  476. AC_DEFUN([WX_LIKE_LIBNAME],
  477. [
  478. wx_temp="$2""_""$WX_PORT"
  479. dnl add the [u][d] string
  480. if test "$WX_UNICODE" = "1"; then
  481. wx_temp="$wx_temp""u"
  482. fi
  483. if test "$WX_DEBUG" = "1"; then
  484. wx_temp="$wx_temp""d"
  485. fi
  486. dnl complete the name of the lib
  487. wx_temp="$wx_temp""_""$3""-$WX_VERSION_MAJOR.$WX_VERSION_MINOR"
  488. dnl save it in the user's variable
  489. $1=$wx_temp
  490. ])
  491. dnl ---------------------------------------------------------------------------
  492. dnl WX_ARG_ENABLE_YESNOAUTO/WX_ARG_WITH_YESNOAUTO
  493. dnl
  494. dnl Two little custom macros which define the ENABLE/WITH configure arguments.
  495. dnl Macro arguments:
  496. dnl $1 = the name of the --enable / --with feature
  497. dnl $2 = the name of the variable associated
  498. dnl $3 = the description of that feature
  499. dnl $4 = the default value for that feature
  500. dnl $5 = additional action to do in case option is given with "yes" value
  501. dnl ---------------------------------------------------------------------------
  502. AC_DEFUN([WX_ARG_ENABLE_YESNOAUTO],
  503. [AC_ARG_ENABLE($1,
  504. AC_HELP_STRING([--enable-$1], [$3 (default is $4)]),
  505. [], [enableval="$4"])
  506. dnl Show a message to the user about this option
  507. AC_MSG_CHECKING([for the --enable-$1 option])
  508. if test "$enableval" = "yes" ; then
  509. AC_MSG_RESULT([yes])
  510. $2=1
  511. $5
  512. elif test "$enableval" = "no" ; then
  513. AC_MSG_RESULT([no])
  514. $2=0
  515. elif test "$enableval" = "auto" ; then
  516. AC_MSG_RESULT([will be automatically detected])
  517. $2="auto"
  518. else
  519. AC_MSG_ERROR([
  520. Unrecognized option value (allowed values: yes, no, auto)
  521. ])
  522. fi
  523. ])
  524. AC_DEFUN([WX_ARG_WITH_YESNOAUTO],
  525. [AC_ARG_WITH($1,
  526. AC_HELP_STRING([--with-$1], [$3 (default is $4)]),
  527. [], [withval="$4"])
  528. dnl Show a message to the user about this option
  529. AC_MSG_CHECKING([for the --with-$1 option])
  530. if test "$withval" = "yes" ; then
  531. AC_MSG_RESULT([yes])
  532. $2=1
  533. $5
  534. dnl NB: by default we don't allow --with-$1=no option
  535. dnl since it does not make much sense !
  536. elif test "$6" = "1" -a "$withval" = "no" ; then
  537. AC_MSG_RESULT([no])
  538. $2=0
  539. elif test "$withval" = "auto" ; then
  540. AC_MSG_RESULT([will be automatically detected])
  541. $2="auto"
  542. else
  543. AC_MSG_ERROR([
  544. Unrecognized option value (allowed values: yes, auto)
  545. ])
  546. fi
  547. ])
  548. dnl ---------------------------------------------------------------------------
  549. dnl WX_STANDARD_OPTIONS([options-to-add])
  550. dnl
  551. dnl Adds to the configure script one or more of the following options:
  552. dnl --enable-[debug|unicode|shared|wxshared|wxdebug]
  553. dnl --with-[gtk|msw|motif|x11|mac|dfb]
  554. dnl --with-wxversion
  555. dnl Then checks for their presence and eventually set the DEBUG, UNICODE, SHARED,
  556. dnl PORT, WX_SHARED, WX_DEBUG, variables to one of the "yes", "no", "auto" values.
  557. dnl
  558. dnl Note that e.g. UNICODE != WX_UNICODE; the first is the value of the
  559. dnl --enable-unicode option (in boolean format) while the second indicates
  560. dnl if wxWidgets was built in Unicode mode (and still is in boolean format).
  561. dnl ---------------------------------------------------------------------------
  562. AC_DEFUN([WX_STANDARD_OPTIONS],
  563. [
  564. dnl the following lines will expand to WX_ARG_ENABLE_YESNOAUTO calls if and only if
  565. dnl the $1 argument contains respectively the debug,unicode or shared options.
  566. dnl be careful here not to set debug flag if only "wxdebug" was specified
  567. ifelse(regexp([$1], [\bdebug]), [-1],,
  568. [WX_ARG_ENABLE_YESNOAUTO([debug], [DEBUG], [Build in debug mode], [auto])])
  569. ifelse(index([$1], [unicode]), [-1],,
  570. [WX_ARG_ENABLE_YESNOAUTO([unicode], [UNICODE], [Build in Unicode mode], [auto])])
  571. ifelse(regexp([$1], [\bshared]), [-1],,
  572. [WX_ARG_ENABLE_YESNOAUTO([shared], [SHARED], [Build as shared library], [auto])])
  573. dnl WX_ARG_WITH_YESNOAUTO cannot be used for --with-toolkit since it's an option
  574. dnl which must be able to accept the auto|gtk1|gtk2|msw|... values
  575. ifelse(index([$1], [toolkit]), [-1],,
  576. [
  577. AC_ARG_WITH([toolkit],
  578. AC_HELP_STRING([--with-toolkit],
  579. [Build against a specific wxWidgets toolkit (default is auto)]),
  580. [], [withval="auto"])
  581. dnl Show a message to the user about this option
  582. AC_MSG_CHECKING([for the --with-toolkit option])
  583. if test "$withval" = "auto" ; then
  584. AC_MSG_RESULT([will be automatically detected])
  585. TOOLKIT="auto"
  586. else
  587. TOOLKIT="$withval"
  588. dnl PORT must be one of the allowed values
  589. if test "$TOOLKIT" != "gtk1" -a "$TOOLKIT" != "gtk2" -a \
  590. "$TOOLKIT" != "msw" -a "$TOOLKIT" != "motif" -a \
  591. "$TOOLKIT" != "osx_carbon" -a "$TOOLKIT" != "osx_cocoa" -a \
  592. "$TOOLKIT" != "dfb" -a "$TOOLKIT" != "x11"; then
  593. AC_MSG_ERROR([
  594. Unrecognized option value (allowed values: auto, gtk1, gtk2, msw, motif, osx_carbon, osx_cocoa, dfb, x11)
  595. ])
  596. fi
  597. AC_MSG_RESULT([$TOOLKIT])
  598. fi
  599. ])
  600. dnl ****** IMPORTANT *******
  601. dnl Unlike for the UNICODE setting, you can build your program in
  602. dnl shared mode against a static build of wxWidgets. Thus we have the
  603. dnl following option which allows these mixtures. E.g.
  604. dnl
  605. dnl ./configure --disable-shared --with-wxshared
  606. dnl
  607. dnl will build your library in static mode against the first available
  608. dnl shared build of wxWidgets.
  609. dnl
  610. dnl Note that's not possible to do the viceversa:
  611. dnl
  612. dnl ./configure --enable-shared --without-wxshared
  613. dnl
  614. dnl Doing so you would try to build your library in shared mode against a static
  615. dnl build of wxWidgets. This is not possible (you would mix PIC and non PIC code) !
  616. dnl A check for this combination of options is in WX_DETECT_STANDARD_OPTION_VALUES
  617. dnl (where we know what 'auto' should be expanded to).
  618. dnl
  619. dnl If you try to build something in ANSI mode against a UNICODE build
  620. dnl of wxWidgets or in RELEASE mode against a DEBUG build of wxWidgets,
  621. dnl then at best you'll get ton of linking errors !
  622. dnl ************************
  623. ifelse(index([$1], [wxshared]), [-1],,
  624. [
  625. WX_ARG_WITH_YESNOAUTO(
  626. [wxshared], [WX_SHARED],
  627. [Force building against a shared build of wxWidgets, even if --disable-shared is given],
  628. [auto], [], [1])
  629. ])
  630. dnl Just like for SHARED and WX_SHARED it may happen that some adventurous
  631. dnl peoples will want to mix a wxWidgets release build with a debug build of
  632. dnl his app/lib. So, we have both DEBUG and WX_DEBUG variables.
  633. ifelse(index([$1], [wxdebug]), [-1],,
  634. [
  635. WX_ARG_WITH_YESNOAUTO(
  636. [wxdebug], [WX_DEBUG],
  637. [Force building against a debug build of wxWidgets, even if --disable-debug is given],
  638. [auto], [], [1])
  639. ])
  640. dnl WX_ARG_WITH_YESNOAUTO cannot be used for --with-wxversion since it's an option
  641. dnl which accepts the "auto|2.6|2.7|2.8|2.9|3.0" etc etc values
  642. ifelse(index([$1], [wxversion]), [-1],,
  643. [
  644. AC_ARG_WITH([wxversion],
  645. AC_HELP_STRING([--with-wxversion],
  646. [Build against a specific version of wxWidgets (default is auto)]),
  647. [], [withval="auto"])
  648. dnl Show a message to the user about this option
  649. AC_MSG_CHECKING([for the --with-wxversion option])
  650. if test "$withval" = "auto" ; then
  651. AC_MSG_RESULT([will be automatically detected])
  652. WX_RELEASE="auto"
  653. else
  654. wx_requested_major_version=`echo $withval | \
  655. sed 's/\([[0-9]]*\).\([[0-9]]*\).*/\1/'`
  656. wx_requested_minor_version=`echo $withval | \
  657. sed 's/\([[0-9]]*\).\([[0-9]]*\).*/\2/'`
  658. dnl both vars above must be exactly 1 digit
  659. if test "${#wx_requested_major_version}" != "1" -o \
  660. "${#wx_requested_minor_version}" != "1" ; then
  661. AC_MSG_ERROR([
  662. Unrecognized option value (allowed values: auto, 2.6, 2.7, 2.8, 2.9, 3.0)
  663. ])
  664. fi
  665. WX_RELEASE="$wx_requested_major_version"".""$wx_requested_minor_version"
  666. AC_MSG_RESULT([$WX_RELEASE])
  667. fi
  668. ])
  669. if test "$WX_DEBUG_CONFIGURE" = "1"; then
  670. echo "[[dbg]] DEBUG: $DEBUG, WX_DEBUG: $WX_DEBUG"
  671. echo "[[dbg]] UNICODE: $UNICODE, WX_UNICODE: $WX_UNICODE"
  672. echo "[[dbg]] SHARED: $SHARED, WX_SHARED: $WX_SHARED"
  673. echo "[[dbg]] TOOLKIT: $TOOLKIT, WX_TOOLKIT: $WX_TOOLKIT"
  674. echo "[[dbg]] VERSION: $VERSION, WX_RELEASE: $WX_RELEASE"
  675. fi
  676. ])
  677. dnl ---------------------------------------------------------------------------
  678. dnl WX_CONVERT_STANDARD_OPTIONS_TO_WXCONFIG_FLAGS
  679. dnl
  680. dnl Sets the WXCONFIG_FLAGS string using the SHARED,DEBUG,UNICODE variable values
  681. dnl which are different from "auto".
  682. dnl Thus this macro needs to be called only once all options have been set.
  683. dnl ---------------------------------------------------------------------------
  684. AC_DEFUN([WX_CONVERT_STANDARD_OPTIONS_TO_WXCONFIG_FLAGS],
  685. [
  686. if test "$WX_SHARED" = "1" ; then
  687. WXCONFIG_FLAGS="--static=no "
  688. elif test "$WX_SHARED" = "0" ; then
  689. WXCONFIG_FLAGS="--static=yes "
  690. fi
  691. if test "$WX_DEBUG" = "1" ; then
  692. WXCONFIG_FLAGS="$WXCONFIG_FLAGS""--debug=yes "
  693. elif test "$WX_DEBUG" = "0" ; then
  694. WXCONFIG_FLAGS="$WXCONFIG_FLAGS""--debug=no "
  695. fi
  696. dnl The user should have set WX_UNICODE=UNICODE
  697. if test "$WX_UNICODE" = "1" ; then
  698. WXCONFIG_FLAGS="$WXCONFIG_FLAGS""--unicode=yes "
  699. elif test "$WX_UNICODE" = "0" ; then
  700. WXCONFIG_FLAGS="$WXCONFIG_FLAGS""--unicode=no "
  701. fi
  702. if test "$TOOLKIT" != "auto" ; then
  703. WXCONFIG_FLAGS="$WXCONFIG_FLAGS""--toolkit=$TOOLKIT "
  704. fi
  705. if test "$WX_RELEASE" != "auto" ; then
  706. WXCONFIG_FLAGS="$WXCONFIG_FLAGS""--version=$WX_RELEASE "
  707. fi
  708. dnl strip out the last space of the string
  709. WXCONFIG_FLAGS=${WXCONFIG_FLAGS% }
  710. if test "$WX_DEBUG_CONFIGURE" = "1"; then
  711. echo "[[dbg]] WXCONFIG_FLAGS: $WXCONFIG_FLAGS"
  712. fi
  713. ])
  714. dnl ---------------------------------------------------------------------------
  715. dnl _WX_SELECTEDCONFIG_CHECKFOR([RESULTVAR], [STRING], [MSG]
  716. dnl [, ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]])
  717. dnl
  718. dnl Outputs the given MSG. Then searches the given STRING in the wxWidgets
  719. dnl additional CPP flags and put the result of the search in WX_$RESULTVAR
  720. dnl also adding the "yes" or "no" message result to MSG.
  721. dnl ---------------------------------------------------------------------------
  722. AC_DEFUN([_WX_SELECTEDCONFIG_CHECKFOR],
  723. [
  724. if test "$$1" = "auto" ; then
  725. dnl The user does not have particular preferences for this option;
  726. dnl so we will detect the wxWidgets relative build setting and use it
  727. AC_MSG_CHECKING([$3])
  728. dnl set WX_$1 variable to 1 if the $WX_SELECTEDCONFIG contains the $2
  729. dnl string or to 0 otherwise.
  730. dnl NOTE: 'expr match STRING REGEXP' cannot be used since on Mac it
  731. dnl doesn't work; we use 'expr STRING : REGEXP' instead
  732. WX_$1=$(expr "$WX_SELECTEDCONFIG" : ".*$2.*")
  733. if test "$WX_$1" != "0"; then
  734. WX_$1=1
  735. AC_MSG_RESULT([yes])
  736. ifelse([$4], , :, [$4])
  737. else
  738. WX_$1=0
  739. AC_MSG_RESULT([no])
  740. ifelse([$5], , :, [$5])
  741. fi
  742. else
  743. dnl Use the setting given by the user
  744. WX_$1=$$1
  745. fi
  746. ])
  747. dnl ---------------------------------------------------------------------------
  748. dnl WX_DETECT_STANDARD_OPTION_VALUES
  749. dnl
  750. dnl Detects the values of the following variables:
  751. dnl 1) WX_RELEASE
  752. dnl 2) WX_UNICODE
  753. dnl 3) WX_DEBUG
  754. dnl 4) WX_SHARED (and also WX_STATIC)
  755. dnl 5) WX_PORT
  756. dnl from the previously selected wxWidgets build; this macro in fact must be
  757. dnl called *after* calling the WX_CONFIG_CHECK macro.
  758. dnl
  759. dnl Note that the WX_VERSION_MAJOR, WX_VERSION_MINOR symbols are already set
  760. dnl by WX_CONFIG_CHECK macro
  761. dnl ---------------------------------------------------------------------------
  762. AC_DEFUN([WX_DETECT_STANDARD_OPTION_VALUES],
  763. [
  764. dnl IMPORTANT: WX_VERSION contains all three major.minor.micro digits,
  765. dnl while WX_RELEASE only the major.minor ones.
  766. WX_RELEASE="$WX_VERSION_MAJOR""$WX_VERSION_MINOR"
  767. if test $WX_RELEASE -lt 26 ; then
  768. AC_MSG_ERROR([
  769. Cannot detect the wxWidgets configuration for the selected wxWidgets build
  770. since its version is $WX_VERSION < 2.6.0; please install a newer
  771. version of wxWidgets.
  772. ])
  773. fi
  774. dnl The wx-config we are using understands the "--selected_config"
  775. dnl option which returns an easy-parseable string !
  776. WX_SELECTEDCONFIG=$($WX_CONFIG_WITH_ARGS --selected_config)
  777. if test "$WX_DEBUG_CONFIGURE" = "1"; then
  778. echo "[[dbg]] Using wx-config --selected-config"
  779. echo "[[dbg]] WX_SELECTEDCONFIG: $WX_SELECTEDCONFIG"
  780. fi
  781. dnl we could test directly for WX_SHARED with a line like:
  782. dnl _WX_SELECTEDCONFIG_CHECKFOR([SHARED], [shared],
  783. dnl [if wxWidgets was built in SHARED mode])
  784. dnl but wx-config --selected-config DOES NOT outputs the 'shared'
  785. dnl word when wx was built in shared mode; it rather outputs the
  786. dnl 'static' word when built in static mode.
  787. if test $WX_SHARED = "1"; then
  788. STATIC=0
  789. elif test $WX_SHARED = "0"; then
  790. STATIC=1
  791. elif test $WX_SHARED = "auto"; then
  792. STATIC="auto"
  793. fi
  794. dnl Now set the WX_UNICODE, WX_DEBUG, WX_STATIC variables
  795. _WX_SELECTEDCONFIG_CHECKFOR([UNICODE], [unicode],
  796. [if wxWidgets was built with UNICODE enabled])
  797. _WX_SELECTEDCONFIG_CHECKFOR([DEBUG], [debug],
  798. [if wxWidgets was built in DEBUG mode])
  799. _WX_SELECTEDCONFIG_CHECKFOR([STATIC], [static],
  800. [if wxWidgets was built in STATIC mode])
  801. dnl init WX_SHARED from WX_STATIC
  802. if test "$WX_STATIC" != "0"; then
  803. WX_SHARED=0
  804. else
  805. WX_SHARED=1
  806. fi
  807. AC_SUBST(WX_UNICODE)
  808. AC_SUBST(WX_DEBUG)
  809. AC_SUBST(WX_SHARED)
  810. dnl detect the WX_PORT to use
  811. if test "$TOOLKIT" = "auto" ; then
  812. dnl The user does not have particular preferences for this option;
  813. dnl so we will detect the wxWidgets relative build setting and use it
  814. AC_MSG_CHECKING([which wxWidgets toolkit was selected])
  815. WX_GTKPORT1=$(expr "$WX_SELECTEDCONFIG" : ".*gtk1.*")
  816. WX_GTKPORT2=$(expr "$WX_SELECTEDCONFIG" : ".*gtk2.*")
  817. WX_MSWPORT=$(expr "$WX_SELECTEDCONFIG" : ".*msw.*")
  818. WX_MOTIFPORT=$(expr "$WX_SELECTEDCONFIG" : ".*motif.*")
  819. WX_OSXCOCOAPORT=$(expr "$WX_SELECTEDCONFIG" : ".*osx_cocoa.*")
  820. WX_OSXCARBONPORT=$(expr "$WX_SELECTEDCONFIG" : ".*osx_carbon.*")
  821. WX_X11PORT=$(expr "$WX_SELECTEDCONFIG" : ".*x11.*")
  822. WX_DFBPORT=$(expr "$WX_SELECTEDCONFIG" : ".*dfb.*")
  823. WX_PORT="unknown"
  824. if test "$WX_GTKPORT1" != "0"; then WX_PORT="gtk1"; fi
  825. if test "$WX_GTKPORT2" != "0"; then WX_PORT="gtk2"; fi
  826. if test "$WX_MSWPORT" != "0"; then WX_PORT="msw"; fi
  827. if test "$WX_MOTIFPORT" != "0"; then WX_PORT="motif"; fi
  828. if test "$WX_OSXCOCOAPORT" != "0"; then WX_PORT="osx_cocoa"; fi
  829. if test "$WX_OSXCARBONPORT" != "0"; then WX_PORT="osx_carbon"; fi
  830. if test "$WX_X11PORT" != "0"; then WX_PORT="x11"; fi
  831. if test "$WX_DFBPORT" != "0"; then WX_PORT="dfb"; fi
  832. dnl NOTE: backward-compatible check for wx2.8; in wx2.9 the mac
  833. dnl ports are called 'osx_cocoa' and 'osx_carbon' (see above)
  834. WX_MACPORT=$(expr "$WX_SELECTEDCONFIG" : ".*mac.*")
  835. if test "$WX_MACPORT" != "0"; then WX_PORT="mac"; fi
  836. dnl check at least one of the WX_*PORT has been set !
  837. if test "$WX_PORT" = "unknown" ; then
  838. AC_MSG_ERROR([
  839. Cannot detect the currently installed wxWidgets port !
  840. Please check your 'wx-config --cxxflags'...
  841. ])
  842. fi
  843. AC_MSG_RESULT([$WX_PORT])
  844. else
  845. dnl Use the setting given by the user
  846. if test -z "$TOOLKIT" ; then
  847. WX_PORT=$TOOLKIT
  848. else
  849. dnl try with PORT
  850. WX_PORT=$PORT
  851. fi
  852. fi
  853. AC_SUBST(WX_PORT)
  854. if test "$WX_DEBUG_CONFIGURE" = "1"; then
  855. echo "[[dbg]] Values of all WX_* options after final detection:"
  856. echo "[[dbg]] WX_DEBUG: $WX_DEBUG"
  857. echo "[[dbg]] WX_UNICODE: $WX_UNICODE"
  858. echo "[[dbg]] WX_SHARED: $WX_SHARED"
  859. echo "[[dbg]] WX_RELEASE: $WX_RELEASE"
  860. echo "[[dbg]] WX_PORT: $WX_PORT"
  861. fi
  862. dnl Avoid problem described in the WX_STANDARD_OPTIONS which happens when
  863. dnl the user gives the options:
  864. dnl ./configure --enable-shared --without-wxshared
  865. dnl or just do
  866. dnl ./configure --enable-shared
  867. dnl but there is only a static build of wxWidgets available.
  868. if test "$WX_SHARED" = "0" -a "$SHARED" = "1"; then
  869. AC_MSG_ERROR([
  870. Cannot build shared library against a static build of wxWidgets !
  871. This error happens because the wxWidgets build which was selected
  872. has been detected as static while you asked to build $PACKAGE_NAME
  873. as shared library and this is not possible.
  874. Use the '--disable-shared' option to build $PACKAGE_NAME
  875. as static library or '--with-wxshared' to use wxWidgets as shared library.
  876. ])
  877. fi
  878. dnl now we can finally update the DEBUG,UNICODE,SHARED options
  879. dnl to their final values if they were set to 'auto'
  880. if test "$DEBUG" = "auto"; then
  881. DEBUG=$WX_DEBUG
  882. fi
  883. if test "$UNICODE" = "auto"; then
  884. UNICODE=$WX_UNICODE
  885. fi
  886. if test "$SHARED" = "auto"; then
  887. SHARED=$WX_SHARED
  888. fi
  889. if test "$TOOLKIT" = "auto"; then
  890. TOOLKIT=$WX_PORT
  891. fi
  892. dnl in case the user needs a BUILD=debug/release var...
  893. if test "$DEBUG" = "1"; then
  894. BUILD="debug"
  895. elif test "$DEBUG" = "0" -o "$DEBUG" = ""; then
  896. BUILD="release"
  897. fi
  898. dnl respect the DEBUG variable adding the optimize/debug flags
  899. dnl NOTE: the CXXFLAGS are merged together with the CPPFLAGS so we
  900. dnl don't need to set them, too
  901. if test "$DEBUG" = "1"; then
  902. CXXFLAGS="$CXXFLAGS -g -O0"
  903. CFLAGS="$CFLAGS -g -O0"
  904. else
  905. CXXFLAGS="$CXXFLAGS -O2"
  906. CFLAGS="$CFLAGS -O2"
  907. fi
  908. ])
  909. dnl ---------------------------------------------------------------------------
  910. dnl WX_BOOLOPT_SUMMARY([name of the boolean variable to show summary for],
  911. dnl [what to print when var is 1],
  912. dnl [what to print when var is 0])
  913. dnl
  914. dnl Prints $2 when variable $1 == 1 and prints $3 when variable $1 == 0.
  915. dnl This macro mainly exists just to make configure.ac scripts more readable.
  916. dnl
  917. dnl NOTE: you need to use the [" my message"] syntax for 2nd and 3rd arguments
  918. dnl if you want that m4 avoid to throw away the spaces prefixed to the
  919. dnl argument value.
  920. dnl ---------------------------------------------------------------------------
  921. AC_DEFUN([WX_BOOLOPT_SUMMARY],
  922. [
  923. if test "x$$1" = "x1" ; then
  924. echo $2
  925. elif test "x$$1" = "x0" ; then
  926. echo $3
  927. else
  928. echo "$1 is $$1"
  929. fi
  930. ])
  931. dnl ---------------------------------------------------------------------------
  932. dnl WX_STANDARD_OPTIONS_SUMMARY_MSG
  933. dnl
  934. dnl Shows a summary message to the user about the WX_* variable contents.
  935. dnl This macro is used typically at the end of the configure script.
  936. dnl ---------------------------------------------------------------------------
  937. AC_DEFUN([WX_STANDARD_OPTIONS_SUMMARY_MSG],
  938. [
  939. echo
  940. echo " The wxWidgets build which will be used by $PACKAGE_NAME $PACKAGE_VERSION"
  941. echo " has the following settings:"
  942. WX_BOOLOPT_SUMMARY([WX_DEBUG], [" - DEBUG build"], [" - RELEASE build"])
  943. WX_BOOLOPT_SUMMARY([WX_UNICODE], [" - UNICODE mode"], [" - ANSI mode"])
  944. WX_BOOLOPT_SUMMARY([WX_SHARED], [" - SHARED mode"], [" - STATIC mode"])
  945. echo " - VERSION: $WX_VERSION"
  946. echo " - PORT: $WX_PORT"
  947. ])
  948. dnl ---------------------------------------------------------------------------
  949. dnl WX_STANDARD_OPTIONS_SUMMARY_MSG_BEGIN, WX_STANDARD_OPTIONS_SUMMARY_MSG_END
  950. dnl
  951. dnl Like WX_STANDARD_OPTIONS_SUMMARY_MSG macro but these two macros also gives info
  952. dnl about the configuration of the package which used the wxpresets.
  953. dnl
  954. dnl Typical usage:
  955. dnl WX_STANDARD_OPTIONS_SUMMARY_MSG_BEGIN
  956. dnl echo " - Package setting 1: $SETTING1"
  957. dnl echo " - Package setting 2: $SETTING1"
  958. dnl ...
  959. dnl WX_STANDARD_OPTIONS_SUMMARY_MSG_END
  960. dnl
  961. dnl ---------------------------------------------------------------------------
  962. AC_DEFUN([WX_STANDARD_OPTIONS_SUMMARY_MSG_BEGIN],
  963. [
  964. echo
  965. echo " ----------------------------------------------------------------"
  966. echo " Configuration for $PACKAGE_NAME $PACKAGE_VERSION successfully completed."
  967. echo " Summary of main configuration settings for $PACKAGE_NAME:"
  968. WX_BOOLOPT_SUMMARY([DEBUG], [" - DEBUG build"], [" - RELEASE build"])
  969. WX_BOOLOPT_SUMMARY([UNICODE], [" - UNICODE mode"], [" - ANSI mode"])
  970. WX_BOOLOPT_SUMMARY([SHARED], [" - SHARED mode"], [" - STATIC mode"])
  971. ])
  972. AC_DEFUN([WX_STANDARD_OPTIONS_SUMMARY_MSG_END],
  973. [
  974. WX_STANDARD_OPTIONS_SUMMARY_MSG
  975. echo
  976. echo " Now, just run make."
  977. echo " ----------------------------------------------------------------"
  978. echo
  979. ])
  980. dnl ---------------------------------------------------------------------------
  981. dnl Deprecated macro wrappers
  982. dnl ---------------------------------------------------------------------------
  983. AC_DEFUN([AM_OPTIONS_WXCONFIG], [WX_CONFIG_OPTIONS])
  984. AC_DEFUN([AM_PATH_WXCONFIG], [
  985. WX_CONFIG_CHECK([$1],[$2],[$3],[$4],[$5])
  986. ])
  987. AC_DEFUN([AM_PATH_WXRC], [WXRC_CHECK([$1],[$2])])