Changeset 3867
- Timestamp:
- Feb 20, 2020, 4:43:31 AM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/m4/yat_plplot.m4
r3866 r3867 1 1 ## $Id$ 2 2 # 3 # serial 13 # serial 2 4 4 # 5 5 # see http://www.gnu.org/software/automake/manual/automake.html#Serials … … 15 15 # pkg-config. Otherwise try linking against plplot-c++ and 16 16 # plplotd-c++ to set PLPLOT_LIBS to what the library is called on 17 # this system. 17 # this system. If PLPLOT_* variable above are already set, the 18 # values from pkg-config is ignored. 18 19 # 19 20 # COPYLEFT … … 86 87 87 88 89 AC_ARG_VAR([PLPLOT_CPPFLAGS], 90 [preprocessor flags for plplot, overriding pkg-config]) 91 AC_ARG_VAR([PLPLOT_CXXFLAGS], 92 [compiler flags for plplot, overriding pkg-config]) 93 AC_ARG_VAR([PLPLOT_LDFLAGS], 94 [linker flags for plplot, overriding pkg-config]) 95 AC_ARG_VAR([PLPLOT_LIBS], [libraries for plplot, overriding pkg-config]) 96 88 97 AS_VAR_IF([yat_plplot_pkg], [no], [], [ 89 98 # pkg-config typically returns <prefix>/include/plplot because plplot … … 92 101 # trailing '/plplot'. Space is included in sed expression to avoid 93 102 # substituting potential '/plplot' in PREFIX. 94 PLPLOT_CPPFLAGS=`$PKG_CONFIG --cflags-only-I $yat_plplot_pkg | sed 's|/plplot | |g'` 95 PLPLOT_CXXFLAGS=`$PKG_CONFIG --cflags-only-other $yat_plplot_pkg` 96 PLPLOT_LDFLAGS=`$PKG_CONFIG --libs-only-other --libs-only-L $yat_plplot_pkg` 97 PLPLOT_LIBS=`$PKG_CONFIG --libs-only-l $yat_plplot_pkg` 103 104 # only set flags if not already set, to allow user to override 105 AS_VAR_SET_IF([PLPLOT_CPPFLAGS], [], [ 106 PLPLOT_CPPFLAGS=`$PKG_CONFIG --cflags-only-I $yat_plplot_pkg | sed 's|/plplot | |g'`]) 107 108 AS_VAR_SET_IF([PLPLOT_CXXFLAGS], [], [ 109 PLPLOT_CXXFLAGS=`$PKG_CONFIG --cflags-only-other $yat_plplot_pkg`]) 110 111 AS_VAR_SET_IF([PLPLOT_LDFLAGS], [], [ 112 PLPLOT_LDFLAGS=`$PKG_CONFIG --libs-only-other --libs-only-L $yat_plplot_pkg`]) 113 114 AS_VAR_SET_IF([PLPLOT_LIBS], [], [ 115 PLPLOT_LIBS=`$PKG_CONFIG --libs-only-l $yat_plplot_pkg`]) 98 116 ]) 99 117 ]) … … 123 141 AC_REQUIRE([YAT_CHECK_PKG_CONFIG_PLPLOT]) 124 142 143 save_CPPFLAGS=$CPPFLAGS 144 save_CXXFLAGS=$CXXFLAGS 145 save_LDFLAGS=$LDFLAGS 125 146 save_LIBS=$LIBS 126 AS_VAR_IF([yat_plplot_pkg], [no], [ 127 YAT_CHECK_LIBS([for library that contains plstream], [yat_cv_plplot_lib], 128 [plplotcxx plplotcxxd], 129 [AC_LANG_PROGRAM([@%:@ include <plplot/plstream.h>], 130 [plstream pls])], 131 [PLPLOT_LIBS="$yat_cv_plplot_lib" 132 dnl restore LIBS here so user can set it in $1 133 LIBS=$save_LIBS 134 $1], 135 [$2]) 136 ], [ 137 save_LDFLAGS=$LDFLAGS 147 AS_VAR_SET_IF([PLPLOT_LIBS], [ 138 148 LDFLAGS="$LDFLAGS $PLPLOT_LDFLAGS" 139 149 LIBS="$LIBS $PLPLOT_LIBS" … … 141 151 AC_LINK_IFELSE([AC_LANG_PROGRAM()], [ 142 152 AC_MSG_RESULT([ok]) 143 dnl restore variables already here so user can set these variables (in $1)153 dnl restore variables already here so user can set these variables (in $1) 144 154 LDFLAGS=$save_LDFLAGS 145 155 LIBS=$save_LIBS … … 147 157 ], [ 148 158 AC_MSG_RESULT([failed]) 149 dnl restore variables already here so user can set these variables (in $2)159 dnl restore variables already here so user can set these variables (in $2) 150 160 LDFLAGS=$save_LDFLAGS 151 161 LIBS=$save_LIBS 152 162 $2 153 163 ]) 154 ]) 155 ]) 164 ], [ dnl else 165 CPPFLAGS="$CPPFLAGS $PLPLOT_CPPFLAGS" 166 CXXFLAGS="$CXXFLAGS $PLPLOT_CXXFLAGS" 167 LDFLAGS="$LDFLAGS $PLPLOT_LDFLAGS" 168 YAT_CHECK_LIBS([for library that contains plstream], [yat_cv_plplot_lib], 169 [plplotcxx plplotcxxd], 170 [AC_LANG_PROGRAM([@%:@ include <plplot/plstream.h>], 171 [plstream pls])], 172 [PLPLOT_LIBS="$yat_cv_plplot_lib" 173 dnl restore variables here so user can set it in $1 174 CPPFLAGS=$save_CPPFLAGS 175 CXXFLAGS=$save_CXXFLAGS 176 LDFLAGS=$save_LDFLAGS 177 LIBS=$save_LIBS 178 $1], 179 [$2]) 180 ]) # end VAR_SET_IF 181 ]) # YAT_CHECK_PLPLOT_LIB
Note: See TracChangeset
for help on using the changeset viewer.