KMatplot – a gnuplot-like tool for plotting data sets in either two or three dimensions
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.
 
 
 
 
 
 

307 lines
9.6 KiB

  1. # Original Author was Kalle@kde.org
  2. # I lifted it in some mater. (Stephan Kulow)
  3. # I used much code from Janos Farkas
  4. # Additional m4 tests in this file are written by kamildobk@poczta.onet.pl
  5. dnl Process this file with autoconf to produce a configure script.
  6. AC_INIT(acinclude.m4) dnl a source file from your sub dir
  7. dnl This is so we can use kde-common
  8. AC_CONFIG_AUX_DIR(admin)
  9. AC_CANONICAL_SYSTEM
  10. AC_ARG_PROGRAM
  11. dnl Automake doc recommends to do this only here. (Janos)
  12. AM_INIT_AUTOMAKE(kmatplot,0.4)
  13. dnl KDE_SET_PREFIX
  14. AC_PREFIX_DEFAULT(/usr/local)
  15. if test "x$prefix" = "xNONE"; then
  16. prefix=$ac_default_prefix
  17. ac_configure_args="$ac_configure_args --prefix $prefix"
  18. fi
  19. dnl generate the config header
  20. AM_CONFIG_HEADER(config.h) dnl at the distribution this done
  21. dnl Checks for programs.
  22. AC_CHECK_COMPILERS
  23. AC_ENABLE_SHARED(yes)
  24. AC_ENABLE_STATIC(no)
  25. KDE_PROG_LIBTOOL
  26. AC_REQUIRE([KDE_CHECK_EXTRA_LIBS])
  27. all_libraries="$all_libraries $USER_LDFLAGS"
  28. all_includes="$all_includes $USER_INCLUDES"
  29. AC_SUBST(all_includes)
  30. AC_SUBST(all_libraries)
  31. dnl for NLS support. Call them in this order!
  32. dnl WITH_NLS is for the po files
  33. AM_KDE_WITH_NLS
  34. AC_PATH_QT
  35. dnl Perform program name transformation
  36. AC_ARG_PROGRAM
  37. dnl PACKAGE set before
  38. dnl ---------------------------------------------------------------------------------------------------------
  39. dnl ---------------------------------------------------------------------------------------------------------
  40. dnl ---------------------------------------------------------------------------------------------------------
  41. dnl ---------------------------------------------------------------------------------------------------------
  42. dnl ---------------------------------------------------------------------------------------------------------
  43. dnl ---------------------------------------------------------------------------------------------------------
  44. dnl ---------------------------------------------------------------------------------------------------------
  45. dnl ---------------------------------------------------------------------------------------------------------
  46. dnl ---------------------------------------------------------------------------------------------------------
  47. dnl ---------------------------------------------------------------------------------------------------------
  48. dnl ---------------------------------------------------------------------------------------------------------
  49. dnl ---------------------------------------------------------------------------------------------------------
  50. dnl ---------------------------------------------------------------------------------------------------------
  51. dnl ---------------------------------------------------------------------------------------------------------
  52. dnl ---------------------------------------------------------------------------------------------------------
  53. dnl -------------------------------------------------------------------------------------------------------
  54. dnl Find Octave scripts dir
  55. AC_DEFUN(AC_OCT_INSTALL_DIR,
  56. [
  57. AC_REQUIRE_CPP()
  58. AC_REQUIRE([AC_HAVE_MKOCTFILE])
  59. AC_ARG_WITH( oct-dir, [ --with-oct-dir=DIR install '.oct' files in DIR ], oct_path=$withval, oct_path="" )
  60. AC_MSG_CHECKING("install path for Octave scripts")
  61. if test "x$oct_path" = x; then
  62. AC_CACHE_VAL( ac_cv_path_oct, [
  63. save_IFS=$IFS
  64. IFS=":"
  65. octave_home=
  66. for try_path in $PATH; do
  67. if test -f "$try_path/octave"; then
  68. octave_home=$try_path
  69. break
  70. fi
  71. done
  72. IFS=$save_IFS
  73. if test "x$octave_home" = x; then
  74. ac_cv_path_oct=
  75. else
  76. ac_cv_path_oct=$octave_home/../share/octave/site/m
  77. fi
  78. ])
  79. installoctdir=$ac_cv_path_oct
  80. else
  81. installoctdir=$oct_path
  82. fi
  83. if test "x$installoctdir" = x; then
  84. AC_MSG_RESULT("do not install")
  85. else
  86. AC_MSG_RESULT("$installoctdir")
  87. fi
  88. AC_SUBST(installoctdir)
  89. ])
  90. dnl -------------------------------------------------------------------------------------------------------
  91. dnl Check if octave 'makeoctfile' is present
  92. AC_DEFUN(AC_HAVE_MKOCTFILE,
  93. [
  94. AC_REQUIRE_CPP()
  95. AC_ARG_WITH( mkoctfile-path, [ --with-mkoctfile-path=DIR a path to 'mkoctfile' script], make_oct_path=$withval, make_oct_path="" )
  96. AC_PATH_PROG( makeoct, mkoctfile, "", "$make_oct_path:$PATH" )
  97. AC_SUBST(makeoct)
  98. ])
  99. dnl -------------------------------------------------------------------------------------------------------
  100. dnl Find Scilab library dir
  101. AC_DEFUN(AC_SCILAB_LIB_DIR,
  102. [
  103. AC_REQUIRE_CPP()
  104. AC_ARG_WITH( scilab-lib-dir, [ --with-scilab-lib-dir=DIR path to Scilab libraries and includes ], libscidir=$withval, libscidir="" )
  105. AC_MSG_CHECKING("Scilab libraries and includes path")
  106. if test "x$libscidir" = x; then
  107. AC_CACHE_VAL( ac_cv_path_scilab, [
  108. ac_cv_path_scilab=$(eval 'echo "printf(\" \");printf(SCI);quit;" | scilab -nw | tail --lines 1' 2>/dev/null)
  109. ])
  110. libscidir=$ac_cv_path_scilab
  111. fi
  112. if test ! -d "$libscidir" -a "x$libscidir" != x; then
  113. libscidir=
  114. fi
  115. if test "x$libscidir" = x; then
  116. AC_MSG_RESULT("not found")
  117. else
  118. AC_MSG_RESULT("$libscidir")
  119. fi
  120. AC_SUBST(libscidir)
  121. ])
  122. dnl -------------------------------------------------------------------------------------------------------
  123. dnl Is Qt GL extension built-in Qt or it must be linked additionaly.
  124. AC_DEFUN(AC_HAVE_QGL,
  125. [
  126. AC_REQUIRE_CPP()
  127. AC_REQUIRE([AC_HAVE_GL])
  128. AC_MSG_CHECKING("Qt GL Extension")
  129. AC_ARG_WITH( qgl-extension, [ --with-qgl-extension=LIBRARY link to Qt GL extension in a separate library ], arg_qgl_extension=$withval, arg_qgl_extension="" )
  130. dnl make link tests with C++
  131. AC_LANG_CPLUSPLUS
  132. if test "x$arg_qgl_extension" = x; then
  133. dnl Variable names mus start with ac_cv_'function'
  134. AC_CACHE_VAL( ac_cv_lib_qgl_extension, [
  135. ac_save_ldflags="$LDFLAGS"
  136. ac_save_cxxflags="$CXXFLAGS"
  137. LDFLAGS="$LDFLAGS $all_libraries -lqgl"
  138. CXXFLAGS="$CXXFLAGS $all_includes"
  139. test -n "$GL_INCLUDE" && CFLAGS="-I$GL_INCLUDE $CFLAGS"
  140. AC_TRY_LINK( [ #include <qgl.h> ], [], ac_cv_lib_qgl_extension="-lqgl", ac_cv_lib_qgl_extension="built-in" )
  141. LDFLAGS="$ac_save_ldflags"
  142. CXXFLAGS="$ac_save_cxxflags"
  143. ])
  144. if test "$ac_cv_lib_qgl_extension" = "built-in"; then
  145. QGLLIB=""
  146. else
  147. QGLLIB=$ac_cv_lib_qgl_extension
  148. fi
  149. arg_qgl_extension=$ac_cv_lib_qgl_extension
  150. else
  151. QGLLIB=$arg_qgl_extension
  152. fi
  153. AC_MSG_RESULT("$arg_qgl_extension")
  154. AC_SUBST(QGLLIB)
  155. ])
  156. dnl ---------------------------------------------------------------------------------------------------------
  157. dnl Find Qt install prefix - place for the config file
  158. AC_DEFUN(AC_QSETTINGS_DIR,
  159. [
  160. AC_REQUIRE_CPP()
  161. AC_ARG_WITH( qsettings-dir, [ --with-qsettings-dir=DIR path to Qt settings ( usually QT_INSTALL_PREFIX/etc/settings ) ], qsettingsdir=$withval, qsettingsdir="" )
  162. AC_MSG_CHECKING("QSettings path")
  163. if test "x$qsettingsdir" = x; then
  164. AC_CACHE_VAL( ac_cv_path_qsettingsdir, [
  165. ac_cv_path_qsettingsdir="$QTDIR/etc/settings"
  166. ])
  167. qsettingsdir=$ac_cv_path_qsettingsdir
  168. fi
  169. if test "x$qsettingsdir" = "x/etc/settings"; then
  170. AC_MSG_ERROR("QTDIR is needed to find QSettings path. Please set QTDIR and run configure again !")
  171. else
  172. AC_MSG_RESULT("$qsettingsdir")
  173. fi
  174. dnl QSETTINGSDIR=$qsettingsdir
  175. AC_SUBST(QSETTINGSDIR)
  176. ])
  177. dnl ---------------------------------------------------------------------------------------------------------
  178. dnl Check for Numpy
  179. AC_DEFUN(AC_HAVE_NUMPY,
  180. [
  181. AC_REQUIRE([KDE_CHECK_PYTHON])
  182. AC_MSG_CHECKING("Numerical Python")
  183. AC_ARG_WITH( numpy, [ --with-numpy=DIR Numerical Python installed in DIR ], arg_numpy=$withval, arg_numpy="" )
  184. if test "x$arg_numpy" = x; then
  185. AC_CACHE_VAL( ac_cv_numpy, [
  186. numpy_possible_locations="$PYTHONMODDIR/site-packages/Numeric $PYTHONMODDIR/Numeric"
  187. ac_cv_numpy=""
  188. AC_FIND_FILE(Numeric.py, $numpy_possible_locations, ac_cv_numpy)
  189. ])
  190. dir_found=$ac_cv_numpy
  191. else
  192. dir_found=$arg_numpy
  193. fi
  194. AC_MSG_RESULT($dir_found)
  195. if test "$dir_found" = NO; then
  196. NUMPYDIR=""
  197. else
  198. NUMPYDIR=$dir_found
  199. fi
  200. AC_SUBST(NUMPYDIR)
  201. ])
  202. dnl ---------------------------------------------------------------------------------------------------------
  203. dnl ---------------------------------------------------------------------------------------------------------
  204. dnl ---------------------------------------------------------------------------------------------------------
  205. dnl ---------------------------------------------------------------------------------------------------------
  206. dnl ---------------------------------------------------------------------------------------------------------
  207. dnl in this space add everything you want to check for;
  208. dnl examples are specific headers, libraries, etc.
  209. dnl all_includes="$QT_INCLUDES $X_INCLUDES $USER_INCLUDES"
  210. dnl AC_SUBST(all_includes)
  211. AC_C_BIGENDIAN
  212. AC_QSETTINGS_DIR
  213. AC_HAVE_GL(GL_DRIVER="YES",GL_DRIVER="")
  214. AC_HAVE_QGL
  215. AC_HAVE_NUMPY
  216. AM_CONDITIONAL(MAKE_PYTHON, test "x$NUMPYDIR" != x )
  217. AC_HAVE_MKOCTFILE
  218. AC_OCT_INSTALL_DIR
  219. AM_CONDITIONAL(MAKE_OCT, test "x$makeoct" != x -a "x$installoctdir" != x )
  220. AC_SCILAB_LIB_DIR
  221. AM_CONDITIONAL(MAKE_SCILAB, test "x$libscidir" != x )
  222. KDE_CREATE_SUBDIRSLIST
  223. dnl add here all your Makefiles. This are created by configure
  224. AC_OUTPUT( \
  225. ./Makefile \
  226. kmatplot/Makefile \
  227. kmatplot/config/Makefile \
  228. kmatplot/demos/Makefile \
  229. kmatplot/dialogs/Makefile \
  230. kmatplot/dialogs/templates/Makefile \
  231. kmatplot/docs/Makefile \
  232. kmatplot/docs/en/Makefile \
  233. kmatplot/dtd/Makefile \
  234. kmatplot/examples/Makefile \
  235. kmatplot/formula/Makefile \
  236. kmatplot/interface/Makefile \
  237. kmatplot/octave/Makefile \
  238. kmatplot/pics/Makefile \
  239. kmatplot/pixmaps/Makefile \
  240. kmatplot/python/Makefile \
  241. kmatplot/scilab/Makefile \
  242. kmatplot/widgets/Makefile \
  243. )