ktechlab
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

configure.in.in 3.6KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160
  1. #MIN_CONFIG(3.2.0)
  2. KDE_ENABLE_HIDDEN_VISIBILITY
  3. AM_INIT_AUTOMAKE(ktechlab, 0.3)
  4. AC_C_BIGENDIAN
  5. AC_CHECK_KDEMAXPATHLEN
  6. ################################
  7. ## BEGIN Check for gpsim 0.21 ##
  8. ################################
  9. AC_LANG_SAVE
  10. AC_LANG_CPLUSPLUS
  11. ktechlab_save_CXXFLAGS="$CXXFLAGS"
  12. AC_ARG_WITH(glib12, [ --with-glib12 force using glib 1.2.x [default=no]])
  13. if test "x$with_glib12" != "xyes" ; then
  14. glib_cflags=`pkg-config --cflags glib-2.0`
  15. else
  16. glib_cflags=`glib-config --cflags`
  17. fi
  18. AC_SUBST(glib_cflags)
  19. CXXFLAGS="$glib_cflags"
  20. AC_MSG_CHECKING([for gpsim 0.21.4 availability])
  21. AC_TRY_COMPILE(
  22. [
  23. #include <gpsim/interface.h>
  24. #include <gpsim/gpsim_interface.h>
  25. #include <gpsim/breakpoints.h>
  26. #include <gpsim/gpsim_time.h>
  27. void func() { (void)cycles; (void)initialize_gpsim_core(); (void)load_symbol_file(0,0); }
  28. ],
  29. [],
  30. AC_MSG_RESULT( yes )
  31. have_gpsim_0_21_4=yes,
  32. AC_MSG_RESULT( no )
  33. )
  34. AC_MSG_CHECKING([for gpsim 0.21.11 availability])
  35. AC_TRY_COMPILE(
  36. [
  37. #include <gpsim/interface.h>
  38. #include <gpsim/gpsim_interface.h>
  39. #include <gpsim/breakpoints.h>
  40. #include <gpsim/gpsim_time.h>
  41. #include <gpsim/symbol.h>
  42. #include <gpsim/program_files.h>
  43. void func() { (void)cycles; (void)initialize_gpsim_core(); }
  44. ],
  45. [],
  46. AC_MSG_RESULT( yes )
  47. have_gpsim_0_21_11=yes,
  48. AC_MSG_RESULT( no )
  49. )
  50. AC_MSG_CHECKING([for gpsim 0.21.12 availability])
  51. AC_TRY_COMPILE(
  52. [
  53. #include <gpsim/ValueCollections.h>
  54. ],
  55. [],
  56. AC_MSG_RESULT( yes )
  57. have_gpsim_0_21_12=yes,
  58. AC_MSG_RESULT( no )
  59. )
  60. AC_MSG_CHECKING([for gpsim 0.27.0 availability])
  61. AC_TRY_COMPILE(
  62. [
  63. #include <gpsim/pic-processor.h>
  64. void func() { pic_processor *Processor; sizeof(Processor->Wreg); }
  65. ],
  66. [],
  67. AC_MSG_RESULT( yes )
  68. have_gpsim_0_27_0=yes,
  69. AC_MSG_RESULT( no )
  70. )
  71. CXXFLAGS="$ktechlab_save_CXXFLAGS"
  72. AC_LANG_RESTORE
  73. ##############################
  74. ## END Check for gpsim 0.21 ##
  75. ##############################
  76. ################################
  77. ## BEGIN DO_NOT_COMPILE CHECK ##
  78. ################################
  79. if test x$have_gpsim_0_21_12 == xyes; then
  80. AC_DEFINE([GPSIM_0_21_12],[],[Gpsim 0.21.12 was found])
  81. CXXFLAGS="$CXXFLAGS $USE_EXCEPTIONS"
  82. else
  83. if test x$have_gpsim_0_21_4 != xyes; then
  84. if test x$have_gpsim_0_21_11 != xyes; then
  85. AC_DEFINE([NO_GPSIM],[],[Gpsim was not found])
  86. LIB_GPSIM=""
  87. else
  88. AC_DEFINE([GPSIM_0_21_11],[],[Gpsim 0.21.11 was found])
  89. fi
  90. else
  91. AC_DEFINE([GPSIM_0_21_4],[],[Gpsim 0.21.4 was found])
  92. fi
  93. fi
  94. 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
  95. wi_cv_lib_readline=no
  96. ac_save_LIBS="$LIBS"
  97. # Note: $LIBCURSES is permitted to be empty.
  98. for LIBREADLINE in "-lreadline" "-lreadline $LIBCURSES" "-lreadline -ltermcap" "-lreadline -lncurses" "-lreadline -lcurses"
  99. do
  100. LIBS="$ac_save_LIBS $LIBREADLINE"
  101. LIB_GPSIM="$LIBREADLINE -lgpsim -lgpsim_eXdbm -lgpsimcli -lgpsimgui"
  102. AC_TRY_RUN([
  103. /* program */
  104. #include <stdio.h>
  105. #include <stdlib.h>
  106. main(int argc, char **argv)
  107. {
  108. /* Note: don't actually call readline, since it may block;
  109. * We just want to see if it (dynamic) linked in okay.
  110. */
  111. if (argc == 0) /* never true */
  112. readline(0);
  113. exit(0);
  114. }
  115. ],[
  116. # action if true
  117. wi_cv_lib_readline=yes
  118. ],[
  119. # action if false
  120. wi_cv_lib_readline=no
  121. ],[
  122. # action if cross compiling
  123. wi_cv_lib_readline=no
  124. ])
  125. if test "$wi_cv_lib_readline" = yes ; then break ; fi
  126. done
  127. LIBS="$ac_save_LIBS"
  128. fi
  129. if test x$have_gpsim_0_27_0 == xyes; then
  130. AC_DEFINE([GPSIM_0_27_0],[],[Gpsim 0.27.0 was found])
  131. fi
  132. AC_SUBST(LIB_GPSIM)
  133. ##############################
  134. ## END DO_NOT_COMPILE CHECK ##
  135. ##############################