2 # Copyright 2015-2016 Nest Labs Inc. All Rights Reserved.
4 # Licensed under the Apache License, Version 2.0 (the "License");
5 # you may not use this file except in compliance with the License.
6 # You may obtain a copy of the License at
8 # http://www.apache.org/licenses/LICENSE-2.0
10 # Unless required by applicable law or agreed to in writing, software
11 # distributed under the License is distributed on an "AS IS" BASIS,
12 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 # See the License for the specific language governing permissions and
14 # limitations under the License.
19 # This file defines a GNU autoconf M4-style macro for checking
20 # the presence and viability of both required and optional
21 # dependent packages, which may be internal or external to the
24 # Five (5) macros are made available:
26 # * NL_WITH_REQUIRED_EXTERNAL_PACKAGE
27 # * NL_WITH_OPTIONAL_EXTERNAL_PACKAGE
28 # * NL_WITH_REQUIRED_INTERNAL_PACKAGE
29 # * NL_WITH_OPTIONAL_INTERNAL_PACKAGE
32 # Note, however, that NL_WITH_PACKAGE is deprecated and maps to
33 # NL_WITH_REQUIRED_INTERNAL_PACKAGE.
36 # _NL_ARG_WITH_INCLUDES_OR_LIBS(PACKAGE-DISPOSITION,
38 # PACKAGE-PRETTY-NAME,
39 # PACKAGE-VARIABLE-PREFIX,
40 # PACKAGE-SUCCINCT-NAME,
41 # PACKAGE-WITH-OPTION,
42 # PLURAL-WITH-OPTION-HELP-WORD,
43 # WITH-DIR-VARIABLE-MODIFIER)
44 # ----------------------------------------------------------------------------
45 # This is a wrapper around AC_ARG_WITH that provides the ability to
46 # optionally specify a dependent package include and link library
47 # directories independently as
48 # --with-<PACKAGE-SUCCINCT-NAME>-<PACKAGE-WITH-OPTION>=<DIR>.
50 # If the package is specified as required, the use of
51 # --without-<PACKAGE-SUCCINCT-NAME> or the use of
52 # --with-<PACKAGE-SUCCINCT-NAME>=no will result in a fatal error.
54 # At the successful conclusion of the execution of the macro,
55 # two variables will be defined:
57 # * nl_with_<PACKAGE-SUCCINCT-NAME>
58 # * <PACKAGE-SUCCINT-NAME>_<WITH-DIR-VARIABLE-MODIFIER>_dir
60 # The package disposition and source are specified by:
62 # PACKAGE-DISPOSITION : This may be either 'required' if the dependent
63 # package is required or 'optional' if
65 # PACKAGE-SOURCE : This may be either 'internal' if the dependent
66 # package may be provided either
67 # internally or externally to the current
68 # package or 'external' if the dependent
69 # package may only be provided outside of
70 # the current package. This also serves as
71 # the default value for where the
72 # configuration script expects to find the
75 # The dependent package is specified in three forms:
77 # PACKAGE-PRETTY-NAME : The human-readable name by which the package
78 # will be referred for any diagnostic output. For
79 # example, "My Great Software Package".
80 # PACKAGE-VARIABLE-PREFIX : The package-specific prefix applied to variables
81 # defined as a result of running this macro for the
82 # packages. For example, "MGSP" here is transformed
84 # PACKAGE-SUCCINCT-NAME : The package-specific name used for pkg-config,
85 # in temporary variables and on the
86 # configure command line. For example,
87 # "mgsp" here is used for --with-mgsp=DIR
88 # or 'pkg-config --cflags mgsp'.
89 # ----------------------------------------------------------------------------
90 AC_DEFUN([_NL_ARG_WITH_INCLUDES_OR_LIBS],
92 dnl Check whether or not the package is required
97 [m4_fatal([$0: invalid disposition value '$1'; must be 'required' or 'optional'])])
99 dnl Check whether or not the package is internal
104 [m4_fatal([$0: invalid source value '$2'; must be 'internal' or 'external'])])
107 AS_HELP_STRING([--with-$5-$6=DIR],
108 [Specify location of $1 $3 $7 @<:@default=$2@:>@.]),
110 if test "${withval}" = "no"; then
113 [AC_MSG_ERROR([${PACKAGE_NAME} requires the $3 package.])],
114 [nl_with_$5=${withval}])
117 if test "x${$5_dir}" != "x"; then
118 AC_MSG_WARN([overriding --with-$5=${$5_dir}])
121 if test "${withval}" = "internal"; then
123 nl_with_$5=${withval}
131 if test "x${nl_with_$5}" = "x"; then
137 # _NL_ARG_WITH_INCLUDES(PACKAGE-DISPOSITION,
139 # PACKAGE-PRETTY-NAME,
140 # PACKAGE-VARIABLE-PREFIX,
141 # PACKAGE-SUCCINCT-NAME)
142 # ----------------------------------------------------------------------------
143 # This is a wrapper around AC_ARG_WITH that provides the ability to
144 # optionally specify a dependent package include directory
145 # independently as --with-<PACKAGE-SUCCINCT-NAME>-includes=<DIR>.
147 # If the package is specified as required, the use of
148 # --without-<PACKAGE-SUCCINCT-NAME>-includes or the use of
149 # --with-<PACKAGE-SUCCINCT-NAME>-includes=no will result in a fatal error.
151 # At the successful conclusion of the execution of the macro,
152 # two variables will be defined:
154 # * nl_with_<PACKAGE-SUCCINCT-NAME>
155 # * <PACKAGE-SUCCINT-NAME>_header_dir
157 # The package disposition and source are specified by:
159 # PACKAGE-DISPOSITION : This may be either 'required' if the dependent
160 # package is required or 'optional' if
162 # PACKAGE-SOURCE : This may be either 'internal' if the dependent
163 # package may be provided either
164 # internally or externally to the current
165 # package or 'external' if the dependent
166 # package may only be provided outside of
167 # the current package. This also serves as
168 # the default value for where the
169 # configuration script expects to find the
172 # The dependent package is specified in three forms:
174 # PACKAGE-PRETTY-NAME : The human-readable name by which the package
175 # will be referred for any diagnostic output. For
176 # example, "My Great Software Package".
177 # PACKAGE-VARIABLE-PREFIX : The package-specific prefix applied to variables
178 # defined as a result of running this macro for the
179 # packages. For example, "MGSP" here is transformed
180 # into MGSP_CPPFLAGS.
181 # PACKAGE-SUCCINCT-NAME : The package-specific name used for pkg-config,
182 # in temporary variables and on the
183 # configure command line. For example,
184 # "mgsp" here is used for --with-mgsp=DIR
185 # or 'pkg-config --cflags mgsp'.
186 # ----------------------------------------------------------------------------
187 AC_DEFUN([_NL_ARG_WITH_INCLUDES],
189 _NL_ARG_WITH_INCLUDES_OR_LIBS([$1], [$2], [$3], [$4], [$5], [includes], [headers], [header])dnl
192 # _NL_ARG_WITH_LIBS(PACKAGE-DISPOSITION,
194 # PACKAGE-PRETTY-NAME,
195 # PACKAGE-VARIABLE-PREFIX,
196 # PACKAGE-SUCCINCT-NAME)
197 # ----------------------------------------------------------------------------
198 # This is a wrapper around AC_ARG_WITH that provides the ability to
199 # optionally specify a dependent package link library directory
200 # independently as --with-<PACKAGE-SUCCINCT-NAME>-libs=<DIR>.
202 # If the package is specified as required, the use of
203 # --without-<PACKAGE-SUCCINCT-NAME>-libs or the use of
204 # --with-<PACKAGE-SUCCINCT-NAME>-libs=no will result in a fatal error.
206 # At the successful conclusion of the execution of the macro,
207 # two variables will be defined:
209 # * nl_with_<PACKAGE-SUCCINCT-NAME>
210 # * <PACKAGE-SUCCINT-NAME>_library_dir
212 # The package disposition and source are specified by:
214 # PACKAGE-DISPOSITION : This may be either 'required' if the dependent
215 # package is required or 'optional' if
217 # PACKAGE-SOURCE : This may be either 'internal' if the dependent
218 # package may be provided either
219 # internally or externally to the current
220 # package or 'external' if the dependent
221 # package may only be provided outside of
222 # the current package. This also serves as
223 # the default value for where the
224 # configuration script expects to find the
227 # The dependent package is specified in three forms:
229 # PACKAGE-PRETTY-NAME : The human-readable name by which the package
230 # will be referred for any diagnostic output. For
231 # example, "My Great Software Package".
232 # PACKAGE-VARIABLE-PREFIX : The package-specific prefix applied to variables
233 # defined as a result of running this macro for the
234 # packages. For example, "MGSP" here is transformed
235 # into MGSP_CPPFLAGS.
236 # PACKAGE-SUCCINCT-NAME : The package-specific name used for pkg-config,
237 # in temporary variables and on the
238 # configure command line. For example,
239 # "mgsp" here is used for --with-mgsp=DIR
240 # or 'pkg-config --cflags mgsp'.
241 # ----------------------------------------------------------------------------
242 AC_DEFUN([_NL_ARG_WITH_LIBS],
244 _NL_ARG_WITH_INCLUDES_OR_LIBS([$1], [$2], [$3], [$4], [$5], [libs], [libraries], [library])dnl
247 # _NL_ARG_WITH_PACKAGE(PACKAGE-DISPOSITION,
249 # PACKAGE-PRETTY-NAME,
250 # PACKAGE-VARIABLE-PREFIX,
251 # PACKAGE-SUCCINCT-NAME)
252 # ----------------------------------------------------------------------------
253 # This is a wrapper around AC_ARG_WITH that provides the ability to
254 # optionally specify a dependent package as
255 # --with-<PACKAGE-SUCCINCT-NAME>=<DIR> or to independently specify the
256 # include and link library directories independently as
257 # --with-<PACKAGE-SUCCINCT-NAME>-includes=<DIR> and
258 # --with-<PACKAGE-SUCCINCT-NAME>-libs=<DIR>.
260 # If the package is specified as required, the use of
261 # --without-<PACKAGE-SUCCINCT-NAME>* or the use of
262 # --with-<PACKAGE-SUCCINCT-NAME>*=no will result in a fatal error.
264 # At the successful conclusion of the execution of the macro,
265 # two or more variables will be defined:
267 # * nl_with_<PACKAGE-SUCCINCT-NAME>
268 # * <PACKAGE-SUCCINT-NAME>_dir
269 # * <PACKAGE-SUCCINT-NAME>_header_dir
270 # * <PACKAGE-SUCCINT-NAME>_library_dir
272 # The package disposition and source are specified by:
274 # PACKAGE-DISPOSITION : This may be either 'required' if the dependent
275 # package is required or 'optional' if
277 # PACKAGE-SOURCE : This may be either 'internal' if the dependent
278 # package may be provided either
279 # internally or externally to the current
280 # package or 'external' if the dependent
281 # package may only be provided outside of
282 # the current package. This also serves as
283 # the default value for where the
284 # configuration script expects to find the
287 # The dependent package is specified in three forms:
289 # PACKAGE-PRETTY-NAME : The human-readable name by which the package
290 # will be referred for any diagnostic output. For
291 # example, "My Great Software Package".
292 # PACKAGE-VARIABLE-PREFIX : The package-specific prefix applied to variables
293 # defined as a result of running this macro for the
294 # packages. For example, "MGSP" here is transformed
295 # into MGSP_CPPFLAGS.
296 # PACKAGE-SUCCINCT-NAME : The package-specific name used for pkg-config,
297 # in temporary variables and on the
298 # configure command line. For example,
299 # "mgsp" here is used for --with-mgsp=DIR
300 # or 'pkg-config --cflags mgsp'.
301 # ----------------------------------------------------------------------------
302 AC_DEFUN([_NL_ARG_WITH_PACKAGE],
305 AS_HELP_STRING([--with-$5=DIR],
306 [Specify location of the $1 $3 headers and libraries @<:@default=$2@:>@.]),
308 if test "${withval}" = "no"; then
311 [AC_MSG_ERROR([${PACKAGE_NAME} requires the $3 package.])],
312 [nl_with_$5=${withval}])
313 elif test "${withval}" = "internal"; then
315 nl_with_$5=${withval}
321 [$5_dir=; nl_with_$5=$2])
323 # Allow users to specify external headers and libraries independently.
325 _NL_ARG_WITH_INCLUDES([$1], [$2], [$3], [$4], [$5])dnl
327 _NL_ARG_WITH_LIBS([$1], [$2], [$3], [$4], [$5])dnl
330 # _NL_WITH_PACKAGE(PACKAGE-DISPOSITION,
332 # PACKAGE-PRETTY-NAME,
333 # PACKAGE-VARIABLE-PREFIX,
334 # PACKAGE-SUCCINCT-NAME,
335 # [DEFAULT-PACKAGE-LIBS],
336 # [ACTIONS-TO-RUN-IF-NOT-EXTERNAL],
337 # [ACTIONS-TO-RUN-IF-NOT-INTERNAL])
338 # ----------------------------------------------------------------------------
339 # This macro is used to test for the presence, with pkg-config if it
340 # is available, of the specified, optional or required dependent
341 # package. The dependent package may be provided externally or may
342 # exist within the current package itself.
344 # If the package is specified as required, failure to find the
345 # dependent package will result in a fatal error.
347 # At the successful conclusion of the execution of the macro, three
348 # variables will be defined:
350 # * <PACKAGE-VARIABLE-PREFIX>_CPPFLAGS
351 # * <PACKAGE-VARIABLE-PREFIX>_LDFLAGS
352 # * <PACKAGE-VARIABLE-PREFIX>_LIBS
354 # In addition, the variable:
356 # * nl_with_<PACKAGE-SUCCINCT-NAME>
358 # will unconditionally be set to the source of the package if it is to
359 # be used and is found; otherwise, 'no' if it is not to be used.
361 # The package disposition and source are specified by:
363 # PACKAGE-DISPOSITION : This may be either 'required' if the dependent
364 # package is required or 'optional' if
366 # PACKAGE-SOURCE : This may be either 'internal' if the dependent
367 # package may be provided either
368 # internally or externally to the current
369 # package or 'external' if the dependent
370 # package may only be provided outside of
371 # the current package. This also serves as
372 # the default value for where the
373 # configuration script expects to find the
376 # The dependent package is specified in three forms:
378 # PACKAGE-PRETTY-NAME : The human-readable name by which the package
379 # will be referred for any diagnostic output. For
380 # example, "My Great Software Package".
381 # PACKAGE-VARIABLE-PREFIX : The package-specific prefix applied to variables
382 # defined as a result of running this macro for the
383 # packages. For example, "MGSP" here is transformed
384 # into MGSP_CPPFLAGS.
385 # PACKAGE-SUCCINCT-NAME : The package-specific name used for pkg-config,
386 # in temporary variables and on the
387 # configure command line. For example,
388 # "mgsp" here is used for --with-mgsp=DIR
389 # or 'pkg-config --cflags mgsp'.
391 # In addition, if any additional, default link libraries are required
392 # for use with the package, these are specified as:
394 # DEFAULT-PACKAGE-LIBS : Default link libraries required for use with
395 # the package. These are used if pkg-config is
396 # not available or cannot identify any
397 # such libraries. For example, '-lmgsp'.
399 # If the package is specified, either internally or externally, optional
402 # ACTIONS-TO-RUN-IF-NOT-EXTERNAL : Optional actions to run if the package
404 # ACTIONS-TO-RUN-IF-NOT-INTERNAL : Optional actions to run if the package
406 # ----------------------------------------------------------------------------
407 AC_DEFUN([_NL_WITH_PACKAGE],
409 # Influential external variables for the package support
411 AC_ARG_VAR($4_CPPFLAGS, [$3 C preprocessor flags])
412 AC_ARG_VAR($4_LDFLAGS, [$3 linker flags])
413 AC_ARG_VAR($4_LIBS, [$3 linker libraries])
415 # Allow the user to specify both external headers and libraries
416 # together (or internal).
418 _NL_ARG_WITH_PACKAGE([$1], [$2], [$3], [$4], [$5])dnl
420 if test "${nl_with_$5}" == "no"; then
421 AC_MSG_CHECKING([whether to use the $3 package])
422 AC_MSG_RESULT([${nl_with_$5}])
425 AC_MSG_CHECKING([source of the $3 package])
426 AC_MSG_RESULT([${nl_with_$5}])
428 # If the user has selected or has defaulted into the internal $3
429 # package, set the values appropriately. Otherwise, run through the
432 if test "${nl_with_$5}" = "internal"; then
436 # We always prefer checking the values of the various '--with-$5-...'
437 # options first to using pkg-config because the former might be used
438 # in a cross-compilation environment on a system that also contains
439 # pkg-config. In such a case, the user wants what he/she specified
440 # rather than what pkg-config indicates.
442 if test "x${$5_dir}" != "x" -o "x${$5_header_dir}" != "x" -o "x${$5_library_dir}" != "x"; then
443 if test "x${$5_dir}" != "x"; then
444 if test -d "${$5_dir}"; then
445 if test -d "${$5_dir}/include"; then
446 $4_CPPFLAGS="-I${$5_dir}/include"
448 $4_CPPFLAGS="-I${$5_dir}"
451 if test -d "${$5_dir}/lib"; then
452 $4_LDFLAGS="-L${$5_dir}/lib"
454 $4_LDFLAGS="-L${$5_dir}"
457 AC_MSG_ERROR([No such directory ${$5_dir}])
461 if test "x${$5_header_dir}" != "x"; then
462 if test -d "${$5_header_dir}"; then
463 $4_CPPFLAGS="-I${$5_header_dir}"
465 AC_MSG_ERROR([No such directory ${$5_header_dir}])
469 if test "x${$5_library_dir}" != "x"; then
470 if test -d "${$5_library_dir}"; then
471 $4_LDFLAGS="-L${$5_library_dir}"
473 AC_MSG_ERROR([No such directory ${$5_library_dir}])
477 $4_LIBS="${$4_LDFLAGS} $6"
479 elif test "x${PKG_CONFIG}" != "x"; then
480 if ${PKG_CONFIG} --exists "$5"; then
481 $4_CPPFLAGS="`${PKG_CONFIG} --cflags $5`"
482 $4_LDFLAGS="`${PKG_CONFIG} --libs-only-L $5`"
483 $4_LIBS="`${PKG_CONFIG} --libs-only-l $5`"
487 [AC_MSG_ERROR([Cannot find the $5 package with ${PKG_CONFIG}. ${PACKAGE_NAME} requires the $5 package. Try installing the package or use the relevant --with options to configure.])],
494 [AC_MSG_ERROR([Cannot find the $3 package. ${PACKAGE_NAME} requires the $3 package.])],
499 AC_SUBST($4_CPPFLAGS)
503 if test "${nl_with_$5}" != "internal" -a "${nl_with_$5}" != "no"; then
504 nl_saved_CPPFLAGS="${CPPFLAGS}"
505 nl_saved_LDFLAGS="${LDFLAGS}"
506 nl_saved_LIBS="${LIBS}"
508 CPPFLAGS="${CPPFLAGS} ${$4_CPPFLAGS}"
509 LDFLAGS="${LDFLAGS} ${$4_LDFLAGS}"
510 LIBS="${LIBS} ${$4_LIBS}"
514 CPPFLAGS="${nl_saved_CPPFLAGS}"
515 LDFLAGS="${nl_saved_LDFLAGS}"
516 LIBS="${nl_saved_LIBS}"
521 # NL_WITH_REQUIRED_EXTERNAL_PACKAGE(PACKAGE-PRETTY-NAME,
522 # PACKAGE-VARIABLE-PREFIX,
523 # PACKAGE-SUCCINCT-NAME,
524 # [DEFAULT-PACKAGE-LIBS],
526 # ----------------------------------------------------------------------------
527 # This macro is used to test for the presence, with pkg-config if it
528 # is available, of the specified, required external dependent package.
530 # Failure to find the dependent package will result in a fatal error.
532 # The dependent package is specified in three forms:
534 # PACKAGE-PRETTY-NAME : The human-readable name by which the package
535 # will be referred for any diagnostic output. For
536 # example, "My Great Software Package".
537 # PACKAGE-VARIABLE-PREFIX : The package-specific prefix applied to variables
538 # defined as a result of running this macro for the
539 # packages. For example, "MGSP" here is transformed
540 # into MGSP_CPPFLAGS.
541 # PACKAGE-SUCCINCT-NAME : The package-specific name used for pkg-config,
542 # in temporary variables and on the
543 # configure command line. For example,
544 # "mgsp" here is used for --with-mgsp=DIR
545 # or 'pkg-config --cflags mgsp'.
547 # In addition, if any additional, default link libraries are required
548 # for use with the package, these are specified as:
550 # DEFAULT-PACKAGE-LIBS : Default link libraries required for use with
551 # the package. These are used if pkg-config is
552 # not available or cannot identify any
553 # such libraries. For example, '-lmgsp'.
555 # If the package is specified, optional actions are run.
557 # ACTIONS-TO-RUN-IF-FOUND : Optional actions to run if the package is found.
558 # ----------------------------------------------------------------------------
559 AC_DEFUN([NL_WITH_REQUIRED_EXTERNAL_PACKAGE],
561 _NL_WITH_PACKAGE([required], [external], [$1], [$2], [$3], [$4], [:], [$5])dnl
564 # NL_WITH_OPTIONAL_EXTERNAL_PACKAGE(PACKAGE-PRETTY-NAME,
565 # PACKAGE-VARIABLE-PREFIX,
566 # PACKAGE-SUCCINCT-NAME,
567 # [DEFAULT-PACKAGE-LIBS],
569 # ----------------------------------------------------------------------------
570 # This macro is used to test for the presence, with pkg-config if it
571 # is available, of the specified, optional external dependent package.
573 # Failure to find the dependent package will NOT result in a fatal error.
575 # The dependent package is specified in three forms:
577 # PACKAGE-PRETTY-NAME : The human-readable name by which the package
578 # will be referred for any diagnostic output. For
579 # example, "My Great Software Package".
580 # PACKAGE-VARIABLE-PREFIX : The package-specific prefix applied to variables
581 # defined as a result of running this macro for the
582 # packages. For example, "MGSP" here is transformed
583 # into MGSP_CPPFLAGS.
584 # PACKAGE-SUCCINCT-NAME : The package-specific name used for pkg-config,
585 # in temporary variables and on the
586 # configure command line. For example,
587 # "mgsp" here is used for --with-mgsp=DIR
588 # or 'pkg-config --cflags mgsp'.
590 # In addition, if any additional, default link libraries are required
591 # for use with the package, these are specified as:
593 # DEFAULT-PACKAGE-LIBS : Default link libraries required for use with
594 # the package. These are used if pkg-config is
595 # not available or cannot identify any
596 # such libraries. For example, '-lmgsp'.
598 # If the package is specified, optional actions are run.
600 # ACTIONS-TO-RUN-IF-FOUND : Optional actions to run if the package is found.
601 # ----------------------------------------------------------------------------
602 AC_DEFUN([NL_WITH_OPTIONAL_EXTERNAL_PACKAGE],
604 _NL_WITH_PACKAGE([optional], [external], [$1], [$2], [$3], [$4], [:], [$5])dnl
607 # NL_WITH_REQUIRED_INTERNAL_PACKAGE(PACKAGE-PRETTY-NAME,
608 # PACKAGE-VARIABLE-PREFIX,
609 # PACKAGE-SUCCINCT-NAME,
610 # [DEFAULT-PACKAGE-LIBS],
611 # [ACTIONS-TO-RUN-IF-NOT-EXTERNAL],
612 # [ACTIONS-TO-RUN-IF-NOT-INTERNAL])
613 # ----------------------------------------------------------------------------
614 # This macro is used to test for the presence, with pkg-config if it
615 # is available, of the specified, required dependent package. The dependent
616 # package may be provided externally or may exist within the current
619 # Failure to find the dependent package will result in a fatal error.
621 # The dependent package is specified in three forms:
623 # PACKAGE-PRETTY-NAME : The human-readable name by which the package
624 # will be referred for any diagnostic output. For
625 # example, "My Great Software Package".
626 # PACKAGE-VARIABLE-PREFIX : The package-specific prefix applied to variables
627 # defined as a result of running this macro for the
628 # packages. For example, "MGSP" here is transformed
629 # into MGSP_CPPFLAGS.
630 # PACKAGE-SUCCINCT-NAME : The package-specific name used for pkg-config,
631 # in temporary variables and on the
632 # configure command line. For example,
633 # "mgsp" here is used for --with-mgsp=DIR
634 # or 'pkg-config --cflags mgsp'.
636 # In addition, if any additional, default link libraries are required
637 # for use with the package, these are specified as:
639 # DEFAULT-PACKAGE-LIBS : Default link libraries required for use with
640 # the package. These are used if pkg-config is
641 # not available or cannot identify any
642 # such libraries. For example, '-lmgsp'.
644 # If the package is specified, either internally or externally, optional
647 # ACTIONS-TO-RUN-IF-NOT-EXTERNAL : Optional actions to run if the package
649 # ACTIONS-TO-RUN-IF-NOT-INTERNAL : Optional actions to run if the package
651 # ----------------------------------------------------------------------------
652 AC_DEFUN([NL_WITH_REQUIRED_INTERNAL_PACKAGE],
654 _NL_WITH_PACKAGE([required], [internal], [$1], [$2], [$3], [$4], [$5], [$6])dnl
657 # NL_WITH_OPTIONAL_INTERNAL_PACKAGE(PACKAGE-PRETTY-NAME,
658 # PACKAGE-VARIABLE-PREFIX,
659 # PACKAGE-SUCCINCT-NAME,
660 # [DEFAULT-PACKAGE-LIBS],
661 # [ACTIONS-TO-RUN-IF-NOT-EXTERNAL],
662 # [ACTIONS-TO-RUN-IF-NOT-INTERNAL])
663 # ----------------------------------------------------------------------------
664 # This macro is used to test for the presence, with pkg-config if it
665 # is available, of the specified, optional dependent package. The dependent
666 # package may be provided externally or may exist within the current
669 # Failure to find the dependent package will NOT result in a fatal error.
671 # The dependent package is specified in three forms:
673 # PACKAGE-PRETTY-NAME : The human-readable name by which the package
674 # will be referred for any diagnostic output. For
675 # example, "My Great Software Package".
676 # PACKAGE-VARIABLE-PREFIX : The package-specific prefix applied to variables
677 # defined as a result of running this macro for the
678 # packages. For example, "MGSP" here is transformed
679 # into MGSP_CPPFLAGS.
680 # PACKAGE-SUCCINCT-NAME : The package-specific name used for pkg-config,
681 # in temporary variables and on the
682 # configure command line. For example,
683 # "mgsp" here is used for --with-mgsp=DIR
684 # or 'pkg-config --cflags mgsp'.
686 # In addition, if any additional, default link libraries are required
687 # for use with the package, these are specified as:
689 # DEFAULT-PACKAGE-LIBS : Default link libraries required for use with
690 # the package. These are used if pkg-config is
691 # not available or cannot identify any
692 # such libraries. For example, '-lmgsp'.
694 # If the package is specified, either internally or externally, optional
697 # ACTIONS-TO-RUN-IF-NOT-EXTERNAL : Optional actions to run if the package
699 # ACTIONS-TO-RUN-IF-NOT-INTERNAL : Optional actions to run if the package
701 # ----------------------------------------------------------------------------
702 AC_DEFUN([NL_WITH_OPTIONAL_INTERNAL_PACKAGE],
704 _NL_WITH_PACKAGE([optional], [internal], [$1], [$2], [$3], [$4], [$5], [$6])dnl
707 # NL_WITH_PACKAGE(PACKAGE-PRETTY-NAME, PACKAGE-VARIABLE-PREFIX,
708 # PACKAGE-SUCCINCT-NAME, [DEFAULT-PACKAGE-LIBS],
709 # [ACTIONS-TO-RUN-IF-NOT-EXTERNAL],
710 # [ACTIONS-TO-RUN-IF-NOT-INTERNAL])
711 # ----------------------------------------------------------------------------
712 # This macro is used to test for the presence, with pkg-config if it
713 # is available, of the specified dependent package. The dependent
714 # package may be provided externally or may exist within the current
717 # The dependent package is specified in three forms:
719 # PACKAGE-PRETTY-NAME : The human-readable name by which the package
720 # will be referred for any diagnostic output. For
721 # example, "My Great Software Package".
722 # PACKAGE-VARIABLE-PREFIX : The package-specific prefix applied to variables
723 # defined as a result of running this macro for the
724 # packages. For example, "MGSP" here is transformed
725 # into MGSP_CPPFLAGS.
726 # PACKAGE-SUCCINCT-NAME : The package-specific name used for pkg-config,
727 # in temporary variables and on the
728 # configure command line. For example,
729 # "mgsp" here is used for --with-mgsp=DIR
730 # or 'pkg-config --cflags mgsp'.
732 # In addition, if any additional, default link libraries are required
733 # for use with the package, these are specified as:
735 # DEFAULT-PACKAGE-LIBS : Default link libraries required for use with
736 # the package. These are used if pkg-config is
737 # not available or cannot identify any
738 # such libraries. For example, '-lmgsp'.
740 # If the package is specified, either internally or externally, optional
743 # ACTIONS-TO-RUN-IF-NOT-EXTERNAL : Optional actions to run if the package
745 # ACTIONS-TO-RUN-IF-NOT-INTERNAL : Optional actions to run if the package
747 # ----------------------------------------------------------------------------
748 AC_DEFUN([NL_WITH_PACKAGE],
750 m4_warn(obsolete, [$0: this macro has been deprecated. Consider using NL_WITH_REQUIRED_INTERNAL_PACKAGE instead.])
752 NL_WITH_REQUIRED_INTERNAL_PACKAGE([$1], [$2], [$3], [$4], [$5], [$6])dnl