KTechlab – circuit simulator for microcontrollers and electronics
Você não pode selecionar mais de 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.

configure.in 7.2KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264
  1. dnl =======================================================
  2. dnl FILE: ./admin/configure.in.min
  3. dnl =======================================================
  4. dnl This file is part of the KDE libraries/packages
  5. dnl Copyright (C) 2001 Stephan Kulow (coolo@kde.org)
  6. dnl This file is free software; you can redistribute it and/or
  7. dnl modify it under the terms of the GNU Library General Public
  8. dnl License as published by the Free Software Foundation; either
  9. dnl version 2 of the License, or (at your option) any later version.
  10. dnl This library is distributed in the hope that it will be useful,
  11. dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  13. dnl Library General Public License for more details.
  14. dnl You should have received a copy of the GNU Library General Public License
  15. dnl along with this library; see the file COPYING.LIB. If not, write to
  16. dnl the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
  17. dnl Boston, MA 02110-1301, USA.
  18. # Original Author was Kalle@kde.org
  19. # I lifted it in some mater. (Stephan Kulow)
  20. # I used much code from Janos Farkas
  21. dnl Process this file with autoconf to produce a configure script.
  22. AC_INIT(acinclude.m4) dnl a source file from your sub dir
  23. dnl This is so we can use kde-common
  24. AC_CONFIG_AUX_DIR(admin)
  25. dnl This ksh/zsh feature conflicts with `cd blah ; pwd`
  26. unset CDPATH
  27. dnl Checking host/target/build systems, for make, install etc.
  28. AC_CANONICAL_SYSTEM
  29. dnl Perform program name transformation
  30. AC_ARG_PROGRAM
  31. dnl Automake doc recommends to do this only here. (Janos)
  32. AM_INIT_AUTOMAKE(ktechlab, 0.3) dnl searches for some needed programs
  33. KDE_SET_PREFIX
  34. dnl generate the config header
  35. AM_CONFIG_HEADER(config.h) dnl at the distribution this done
  36. dnl Checks for programs.
  37. AC_CHECK_COMPILERS
  38. AC_ENABLE_SHARED(yes)
  39. AC_ENABLE_STATIC(no)
  40. KDE_PROG_LIBTOOL
  41. dnl for NLS support. Call them in this order!
  42. dnl WITH_NLS is for the po files
  43. AM_KDE_WITH_NLS
  44. KDE_USE_TQT(3.2.0)
  45. AC_PATH_KDE
  46. dnl =======================================================
  47. dnl FILE: configure.in.in
  48. dnl =======================================================
  49. #MIN_CONFIG(3.2.0)
  50. dnl PACKAGE set before
  51. AC_C_BIGENDIAN
  52. AC_CHECK_KDEMAXPATHLEN
  53. ################################
  54. ## BEGIN Check for gpsim 0.21 ##
  55. ################################
  56. AC_LANG_SAVE
  57. AC_LANG_CPLUSPLUS
  58. ktechlab_save_CXXFLAGS="$CXXFLAGS"
  59. AC_ARG_WITH(glib12, [ --with-glib12 force using glib 1.2.x [default=no]])
  60. if test "x$with_glib12" != "xyes" ; then
  61. glib_cflags=`pkg-config --cflags glib-2.0`
  62. else
  63. glib_cflags=`glib-config --cflags`
  64. fi
  65. AC_SUBST(glib_cflags)
  66. CXXFLAGS="$glib_cflags"
  67. AC_MSG_CHECKING([for gpsim 0.21.4 availability])
  68. AC_TRY_COMPILE(
  69. [
  70. #include <gpsim/interface.h>
  71. #include <gpsim/gpsim_interface.h>
  72. #include <gpsim/breakpoints.h>
  73. #include <gpsim/gpsim_time.h>
  74. void func() { (void)cycles; (void)initialize_gpsim_core(); (void)load_symbol_file(0,0); }
  75. ],
  76. [],
  77. AC_MSG_RESULT( yes )
  78. have_gpsim_0_21_4=yes,
  79. AC_MSG_RESULT( no )
  80. )
  81. AC_MSG_CHECKING([for gpsim 0.21.11 availability])
  82. AC_TRY_COMPILE(
  83. [
  84. #include <gpsim/interface.h>
  85. #include <gpsim/gpsim_interface.h>
  86. #include <gpsim/breakpoints.h>
  87. #include <gpsim/gpsim_time.h>
  88. #include <gpsim/symbol.h>
  89. #include <gpsim/program_files.h>
  90. void func() { (void)cycles; (void)initialize_gpsim_core(); }
  91. ],
  92. [],
  93. AC_MSG_RESULT( yes )
  94. have_gpsim_0_21_11=yes,
  95. AC_MSG_RESULT( no )
  96. )
  97. AC_MSG_CHECKING([for gpsim 0.21.12 availability])
  98. AC_TRY_COMPILE(
  99. [
  100. #include <gpsim/ValueCollections.h>
  101. ],
  102. [],
  103. AC_MSG_RESULT( yes )
  104. have_gpsim_0_21_12=yes,
  105. AC_MSG_RESULT( no )
  106. )
  107. AC_MSG_CHECKING([for gpsim 0.27.0 availability])
  108. AC_TRY_COMPILE(
  109. [
  110. #include <gpsim/pic-processor.h>
  111. void func() { pic_processor *Processor; sizeof(Processor->Wreg); }
  112. ],
  113. [],
  114. AC_MSG_RESULT( yes )
  115. have_gpsim_0_27_0=yes,
  116. AC_MSG_RESULT( no )
  117. )
  118. CXXFLAGS="$ktechlab_save_CXXFLAGS"
  119. AC_LANG_RESTORE
  120. ##############################
  121. ## END Check for gpsim 0.21 ##
  122. ##############################
  123. ################################
  124. ## BEGIN DO_NOT_COMPILE CHECK ##
  125. ################################
  126. if test x$have_gpsim_0_21_12 == xyes; then
  127. AC_DEFINE([GPSIM_0_21_12],[],[Gpsim 0.21.12 was found])
  128. CXXFLAGS="$CXXFLAGS $USE_EXCEPTIONS"
  129. else
  130. if test x$have_gpsim_0_21_4 != xyes; then
  131. if test x$have_gpsim_0_21_11 != xyes; then
  132. AC_DEFINE([NO_GPSIM],[],[Gpsim was not found])
  133. LIB_GPSIM=""
  134. else
  135. AC_DEFINE([GPSIM_0_21_11],[],[Gpsim 0.21.11 was found])
  136. fi
  137. else
  138. AC_DEFINE([GPSIM_0_21_4],[],[Gpsim 0.21.4 was found])
  139. fi
  140. fi
  141. if test x$have_gpsim_0_21_4 == xyes || test x$have_gpsim_0_21_11 == xyes || test x$have_gpsim_0_21_12 == xyes; then
  142. wi_cv_lib_readline=no
  143. ac_save_LIBS="$LIBS"
  144. # Note: $LIBCURSES is permitted to be empty.
  145. for LIBREADLINE in "-lreadline" "-lreadline $LIBCURSES" "-lreadline -ltermcap" "-lreadline -lncurses" "-lreadline -lcurses"
  146. do
  147. LIBS="$ac_save_LIBS $LIBREADLINE"
  148. LIB_GPSIM="$LIBREADLINE -lgpsim -lgpsim_eXdbm -lgpsimcli -lgpsimgui"
  149. AC_TRY_RUN([
  150. /* program */
  151. #include <stdio.h>
  152. #include <stdlib.h>
  153. main(int argc, char **argv)
  154. {
  155. /* Note: don't actually call readline, since it may block;
  156. * We just want to see if it (dynamic) linked in okay.
  157. */
  158. if (argc == 0) /* never true */
  159. readline(0);
  160. exit(0);
  161. }
  162. ],[
  163. # action if true
  164. wi_cv_lib_readline=yes
  165. ],[
  166. # action if false
  167. wi_cv_lib_readline=no
  168. ],[
  169. # action if cross compiling
  170. wi_cv_lib_readline=no
  171. ])
  172. if test "$wi_cv_lib_readline" = yes ; then break ; fi
  173. done
  174. LIBS="$ac_save_LIBS"
  175. fi
  176. if test x$have_gpsim_0_27_0 == xyes; then
  177. AC_DEFINE([GPSIM_0_27_0],[],[Gpsim 0.27.0 was found])
  178. fi
  179. AC_SUBST(LIB_GPSIM)
  180. ##############################
  181. ## END DO_NOT_COMPILE CHECK ##
  182. ##############################
  183. KDE_CREATE_SUBDIRSLIST
  184. AC_CONFIG_FILES([ Makefile ])
  185. AC_CONFIG_FILES([ doc/Makefile ])
  186. AC_CONFIG_FILES([ doc/en/Makefile ])
  187. AC_CONFIG_FILES([ icons/Makefile ])
  188. AC_CONFIG_FILES([ icons/pics/Makefile ])
  189. AC_CONFIG_FILES([ microbe/Makefile ])
  190. AC_CONFIG_FILES([ po/Makefile ])
  191. AC_CONFIG_FILES([ src/Makefile ])
  192. AC_CONFIG_FILES([ src/core/Makefile ])
  193. AC_CONFIG_FILES([ src/drawparts/Makefile ])
  194. AC_CONFIG_FILES([ src/electronics/Makefile ])
  195. AC_CONFIG_FILES([ src/electronics/components/Makefile ])
  196. AC_CONFIG_FILES([ src/electronics/simulation/Makefile ])
  197. AC_CONFIG_FILES([ src/flowparts/Makefile ])
  198. AC_CONFIG_FILES([ src/gui/Makefile ])
  199. AC_CONFIG_FILES([ src/languages/Makefile ])
  200. AC_CONFIG_FILES([ src/mechanics/Makefile ])
  201. AC_CONFIG_FILES([ src/micro/Makefile ])
  202. AC_OUTPUT
  203. if test x$have_gpsim_0_21_4 != xyes; then
  204. if test x$have_gpsim_0_21_11 != xyes; then
  205. echo ""
  206. echo "################################################################################"
  207. echo "# WARNING: gpsim support will not be compiled as gpsim >= 0.21.4 was not found #"
  208. echo "################################################################################"
  209. fi
  210. fi
  211. if test "$all_tests" = "bad"; then
  212. if test ! "$cache_file" = "/dev/null"; then
  213. echo ""
  214. echo "Please remove the file $cache_file after changing your setup"
  215. echo "so that configure will find the changes next time."
  216. echo ""
  217. fi
  218. else
  219. echo ""
  220. echo "Good - your configure finished. Start make now"
  221. echo ""
  222. fi