- Timestamp:
- Nov 27, 2009, 1:47:36 AM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/configure.ac
r892 r901 171 171 172 172 # PLplot API checks 173 # plplot_found can get values: skip, noheader, old, or nolib if an 174 # error is detected. 173 175 plplot_found="yes" 174 176 plplot_version=5.9 … … 177 179 [AS_HELP_STRING([--with-plplot=DIR],[prefix for plplot developer files])], 178 180 [DISTCHECK_CONFIGURE_FLAGS="$DISTCHECK_CONFIGURE_FLAGS --with-plplot=$withval" 179 PKG_CONFIG_PATH=${withval}/lib/pkgconfig${PATH_SEPARATOR}${PKG_CONFIG_PATH} 180 export PKG_CONFIG_PATH 181 AS_IF([test "x$withval" = "xno"], [ dnl 182 plplot_found=skip; 183 ], [ dnl 184 # help pkg-config find .pc file 185 PKG_CONFIG_PATH=${withval}/lib/pkgconfig${PATH_SEPARATOR}${PKG_CONFIG_PATH} 186 export PKG_CONFIG_PATH 187 ]) 181 188 ]) 182 189 183 # copy flags if pkg-config finds plplot 184 PKG_CHECK_EXISTS([plplotd-c++], [ 185 YAT_CPP_ADD_FLAG([PLPLOT_CPPFLAGS], [`$PKG_CONFIG plplotd-c++ --cflags`]) 186 YAT_LD_ADD_FLAG([PLPLOT_LDFLAGS], [`$PKG_CONFIG plplotd-c++ --libs-only-L`]) 187 PLPLOT_LIBS="`$PKG_CONFIG plplotd-c++ --libs-only-l --libs-only-other`" 188 ],[ 189 plplot_found=no-pkg-config 190 use_plplot_pc="no" 191 AS_IF([test "x$plplot_found" = "xyes" && test -n "$PKG_CONFIG"], [ 192 AC_MSG_CHECKING([for plplotd-c++.pc]) 193 AS_IF([$PKG_CONFIG --exists plplotd-c++], [ 194 AC_MSG_RESULT([yes]) 195 use_plplot_pc="yes" 196 ],[ 197 AC_MSG_RESULT([no]) 198 AC_MSG_WARN([cannot find plplotd-c++; 199 please use --with-plplot with appropriate argument to get more accurate 200 configuration.]) 201 ]) 202 ]) 203 204 AS_IF([test "x$plplot_found" = "xyes"], [ 205 # copy flags if we have found pc file 206 AS_IF([test "$use_plplot_pc" = "yes"], [ 207 YAT_CPP_ADD_FLAG([PLPLOT_CPPFLAGS], [`$PKG_CONFIG plplotd-c++ --cflags`]) 208 YAT_LD_ADD_FLAG([PLPLOT_LDFLAGS], [`$PKG_CONFIG plplotd-c++ --libs-only-L`]) 209 PLPLOT_LIBS="`$PKG_CONFIG plplotd-c++ --libs-only-l --libs-only-other`" 210 ],[ 211 # otherwise guess 212 PLPLOT_LIBS="-lplplotcxxd -lplplotd"; 213 AS_IF([test -n "$with_plplot" && test "x$with_plplot" != "xyes"], [ 214 YAT_CPP_ADD_FLAG([PLPLOT_CPPFLAGS], [$with_plplot/include]) 215 YAT_LD_ADD_FLAG([PLPLOT_LDFLAGS], [$with_plplot/libs]) 216 ]) 217 ]) 190 218 ]) 191 219 … … 197 225 ]) 198 226 199 AS_IF([test "x$plplot_found" = "xyes"], [ 200 AS_IF([$PKG_CONFIG --atleast-version=$plplot_version plplotd-c++], [],[ 201 plplot_found="nolib" 227 228 AS_IF([test "x$plplot_found" = "xyes" && test -n "$PKG_CONFIG"], [ 229 AC_MSG_CHECKING([plplot version >= $plplot_version]) 230 AS_IF([$PKG_CONFIG --atleast-version=$plplot_version plplotd-c++], [ 231 AC_MSG_RESULT([yes]) 232 ],[ 233 AC_MSG_RESULT([`$PKG_CONFIG --modversion= plplotd-c++`]) 234 plplot_found="old" 202 235 ]) 203 236 ]) 237 238 AS_IF([test "x$plplot_found" = "xyes" && test -n "$PKG_CONFIG"], [ 239 save_LDFLAGS=$LDFLAGS 240 LDFLAGS="$PLPLOT_LDFLAGS $LDFLAGS" 241 save_LIBS=$LIBS 242 LIBS="$PLPLOT_LIBS $LIBS" 243 AC_MSG_CHECKING([for library containing plstream]) 244 AC_LINK_IFELSE([AC_LANG_PROGRAM([@%:@include <plplot/plstream.h>], 245 [plstream pls(1,1,"svg", "conftest.svg")])], 246 [AC_MSG_RESULT([yes]); 247 AC_DEFINE([HAVE_PLPLOT], [1], 248 [Define to 1 if you have plplot])], 249 [AC_MSG_RESULT([no]) 250 plplot_found=nolib;]) 251 ]) 204 252 # restore variable 253 LDFLAGS=$save_LDFLAGS 254 LIBS=$save_LIBS 205 255 export PKG_CONFIG_PATH=$save_PKG_CONFIG_PATH 206 256 AC_SUBST(PLPLOT_CPPFLAGS) … … 212 262 AM_CONDITIONAL([HAVE_SVN_WC], [test "$wc_found" = "yes"]) 213 263 AC_SUBST([wc_found]) 214 215 # Reset FLAGS216 APR_RESTORE_THE_ENVIRONMENT([CPPFLAGS], [DEFAULT_])217 APR_RESTORE_THE_ENVIRONMENT([CXXFLAGS], [DEFAULT_])218 264 219 265 # checking if we have test repo … … 235 281 dnl maintainer make rukes from yat project 236 282 YAT_SVN_RELEASE 283 284 # Restore FLAGS 285 APR_RESTORE_THE_ENVIRONMENT([CPPFLAGS], [DEFAULT_]) 286 APR_RESTORE_THE_ENVIRONMENT([CXXFLAGS], [DEFAULT_]) 237 287 238 288 AC_CONFIG_FILES([Makefile … … 304 354 305 355 # Non-existing PLplot API is fatal -- sub-sequent compilation will fail. 306 if (test "$plplot_found" = "noheader") ; then 307 AC_MSG_WARN([PLplot developer files cannot be found. Make sure PLplot 308 is installed.]) 309 all_reqs_ok="false" 310 elif (test "$plplot_found" = "nolib") ; then 311 AC_MSG_WARN([PLplot developer files found but not required API version. 312 Version at least $plplot_version is required. Please upgrade PLplot.]) 313 all_reqs_ok="false" 314 elif (test "$plplot_found" = "no-pkg-config") ; then 315 AC_MSG_WARN([cannot find pkg-config]) 316 all_reqs_ok="false" 317 fi 356 AS_CASE([$plplot], 357 [noheader], 358 [AC_MSG_WARN([ 359 PLplot developer files cannot be found. Make sure PLplot is installed.]) 360 all_reqs_ok="false"], 361 [old], 362 [AC_MSG_WARN([ 363 PLplot developer files found but not required API version. 364 Version at least $plplot_version is required. Please upgrade PLplot.]) 365 all_reqs_ok="false"], 366 [nolib], 367 [AC_MSG_WARN([ 368 PLplot developer files found but linking against plplot library failed.]) 369 all_reqs_ok="false"]) 318 370 319 371 if test $ac_cv_type_long_long_int != yes ; then
Note: See TracChangeset
for help on using the changeset viewer.