]> CyberLeo.Net >> Repos - FreeBSD/releng/10.0.git/blob - contrib/ntp/sntp/libopts/m4/libopts.m4
- Copy stable/10 (r259064) to releng/10.0 as part of the
[FreeBSD/releng/10.0.git] / contrib / ntp / sntp / libopts / m4 / libopts.m4
1 dnl  -*- buffer-read-only: t -*- vi: set ro:
2 dnl 
3 dnl DO NOT EDIT THIS FILE   (libopts.m4)
4 dnl 
5 dnl It has been AutoGen-ed  Saturday May  5, 2007 at 12:02:37 PM PDT
6 dnl From the definitions    libopts.def
7 dnl and the template file   conftest.tpl
8 dnl
9 dnl do always before generated macros:
10 dnl
11 AC_DEFUN([INVOKE_LIBOPTS_MACROS_FIRST],[
12 [if test X${INVOKE_LIBOPTS_MACROS_FIRST_done} != Xyes ; then]
13   # =================
14   # AC_HEADER_STDC
15   # =================
16   AC_HEADER_STDC
17   # =================
18   # AC_HEADER_DIRENT
19   # =================
20   AC_HEADER_DIRENT
21   
22   # =================
23   # AC_CHECK_HEADERS
24   # =================
25   AC_CHECK_HEADERS(dlfcn.h errno.h fcntl.h libgen.h memory.h netinet/in.h \
26     setjmp.h sys/mman.h sys/param.h sys/poll.h sys/procset.h sys/select.h \
27     sys/socket.h sys/stropts.h sys/time.h sys/un.h sys/wait.h unistd.h    \
28     utime.h sysexits.h)
29   
30   # --------------------------------------------
31   # Verify certain entries from AC_CHECK_HEADERS
32   # --------------------------------------------
33   [for f in sys_types sys_mman sys_param sys_stat sys_wait \
34            string errno stdlib memory setjmp
35   do eval as_ac_var=\${ac_cv_header_${f}_h+set}
36      test "${as_ac_var}" = set] || \
37        AC_MSG_ERROR([You must have ${f}.h on your system])
38   done
39   
40   # ================================================
41   # AC_CHECK_HEADERS: stdarg.h is present define HAVE_STDARG_H, otherwise
42   # if varargs.h is present define HAVE_VARARGS_H.
43   # ================================================
44   AC_CHECK_HEADERS(stdarg.h varargs.h, break)
45   [if test `eval echo '${'$as_ac_Header'}'` != yes; then]
46     AC_MSG_ERROR([You must have stdarg.h or varargs.h on your system])
47   fi
48   
49   # ================================================
50   # Similarly for the string.h and strings.h headers
51   # ================================================
52   AC_CHECK_HEADERS(string.h strings.h, break)
53   [if test `eval echo '${'$as_ac_Header'}'` != yes; then]
54     AC_MSG_ERROR([You must have string.h or strings.h on your system])
55   fi
56   
57   # =====================
58   # ...and limits headers
59   # =====================
60   AC_CHECK_HEADERS(limits.h sys/limits.h values.h, break)
61   [if test `eval echo '${'$as_ac_Header'}'` != yes; then]
62     AC_MSG_ERROR([You must have one of limits.h, sys/limits.h or values.h])
63   fi
64   
65   # ========================
66   # ...and int types headers
67   # ========================
68   AC_CHECK_HEADERS(stdint.h inttypes.h, break)
69   AC_CHECK_TYPES([int8_t, uint8_t, int16_t, uint16_t, int32_t, uint32_t,
70      intptr_t, uint_t])
71   
72   # ====================
73   # uintptr type & sizes
74   # ====================
75   AC_CHECK_TYPES([uintptr_t], ,
76          [AC_DEFINE([uintptr_t], unsigned long,
77                     [Alternate uintptr_t for systems without it.])])
78   AC_CHECK_SIZEOF(char*, 4)
79   AC_CHECK_SIZEOF(int,   4)
80   AC_CHECK_SIZEOF(long,  4)
81   AC_CHECK_SIZEOF(short, 2)
82   
83   # ----------------------------------------------------------------------
84   # AC_CHECK_LIB for SVR4 libgen, and use it if it defines pathfind.
85   # ----------------------------------------------------------------------
86   AC_CHECK_LIB(gen, pathfind)
87   AC_FUNC_VPRINTF
88   AC_CHECK_FUNCS([mmap canonicalize_file_name snprintf strdup strchr strrchr])
89 [  INVOKE_LIBOPTS_MACROS_FIRST_done=yes
90 fi]])
91
92 dnl
93 dnl @synopsis  INVOKE_LIBOPTS_MACROS
94 dnl
95 dnl  This macro will invoke the AutoConf macros specified in libopts.def
96 dnl  that have not been disabled with "omit-invocation".
97 dnl
98 AC_DEFUN([LIBOPTS_WITH_REGEX_HEADER],[
99   AC_ARG_WITH([regex-header],
100     AC_HELP_STRING([--with-regex-header], [a reg expr header is specified]),
101     [libopts_cv_with_regex_header=${with_regex_header}],
102     AC_CACHE_CHECK([whether a reg expr header is specified], libopts_cv_with_regex_header,
103       libopts_cv_with_regex_header=no)
104   ) # end of AC_ARG_WITH
105
106   if test "X${libopts_cv_with_regex_header}" != Xno
107   then
108     AC_DEFINE_UNQUOTED([REGEX_HEADER],[<${libopts_cv_with_regex_header}>])
109   else
110     AC_DEFINE([REGEX_HEADER],[<regex.h>],[name of regex header file])
111   fi
112   
113 ]) # end of AC_DEFUN of LIBOPTS_WITH_REGEX_HEADER
114
115
116 AC_DEFUN([LIBOPTS_WITHLIB_REGEX],[
117   AC_ARG_WITH([libregex],
118     AC_HELP_STRING([--with-libregex], [libregex installation prefix]),
119     [libopts_cv_with_libregex_root=${with_libregex}],
120     AC_CACHE_CHECK([whether with-libregex was specified], libopts_cv_with_libregex_root,
121       libopts_cv_with_libregex_root=no)
122   ) # end of AC_ARG_WITH libregex
123
124   if test "${with_libguile+set}" = set && \
125      test "${withval}" = no
126   then ## disabled by request
127     libopts_cv_with_libregex_root=no
128     libopts_cv_with_libregex_cflags=no
129     libopts_cv_with_libregex_libs=no
130   else
131
132   AC_ARG_WITH([libregex-cflags],
133     AC_HELP_STRING([--with-libregex-cflags], [libregex compile flags]),
134     [libopts_cv_with_libregex_cflags=${with_regex_cflags}],
135     AC_CACHE_CHECK([whether with-libregex-cflags was specified], libopts_cv_with_libregex_cflags,
136       libopts_cv_with_libregex_cflags=no)
137   ) # end of AC_ARG_WITH libregex-cflags
138
139   AC_ARG_WITH([libregex-libs],
140     AC_HELP_STRING([--with-libregex-libs], [libregex link command arguments]),
141     [libopts_cv_with_libregex_libs=${with_regex_libs}],
142     AC_CACHE_CHECK([whether with-libregex-libs was specified], libopts_cv_with_libregex_libs,
143       libopts_cv_with_libregex_libs=no)
144   ) # end of AC_ARG_WITH libregex-libs
145
146   case "X${libopts_cv_with_libregex_cflags}" in
147   Xyes|Xno|X )
148     case "X${libopts_cv_with_libregex_root}" in
149     Xyes|Xno|X ) libopts_cv_with_libregex_cflags=no ;;
150     * )        libopts_cv_with_libregex_cflags=-I${libopts_cv_with_libregex_root}/include ;;
151     esac
152   esac
153   case "X${libopts_cv_with_libregex_libs}" in
154   Xyes|Xno|X )
155     case "X${libopts_cv_with_libregex_root}" in
156     Xyes|Xno|X ) libopts_cv_with_libregex_libs=no ;;
157     * )        libopts_cv_with_libregex_libs="-L${libopts_cv_with_libregex_root}/lib -lregex";;
158     esac
159   esac
160   libopts_save_CPPFLAGS="${CPPFLAGS}"
161   libopts_save_LIBS="${LIBS}"
162   fi ## disabled by request
163
164   case "X${libopts_cv_with_libregex_cflags}" in
165   Xyes|Xno|X )
166     libopts_cv_with_libregex_cflags="" ;;
167   * ) CPPFLAGS="${CPPFLAGS} ${libopts_cv_with_libregex_cflags}" ;;
168   esac
169   case "X${libopts_cv_with_libregex_libs}" in
170   Xyes|Xno|X )
171     libopts_cv_with_libregex_libs="" ;;
172   * )
173     LIBS="${LIBS} ${libopts_cv_with_libregex_libs}" ;;
174   esac
175   LIBREGEX_CFLAGS=""
176   LIBREGEX_LIBS=""
177   AC_MSG_CHECKING([whether libregex functions properly])
178   AC_CACHE_VAL([libopts_cv_with_libregex],[
179   AC_TRY_RUN([@%:@include <stdio.h>
180 @%:@include <stdlib.h>
181 @%:@include <sys/types.h>
182 @%:@include REGEX_HEADER
183 static regex_t re;
184 void comp_re( char const* pzPat ) {
185   int res = regcomp( &re, pzPat, REG_EXTENDED|REG_ICASE|REG_NEWLINE );
186   if (res == 0) return;
187   exit( res ); }
188 int main() {
189   regmatch_t m@<:@2@:>@;
190   comp_re( "^.*\@S|@"   );
191   comp_re( "()|no.*" );
192   comp_re( "."       );
193   if (regexec( &re, "X", 2, m, 0 ) != 0)  return 1;
194   if ((m@<:@0@:>@.rm_so != 0) || (m@<:@0@:>@.rm_eo != 1)) {
195     fputs( "error: regex -->.<-- did not match\n", stderr );
196     return 1;
197   }
198   return 0; }],
199     [libopts_cv_with_libregex=yes], [libopts_cv_with_libregex=no],
200     [libopts_cv_with_libregex=no]) # end of AC_TRY_RUN 
201   ]) # end of AC_CACHE_VAL for libopts_cv_with_libregex
202   AC_MSG_RESULT([${libopts_cv_with_libregex}])
203
204   if test "X${libopts_cv_with_libregex}" != Xno
205   then
206     AC_DEFINE([WITH_LIBREGEX],[1],
207         [Define this if a working libregex can be found])
208   else
209     CPPFLAGS="${libopts_save_CPPFLAGS}"
210     LIBS="${libopts_save_LIBS}"
211   fi
212   
213 ]) # end of AC_DEFUN of LIBOPTS_WITHLIB_REGEX
214
215
216 AC_DEFUN([LIBOPTS_RUN_PATHFIND],[
217   AC_MSG_CHECKING([whether pathfind(3) works])
218   AC_CACHE_VAL([libopts_cv_run_pathfind],[
219   AC_TRY_RUN([@%:@include <string.h>
220 @%:@include <stdlib.h>
221 int main (int argc, char** argv) {
222    char* pz = pathfind( getenv( "PATH" ), "sh", "x" );
223    return (pz == 0) ? 1 : 0;
224 }],
225     [libopts_cv_run_pathfind=yes],[libopts_cv_run_pathfind=no],[libopts_cv_run_pathfind=no]
226   ) # end of TRY_RUN
227   ]) # end of AC_CACHE_VAL for libopts_cv_run_pathfind
228   AC_MSG_RESULT([${libopts_cv_run_pathfind}])
229
230   if test "X${libopts_cv_run_pathfind}" != Xno
231   then
232     AC_DEFINE([HAVE_PATHFIND],[1],
233         [Define this if pathfind(3) works])
234   fi
235   
236 ]) # end of AC_DEFUN of LIBOPTS_RUN_PATHFIND
237
238
239 AC_DEFUN([LIBOPTS_TEST_DEV_ZERO],[
240   AC_MSG_CHECKING([whether /dev/zero is readable device])
241   AC_CACHE_VAL([libopts_cv_test_dev_zero],[
242     libopts_cv_test_dev_zero=`exec 2> /dev/null
243 dzero=\`ls -lL /dev/zero | egrep ^c......r\`
244 test -z "${dzero}" && exit 1
245 echo ${dzero}`
246     if test $? -ne 0
247     then libopts_cv_test_dev_zero=no
248     elif test -z "$libopts_cv_test_dev_zero"
249     then libopts_cv_test_dev_zero=no
250     fi
251   ]) # end of CACHE_VAL of libopts_cv_test_dev_zero
252   AC_MSG_RESULT([${libopts_cv_test_dev_zero}])
253
254   if test "X${libopts_cv_test_dev_zero}" != Xno
255   then
256     AC_DEFINE([HAVE_DEV_ZERO],[1],
257         [Define this if /dev/zero is readable device])
258   fi
259   
260 ]) # end of AC_DEFUN of LIBOPTS_TEST_DEV_ZERO
261
262
263 AC_DEFUN([LIBOPTS_RUN_REALPATH],[
264   AC_MSG_CHECKING([whether we have a functional realpath(3C)])
265   AC_CACHE_VAL([libopts_cv_run_realpath],[
266   AC_TRY_RUN([@%:@include <limits.h>
267 @%:@include <stdlib.h>
268 int main (int argc, char** argv) {
269 @%:@ifndef PATH_MAX
270 choke me!!
271 @%:@else
272    char zPath@<:@PATH_MAX+1@:>@;
273 @%:@endif
274    char *pz = realpath(argv@<:@0@:>@, zPath);
275    return (pz == zPath) ? 0 : 1;
276 }],
277     [libopts_cv_run_realpath=yes],[libopts_cv_run_realpath=no],[libopts_cv_run_realpath=no]
278   ) # end of TRY_RUN
279   ]) # end of AC_CACHE_VAL for libopts_cv_run_realpath
280   AC_MSG_RESULT([${libopts_cv_run_realpath}])
281
282   if test "X${libopts_cv_run_realpath}" != Xno
283   then
284     AC_DEFINE([HAVE_REALPATH],[1],
285         [Define this if we have a functional realpath(3C)])
286   fi
287   
288 ]) # end of AC_DEFUN of LIBOPTS_RUN_REALPATH
289
290
291 AC_DEFUN([LIBOPTS_RUN_STRFTIME],[
292   AC_MSG_CHECKING([whether strftime() works])
293   AC_CACHE_VAL([libopts_cv_run_strftime],[
294   AC_TRY_RUN([@%:@include <time.h>
295 @%:@include <string.h>
296 char t_buf@<:@ 64 @:>@;
297 int main() {
298   static char const z@<:@@:>@ = "Thursday Aug 28 240";
299   struct tm tm;
300   tm.tm_sec   = 36;  /* seconds after the minute @<:@0, 61@:>@  */
301   tm.tm_min   = 44;  /* minutes after the hour @<:@0, 59@:>@ */
302   tm.tm_hour  = 12;  /* hour since midnight @<:@0, 23@:>@ */
303   tm.tm_mday  = 28;  /* day of the month @<:@1, 31@:>@ */
304   tm.tm_mon   =  7;  /* months since January @<:@0, 11@:>@ */
305   tm.tm_year  = 86;  /* years since 1900 */
306   tm.tm_wday  =  4;  /* days since Sunday @<:@0, 6@:>@ */
307   tm.tm_yday  = 239; /* days since January 1 @<:@0, 365@:>@ */
308   tm.tm_isdst =  1;  /* flag for daylight savings time */
309   strftime( t_buf, sizeof( t_buf ), "%A %b %d %j", &tm );
310   return (strcmp( t_buf, z ) != 0); }],
311     [libopts_cv_run_strftime=yes],[libopts_cv_run_strftime=no],[libopts_cv_run_strftime=no]
312   ) # end of TRY_RUN
313   ]) # end of AC_CACHE_VAL for libopts_cv_run_strftime
314   AC_MSG_RESULT([${libopts_cv_run_strftime}])
315
316   if test "X${libopts_cv_run_strftime}" != Xno
317   then
318     AC_DEFINE([HAVE_STRFTIME],[1],
319         [Define this if strftime() works])
320   fi
321   
322 ]) # end of AC_DEFUN of LIBOPTS_RUN_STRFTIME
323
324
325 AC_DEFUN([LIBOPTS_RUN_FOPEN_BINARY],[
326   AC_MSG_CHECKING([whether fopen accepts "b" mode])
327   AC_CACHE_VAL([libopts_cv_run_fopen_binary],[
328   AC_TRY_RUN([@%:@include <stdio.h>
329 int main (int argc, char** argv) {
330 FILE* fp = fopen("conftest.@S|@ac_ext", "rb");
331 return (fp == NULL) ? 1 : fclose(fp); }],
332     [libopts_cv_run_fopen_binary=yes],[libopts_cv_run_fopen_binary=no],[libopts_cv_run_fopen_binary=no]
333   ) # end of TRY_RUN
334   ]) # end of AC_CACHE_VAL for libopts_cv_run_fopen_binary
335   AC_MSG_RESULT([${libopts_cv_run_fopen_binary}])
336
337   if test "X${libopts_cv_run_fopen_binary}" != Xno
338   then
339     AC_DEFINE([FOPEN_BINARY_FLAG],"b",
340         [fopen(3) accepts a 'b' in the mode flag])
341   else
342     AC_DEFINE([FOPEN_BINARY_FLAG],"",
343         [fopen(3) accepts a 'b' in the mode flag])
344   fi
345   
346 ]) # end of AC_DEFUN of LIBOPTS_RUN_FOPEN_BINARY
347
348
349 AC_DEFUN([LIBOPTS_RUN_FOPEN_TEXT],[
350   AC_MSG_CHECKING([whether fopen accepts "t" mode])
351   AC_CACHE_VAL([libopts_cv_run_fopen_text],[
352   AC_TRY_RUN([@%:@include <stdio.h>
353 int main (int argc, char** argv) {
354 FILE* fp = fopen("conftest.@S|@ac_ext", "rt");
355 return (fp == NULL) ? 1 : fclose(fp); }],
356     [libopts_cv_run_fopen_text=yes],[libopts_cv_run_fopen_text=no],[libopts_cv_run_fopen_text=no]
357   ) # end of TRY_RUN
358   ]) # end of AC_CACHE_VAL for libopts_cv_run_fopen_text
359   AC_MSG_RESULT([${libopts_cv_run_fopen_text}])
360
361   if test "X${libopts_cv_run_fopen_text}" != Xno
362   then
363     AC_DEFINE([FOPEN_TEXT_FLAG],"t",
364         [fopen(3) accepts a 't' in the mode flag])
365   else
366     AC_DEFINE([FOPEN_TEXT_FLAG],"",
367         [fopen(3) accepts a 't' in the mode flag])
368   fi
369   
370 ]) # end of AC_DEFUN of LIBOPTS_RUN_FOPEN_TEXT
371
372
373 AC_DEFUN([LIBOPTS_DISABLE_OPTIONAL_ARGS],[
374   AC_ARG_ENABLE([optional-args],
375     AC_HELP_STRING([--disable-optional-args], [not wanting optional option args]),
376     [libopts_cv_enable_optional_args=${enable_optional_args}],
377     AC_CACHE_CHECK([whether not wanting optional option args], libopts_cv_enable_optional_args,
378       libopts_cv_enable_optional_args=yes)
379   ) # end of AC_ARG_ENABLE
380
381   if test "X${libopts_cv_enable_optional_args}" = Xno
382   then
383     AC_DEFINE([NO_OPTIONAL_OPT_ARGS], [1],
384           [Define this if optional arguments are disallowed])
385   fi
386   
387 ]) # end of AC_DEFUN of LIBOPTS_DISABLE_OPTIONAL_ARGS
388
389
390 AC_DEFUN([INVOKE_LIBOPTS_MACROS],[
391   INVOKE_LIBOPTS_MACROS_FIRST
392   # Check to see if a reg expr header is specified.
393   LIBOPTS_WITH_REGEX_HEADER
394
395   # Check to see if a working libregex can be found.
396   LIBOPTS_WITHLIB_REGEX
397
398   # Check to see if pathfind(3) works.
399   LIBOPTS_RUN_PATHFIND
400
401   # Check to see if /dev/zero is readable device.
402   LIBOPTS_TEST_DEV_ZERO
403
404   # Check to see if we have a functional realpath(3C).
405   LIBOPTS_RUN_REALPATH
406
407   # Check to see if strftime() works.
408   LIBOPTS_RUN_STRFTIME
409
410   # Check to see if fopen accepts "b" mode.
411   LIBOPTS_RUN_FOPEN_BINARY
412
413   # Check to see if fopen accepts "t" mode.
414   LIBOPTS_RUN_FOPEN_TEXT
415
416   # Check to see if not wanting optional option args.
417   LIBOPTS_DISABLE_OPTIONAL_ARGS
418
419 ]) # end AC_DEFUN of INVOKE_LIBOPTS_MACROS
420
421 dnl @synopsis  LIBOPTS_CHECK
422 dnl
423 dnl Time-stamp:        "2006-09-23 19:36:24 bkorb"
424 dnl Last Committed:    $Date: 2006/09/24 02:59:00 $
425 dnl
426 dnl If autoopts-config works, add the linking information to LIBS.
427 dnl Otherwise, add ``libopts-${ao_rev}'' to SUBDIRS and run all
428 dnl the config tests that the library needs.  Invoke the
429 dnl "INVOKE_LIBOPTS_MACROS" macro iff we are building libopts.
430 dnl
431 dnl Default to system libopts
432 dnl
433 AC_DEFUN([LIBOPTS_CHECK],[
434   [NEED_LIBOPTS_DIR='']
435   m4_pushdef([AO_Libopts_Dir],
436             [ifelse($1, , [libopts], [$1])])
437   AC_SUBST(LIBOPTS_DIR, AO_Libopts_Dir)
438   AC_ARG_ENABLE([local-libopts],
439     AC_HELP_STRING([--enable-local-libopts],
440        [Force using the supplied libopts tearoff code]),[
441     if test x$enableval = xyes ; then
442        AC_MSG_NOTICE([Using supplied libopts tearoff])
443        LIBOPTS_LDADD='$(top_builddir)/AO_Libopts_Dir/libopts.la'
444        LIBOPTS_CFLAGS='-I$(top_srcdir)/AO_Libopts_Dir'
445        NEED_LIBOPTS_DIR=true
446     fi])
447
448   AC_ARG_ENABLE([libopts-install],
449     AC_HELP_STRING([--disable-libopts-install],
450        [Do not install libopts with client installation]))
451   AM_CONDITIONAL([INSTALL_LIBOPTS],[test "X${enable_libopts_install}" != Xno])
452
453   [if test -z "${NEED_LIBOPTS_DIR}" ; then]
454      AC_MSG_CHECKING([whether autoopts-config can be found])
455      AC_ARG_WITH([autoopts-config],
456         AC_HELP_STRING([--with-autoopts-config],
457              [specify the config-info script]),
458         [lo_cv_with_autoopts_config=${with_autoopts_config}],
459         AC_CACHE_CHECK([whether autoopts-config is specified],
460              [lo_cv_with_autoopts_config],
461              [if autoopts-config --help 2>/dev/null 1>&2
462         then lo_cv_with_autoopts_config=autoopts-config
463         elif libopts-config --help 2>/dev/null 1>&2
464         then lo_cv_with_autoopts_config=libopts-config
465         else lo_cv_with_autoopts_config=no ; fi])
466      ) # end of AC_ARG_WITH
467
468      AC_CACHE_VAL([lo_cv_test_autoopts],[
469         if test -z "${lo_cv_with_autoopts_config}" \
470                 -o X"${lo_cv_with_autoopts_config}" = Xno
471         then
472            if autoopts-config --help 2>/dev/null 1>&2
473            then lo_cv_with_autoopts_config=autoopts-config
474            elif libopts-config --help 2>/dev/null 1>&2
475            then lo_cv_with_autoopts_config=libopts-config
476            else lo_cv_with_autoopts_config=false ; fi
477         fi
478         lo_cv_test_autoopts=`
479             ${lo_cv_with_autoopts_config} --libs` 2> /dev/null
480         if test $? -ne 0 -o -z "${lo_cv_test_autoopts}"
481         then lo_cv_test_autoopts=no ; fi
482      ]) # end of CACHE_VAL
483      AC_MSG_RESULT([${lo_cv_test_autoopts}])
484
485      [if test "X${lo_cv_test_autoopts}" != Xno
486      then
487         LIBOPTS_LDADD="${lo_cv_test_autoopts}"
488         LIBOPTS_CFLAGS="`${lo_cv_with_autoopts_config} --cflags`"
489      else
490         LIBOPTS_LDADD='$(top_builddir)/]AO_Libopts_Dir[/libopts.la'
491         LIBOPTS_CFLAGS='-I$(top_srcdir)/]AO_Libopts_Dir['
492         NEED_LIBOPTS_DIR=true
493      fi
494   fi # end of if test -z "${NEED_LIBOPTS_DIR}"]
495
496   AM_CONDITIONAL([NEED_LIBOPTS], [test -n "${NEED_LIBOPTS_DIR}"])
497   AC_SUBST(LIBOPTS_LDADD)
498   AC_SUBST(LIBOPTS_CFLAGS)
499   AC_SUBST(LIBOPTS_DIR, AO_Libopts_Dir)
500   AC_CONFIG_FILES(AO_Libopts_Dir/Makefile)
501   m4_popdef([AO_Libopts_Dir])
502
503   [if test -n "${NEED_LIBOPTS_DIR}" ; then]
504     INVOKE_LIBOPTS_MACROS
505   else
506     INVOKE_LIBOPTS_MACROS_FIRST
507   [fi
508 # end of AC_DEFUN of LIBOPTS_CHECK]
509 ])