mirror of
https://github.com/gcc-mirror/gcc.git
synced 2024-11-21 13:40:47 +00:00
PR modula2/111530: Build failure on BSD due to getopt_long_only GNU extension dependency
This patch uses the libiberty getopt long functions (wrapped up inside libgm2/libm2pim/cgetopt.cc) and only enables this implementation if libgm2/configure.ac detects no getopt_long and friends on the target. gcc/m2/ChangeLog: PR modula2/111530 * gm2-libs-ch/cgetopt.c (cgetopt_cgetopt_long): Re-format. (cgetopt_cgetopt_long_only): Re-format. (cgetopt_SetOption): Re-format and assign flag to NULL if name is also NULL. * gm2-libs/GetOpt.def (AddLongOption): Add index parameter and change flag to be a VAR parameter rather than a pointer. (GetOptLong): Re-format. (GetOpt): Correct comment. * gm2-libs/GetOpt.mod: Re-write to rely on cgetopt rather than implement long option creation in GetOpt. * gm2-libs/cgetopt.def (SetOption): has_arg type is INTEGER. libgm2/ChangeLog: PR modula2/111530 * Makefile.in: Regenerate. * aclocal.m4: Regenerate. * config.h.in: Regenerate. * configure: Regenerate. * configure.ac (AC_CHECK_HEADERS): Include getopt.h. (GM2_CHECK_LIB): getopt_long check. (GM2_CHECK_LIB): getopt_long_only check. * libm2cor/Makefile.in: Regenerate. * libm2iso/Makefile.in: Regenerate. * libm2log/Makefile.in: Regenerate. * libm2min/Makefile.in: Regenerate. * libm2pim/Makefile.in: Regenerate. * libm2pim/cgetopt.cc: Re-write using conditional on configure and long function code from libiberty/getopt.c. gcc/testsuite/ChangeLog: PR modula2/111530 * gm2/pimlib/run/pass/testgetopt.mod: New test. Signed-off-by: Gaius Mulley <gaiusmod2@gmail.com>
This commit is contained in:
parent
7bcdb777e6
commit
e5f6a5ad7c
@ -59,7 +59,7 @@ cgetopt_getopt (int argc, char *argv[], char *optstring)
|
||||
|
||||
int
|
||||
cgetopt_cgetopt_long (int argc, char *argv[], char *optstring, const struct option *longopts,
|
||||
int *longindex)
|
||||
int *longindex)
|
||||
{
|
||||
int r = getopt_long (argc, argv, optstring, longopts, longindex);
|
||||
|
||||
@ -74,7 +74,7 @@ cgetopt_cgetopt_long (int argc, char *argv[], char *optstring, const struct opti
|
||||
|
||||
int
|
||||
cgetopt_cgetopt_long_only (int argc, char *argv[], char *optstring,
|
||||
const struct option *longopts, int *longindex)
|
||||
const struct option *longopts, int *longindex)
|
||||
{
|
||||
int r = getopt_long_only (argc, argv, optstring, longopts, longindex);
|
||||
|
||||
@ -121,8 +121,8 @@ cgetopt_KillOptions (cgetopt_Options *o)
|
||||
|
||||
void
|
||||
cgetopt_SetOption (cgetopt_Options *o, unsigned int index,
|
||||
char *name, bool has_arg,
|
||||
int *flag, int val)
|
||||
char *name, int has_arg,
|
||||
int *flag, int val)
|
||||
{
|
||||
if (index > o->high)
|
||||
{
|
||||
@ -131,6 +131,8 @@ cgetopt_SetOption (cgetopt_Options *o, unsigned int index,
|
||||
}
|
||||
o->cinfo[index].name = name;
|
||||
o->cinfo[index].has_arg = has_arg;
|
||||
if (name == NULL)
|
||||
flag = NULL;
|
||||
o->cinfo[index].flag = flag;
|
||||
o->cinfo[index].val = val;
|
||||
}
|
||||
|
@ -40,7 +40,7 @@ TYPE
|
||||
|
||||
(*
|
||||
GetOpt - call C getopt and fill in the parameters:
|
||||
optarg, optind, opterr and optop.
|
||||
optarg, optind, opterr and optopt.
|
||||
*)
|
||||
|
||||
PROCEDURE GetOpt (argc: INTEGER; argv: ADDRESS; optstring: String;
|
||||
@ -83,13 +83,12 @@ PROCEDURE InitLongOptions () : LongOptions ;
|
||||
val is the value to return, or to load into the variable
|
||||
pointed to by flag.
|
||||
|
||||
The last element of the array has to be filled with zeros.
|
||||
The last element of the array must be filled with zeros.
|
||||
*)
|
||||
|
||||
PROCEDURE AddLongOption (lo: LongOptions;
|
||||
PROCEDURE AddLongOption (lo: LongOptions; index: CARDINAL;
|
||||
name: String; has_arg: INTEGER;
|
||||
flag: PtrToInteger;
|
||||
val: INTEGER) : LongOptions ;
|
||||
VAR flag: INTEGER; val: INTEGER) : LongOptions ;
|
||||
|
||||
|
||||
(*
|
||||
@ -106,8 +105,8 @@ PROCEDURE KillLongOptions (lo: LongOptions) : LongOptions ;
|
||||
then optstring should be an empty string, not NIL.
|
||||
*)
|
||||
|
||||
PROCEDURE GetOptLong (argc: INTEGER; argv: ADDRESS; optstring: String;
|
||||
longopts: LongOptions;
|
||||
PROCEDURE GetOptLong (argc: INTEGER; argv: ADDRESS;
|
||||
optstring: String; longopts: LongOptions;
|
||||
VAR longindex: INTEGER) : INTEGER ;
|
||||
|
||||
|
||||
|
@ -34,19 +34,8 @@ IMPORT cgetopt ;
|
||||
|
||||
|
||||
TYPE
|
||||
Crecord = RECORD (* see man 3 getopt. *)
|
||||
name : ADDRESS ;
|
||||
has_arg: INTEGER ;
|
||||
flag : PtrToInteger ;
|
||||
val : INTEGER ;
|
||||
END ;
|
||||
|
||||
ptrToCrecord = POINTER TO Crecord ;
|
||||
|
||||
LongOptions = POINTER TO RECORD
|
||||
cptr: ptrToCrecord ;
|
||||
len : CARDINAL ;
|
||||
size: CARDINAL ;
|
||||
cptr: cgetopt.Options
|
||||
END ;
|
||||
|
||||
|
||||
@ -79,9 +68,7 @@ VAR
|
||||
BEGIN
|
||||
NEW (lo) ;
|
||||
WITH lo^ DO
|
||||
cptr := NIL ;
|
||||
len := 0 ;
|
||||
size := 0
|
||||
cptr := cgetopt.InitOptions ()
|
||||
END ;
|
||||
RETURN lo
|
||||
END InitLongOptions ;
|
||||
@ -110,69 +97,25 @@ END InitLongOptions ;
|
||||
|
||||
val is the value to return, or to load into the variable pointed to by flag.
|
||||
|
||||
The last element of the array has to be filled with zeros.
|
||||
The last element of the array must be filled with zeros.
|
||||
*)
|
||||
|
||||
PROCEDURE AddLongOption (lo: LongOptions;
|
||||
PROCEDURE AddLongOption (lo: LongOptions; index: CARDINAL;
|
||||
name: String; has_arg: INTEGER;
|
||||
flag: PtrToInteger; val: INTEGER) : LongOptions ;
|
||||
VAR
|
||||
old,
|
||||
entry: ptrToCrecord ;
|
||||
VAR flag: INTEGER; val: INTEGER) : LongOptions ;
|
||||
BEGIN
|
||||
IF lo^.cptr = NIL
|
||||
THEN
|
||||
NEW (lo^.cptr) ;
|
||||
lo^.len := 1 ;
|
||||
lo^.size := SIZE (Crecord) ;
|
||||
entry := lo^.cptr
|
||||
ELSE
|
||||
old := lo^.cptr ;
|
||||
INC (lo^.len) ;
|
||||
lo^.size := lo^.len * SIZE (Crecord) ;
|
||||
REALLOCATE (lo^.cptr, lo^.size) ;
|
||||
IF lo^.cptr = NIL
|
||||
THEN
|
||||
entry := NIL
|
||||
ELSIF old = lo^.cptr
|
||||
THEN
|
||||
entry := lo^.cptr ;
|
||||
INC (entry, SIZE (Crecord) * lo^.len-1)
|
||||
ELSE
|
||||
MemCopy (old, lo^.len-1, lo^.cptr) ;
|
||||
entry := lo^.cptr ;
|
||||
INC (entry, SIZE (Crecord) * lo^.len-1)
|
||||
END
|
||||
END ;
|
||||
fillIn (entry, name, has_arg, flag, val) ;
|
||||
cgetopt.SetOption (lo^.cptr, index, name, has_arg, flag, val) ;
|
||||
RETURN lo
|
||||
END AddLongOption ;
|
||||
|
||||
|
||||
(*
|
||||
fillIn - fills in
|
||||
*)
|
||||
|
||||
PROCEDURE fillIn (entry: ptrToCrecord;
|
||||
name: String; has_arg: INTEGER; flag: PtrToInteger; val: INTEGER) ;
|
||||
BEGIN
|
||||
IF entry # NIL
|
||||
THEN
|
||||
entry^.name := name ;
|
||||
entry^.has_arg := has_arg ;
|
||||
entry^.flag := flag ;
|
||||
entry^.val := val
|
||||
END
|
||||
END fillIn ;
|
||||
|
||||
|
||||
(*
|
||||
KillLongOptions - returns NIL and also frees up memory associated with, lo.
|
||||
*)
|
||||
|
||||
PROCEDURE KillLongOptions (lo: LongOptions) : LongOptions ;
|
||||
BEGIN
|
||||
DEALLOCATE (lo^.cptr, lo^.size) ;
|
||||
lo^.cptr := cgetopt.KillOptions (lo^.cptr) ;
|
||||
DISPOSE (lo) ;
|
||||
RETURN NIL
|
||||
END KillLongOptions ;
|
||||
@ -186,11 +129,9 @@ END KillLongOptions ;
|
||||
|
||||
PROCEDURE GetOptLong (argc: INTEGER; argv: ADDRESS; optstring: String;
|
||||
longopts: LongOptions; VAR longindex: INTEGER) : INTEGER ;
|
||||
VAR
|
||||
r: INTEGER ;
|
||||
BEGIN
|
||||
r := cgetopt.getopt_long (argc, argv, string (optstring), longopts^.cptr, longindex) ;
|
||||
RETURN r
|
||||
RETURN cgetopt.getopt_long (argc, argv, string (optstring),
|
||||
cgetopt.GetLongOptionArray (longopts^.cptr), longindex)
|
||||
END GetOptLong ;
|
||||
|
||||
|
||||
@ -201,12 +142,9 @@ END GetOptLong ;
|
||||
|
||||
PROCEDURE GetOptLongOnly (argc: INTEGER; argv: ADDRESS; optstring: String;
|
||||
longopts: LongOptions; VAR longindex: INTEGER) : INTEGER ;
|
||||
VAR
|
||||
r: INTEGER ;
|
||||
BEGIN
|
||||
r := cgetopt.getopt_long_only (argc, argv, string (optstring),
|
||||
longopts^.cptr, longindex) ;
|
||||
RETURN r
|
||||
RETURN cgetopt.getopt_long_only (argc, argv, string (optstring),
|
||||
cgetopt.GetLongOptionArray (longopts^.cptr), longindex)
|
||||
END GetOptLongOnly ;
|
||||
|
||||
|
||||
|
@ -28,7 +28,6 @@ DEFINITION MODULE cgetopt ;
|
||||
|
||||
FROM SYSTEM IMPORT ADDRESS ;
|
||||
|
||||
|
||||
TYPE
|
||||
Options = ADDRESS ;
|
||||
|
||||
@ -92,7 +91,7 @@ PROCEDURE KillOptions (o: Options) : Options ;
|
||||
*)
|
||||
|
||||
PROCEDURE SetOption (o: Options; index: CARDINAL;
|
||||
name: ADDRESS; has_arg: BOOLEAN;
|
||||
name: ADDRESS; has_arg: INTEGER;
|
||||
VAR flag: INTEGER; val: INTEGER) ;
|
||||
|
||||
|
||||
|
74
gcc/testsuite/gm2/pimlib/run/pass/testgetopt.mod
Normal file
74
gcc/testsuite/gm2/pimlib/run/pass/testgetopt.mod
Normal file
@ -0,0 +1,74 @@
|
||||
MODULE testgetopt ;
|
||||
|
||||
FROM libc IMPORT printf, exit ;
|
||||
FROM GetOpt IMPORT InitLongOptions, KillLongOptions, AddLongOption,
|
||||
GetOptLong, PtrToInteger, LongOptions ;
|
||||
FROM DynamicStrings IMPORT String, InitString, string ;
|
||||
IMPORT UnixArgs ;
|
||||
FROM Storage IMPORT ALLOCATE ;
|
||||
FROM SYSTEM IMPORT ADR ;
|
||||
|
||||
|
||||
(*
|
||||
Assert -
|
||||
*)
|
||||
|
||||
PROCEDURE Assert (condition: BOOLEAN) ;
|
||||
BEGIN
|
||||
IF NOT condition
|
||||
THEN
|
||||
printf ("assert failed, condition is false\n") ;
|
||||
exit (1)
|
||||
END
|
||||
END Assert ;
|
||||
|
||||
|
||||
|
||||
(*
|
||||
test -
|
||||
*)
|
||||
|
||||
PROCEDURE test ;
|
||||
VAR
|
||||
result : INTEGER ;
|
||||
optstring: String ;
|
||||
i, val : INTEGER ;
|
||||
ch : CHAR ;
|
||||
BEGIN
|
||||
longopts := AddLongOption (longopts, 0, InitString ('help'), 0, result, 0) ;
|
||||
longopts := AddLongOption (longopts, 1, InitString ('dir'), 1, result, 0) ;
|
||||
longopts := AddLongOption (longopts, 2, NIL, 0, result, 0) ;
|
||||
optstring := InitString ('hd:') ;
|
||||
i := 1 ;
|
||||
REPEAT
|
||||
val := GetOptLong (UnixArgs.GetArgC (), UnixArgs.GetArgV (),
|
||||
optstring, longopts, i) ;
|
||||
IF val = 0
|
||||
THEN
|
||||
printf ("long option detected, result = %d, val = %d, index i = %d, optstring = %s\n",
|
||||
result, val, i, string (optstring))
|
||||
ELSIF val > 0
|
||||
THEN
|
||||
ch := VAL (CHAR, val) ;
|
||||
CASE ch OF
|
||||
|
||||
'h': printf ("short option 'h' seen\n")
|
||||
|
||||
ELSE
|
||||
printf ("unknown short option '%c' seen\n", ch)
|
||||
END
|
||||
ELSE
|
||||
printf ("unknown long option\n")
|
||||
END ;
|
||||
INC (i)
|
||||
UNTIL val <= 0
|
||||
END test ;
|
||||
|
||||
|
||||
VAR
|
||||
longopts: LongOptions ;
|
||||
BEGIN
|
||||
longopts := InitLongOptions () ;
|
||||
test ;
|
||||
longopts := KillLongOptions (longopts)
|
||||
END testgetopt.
|
@ -90,15 +90,15 @@ host_triplet = @host@
|
||||
target_triplet = @target@
|
||||
subdir = .
|
||||
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
|
||||
am__aclocal_m4_deps = $(top_srcdir)/../config/acx.m4 \
|
||||
am__aclocal_m4_deps = $(top_srcdir)/../libtool.m4 \
|
||||
$(top_srcdir)/../ltoptions.m4 $(top_srcdir)/../ltsugar.m4 \
|
||||
$(top_srcdir)/../ltversion.m4 $(top_srcdir)/../lt~obsolete.m4 \
|
||||
$(top_srcdir)/../config/acx.m4 \
|
||||
$(top_srcdir)/../config/depstand.m4 \
|
||||
$(top_srcdir)/../config/lead-dot.m4 \
|
||||
$(top_srcdir)/../config/multi.m4 \
|
||||
$(top_srcdir)/../config/no-executables.m4 \
|
||||
$(top_srcdir)/../config/override.m4 \
|
||||
$(top_srcdir)/../libtool.m4 $(top_srcdir)/../ltoptions.m4 \
|
||||
$(top_srcdir)/../ltsugar.m4 $(top_srcdir)/../ltversion.m4 \
|
||||
$(top_srcdir)/../lt~obsolete.m4 $(top_srcdir)/configure.ac
|
||||
$(top_srcdir)/../config/override.m4 $(top_srcdir)/configure.ac
|
||||
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
|
||||
$(ACLOCAL_M4)
|
||||
DIST_COMMON = $(srcdir)/Makefile.am $(top_srcdir)/configure \
|
||||
|
10
libgm2/aclocal.m4
vendored
10
libgm2/aclocal.m4
vendored
@ -1187,14 +1187,14 @@ AC_SUBST([am__tar])
|
||||
AC_SUBST([am__untar])
|
||||
]) # _AM_PROG_TAR
|
||||
|
||||
m4_include([../libtool.m4])
|
||||
m4_include([../ltoptions.m4])
|
||||
m4_include([../ltsugar.m4])
|
||||
m4_include([../ltversion.m4])
|
||||
m4_include([../lt~obsolete.m4])
|
||||
m4_include([../config/acx.m4])
|
||||
m4_include([../config/depstand.m4])
|
||||
m4_include([../config/lead-dot.m4])
|
||||
m4_include([../config/multi.m4])
|
||||
m4_include([../config/no-executables.m4])
|
||||
m4_include([../config/override.m4])
|
||||
m4_include([../libtool.m4])
|
||||
m4_include([../ltoptions.m4])
|
||||
m4_include([../ltsugar.m4])
|
||||
m4_include([../ltversion.m4])
|
||||
m4_include([../lt~obsolete.m4])
|
||||
|
@ -63,6 +63,15 @@
|
||||
/* function getgid exists */
|
||||
#undef HAVE_GETGID
|
||||
|
||||
/* Define to 1 if you have the <getopt.h> header file. */
|
||||
#undef HAVE_GETOPT_H
|
||||
|
||||
/* function getopt_long exists */
|
||||
#undef HAVE_GETOPT_LONG
|
||||
|
||||
/* function getopt_long_only exists */
|
||||
#undef HAVE_GETOPT_LONG_ONLY
|
||||
|
||||
/* function getpid exists */
|
||||
#undef HAVE_GETPID
|
||||
|
||||
|
147
libgm2/configure
vendored
147
libgm2/configure
vendored
@ -4950,8 +4950,8 @@ fi
|
||||
|
||||
|
||||
|
||||
for ac_header in limits.h stddef.h string.h strings.h stdlib.h \
|
||||
time.h \
|
||||
for ac_header in getopt.h limits.h stddef.h string.h strings.h \
|
||||
stdlib.h time.h \
|
||||
fcntl.h unistd.h sys/file.h sys/time.h sys/mman.h \
|
||||
sys/resource.h sys/param.h sys/times.h sys/stat.h \
|
||||
sys/socket.h \
|
||||
@ -4973,7 +4973,6 @@ done
|
||||
|
||||
|
||||
|
||||
|
||||
case ${build_alias} in
|
||||
"") build_noncanonical=${build} ;;
|
||||
*) build_noncanonical=${build_alias} ;;
|
||||
@ -12789,7 +12788,7 @@ else
|
||||
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
|
||||
lt_status=$lt_dlunknown
|
||||
cat > conftest.$ac_ext <<_LT_EOF
|
||||
#line 12792 "configure"
|
||||
#line 12791 "configure"
|
||||
#include "confdefs.h"
|
||||
|
||||
#if HAVE_DLFCN_H
|
||||
@ -12895,7 +12894,7 @@ else
|
||||
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
|
||||
lt_status=$lt_dlunknown
|
||||
cat > conftest.$ac_ext <<_LT_EOF
|
||||
#line 12898 "configure"
|
||||
#line 12897 "configure"
|
||||
#include "confdefs.h"
|
||||
|
||||
#if HAVE_DLFCN_H
|
||||
@ -18061,6 +18060,144 @@ $as_echo "#define HAVE_GETGID 1" >>confdefs.h
|
||||
fi
|
||||
|
||||
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking m2 front end checking c library for getopt_long" >&5
|
||||
$as_echo_n "checking m2 front end checking c library for getopt_long... " >&6; }
|
||||
if test x$gcc_no_link != xyes; then
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for getopt_long in -lc" >&5
|
||||
$as_echo_n "checking for getopt_long in -lc... " >&6; }
|
||||
if ${ac_cv_lib_c_getopt_long+:} false; then :
|
||||
$as_echo_n "(cached) " >&6
|
||||
else
|
||||
ac_check_lib_save_LIBS=$LIBS
|
||||
LIBS="-lc $LIBS"
|
||||
if test x$gcc_no_link = xyes; then
|
||||
as_fn_error $? "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5
|
||||
fi
|
||||
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
|
||||
/* end confdefs.h. */
|
||||
|
||||
/* Override any GCC internal prototype to avoid an error.
|
||||
Use char because int might match the return type of a GCC
|
||||
builtin and then its argument prototype would still apply. */
|
||||
#ifdef __cplusplus
|
||||
extern "C"
|
||||
#endif
|
||||
char getopt_long ();
|
||||
int
|
||||
main ()
|
||||
{
|
||||
return getopt_long ();
|
||||
;
|
||||
return 0;
|
||||
}
|
||||
_ACEOF
|
||||
if ac_fn_c_try_link "$LINENO"; then :
|
||||
ac_cv_lib_c_getopt_long=yes
|
||||
else
|
||||
ac_cv_lib_c_getopt_long=no
|
||||
fi
|
||||
rm -f core conftest.err conftest.$ac_objext \
|
||||
conftest$ac_exeext conftest.$ac_ext
|
||||
LIBS=$ac_check_lib_save_LIBS
|
||||
fi
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_c_getopt_long" >&5
|
||||
$as_echo "$ac_cv_lib_c_getopt_long" >&6; }
|
||||
if test "x$ac_cv_lib_c_getopt_long" = xyes; then :
|
||||
|
||||
$as_echo "#define HAVE_GETOPT_LONG 1" >>confdefs.h
|
||||
|
||||
else
|
||||
|
||||
$as_echo "#undef HAVE_GETOPT_LONG" >>confdefs.h
|
||||
|
||||
fi
|
||||
|
||||
else
|
||||
if test "x$ac_cv_lib_c_getopt_long" = xyes; then
|
||||
|
||||
$as_echo "#define HAVE_GETOPT_LONG 1" >>confdefs.h
|
||||
|
||||
elif test "x$ac_cv_func_getopt_long" = xyes; then
|
||||
|
||||
$as_echo "#define HAVE_GETOPT_LONG 1" >>confdefs.h
|
||||
|
||||
else
|
||||
|
||||
$as_echo "#undef HAVE_GETOPT_LONG" >>confdefs.h
|
||||
|
||||
fi
|
||||
fi
|
||||
|
||||
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking m2 front end checking c library for getopt_long_only" >&5
|
||||
$as_echo_n "checking m2 front end checking c library for getopt_long_only... " >&6; }
|
||||
if test x$gcc_no_link != xyes; then
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for getopt_long_only in -lc" >&5
|
||||
$as_echo_n "checking for getopt_long_only in -lc... " >&6; }
|
||||
if ${ac_cv_lib_c_getopt_long_only+:} false; then :
|
||||
$as_echo_n "(cached) " >&6
|
||||
else
|
||||
ac_check_lib_save_LIBS=$LIBS
|
||||
LIBS="-lc $LIBS"
|
||||
if test x$gcc_no_link = xyes; then
|
||||
as_fn_error $? "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5
|
||||
fi
|
||||
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
|
||||
/* end confdefs.h. */
|
||||
|
||||
/* Override any GCC internal prototype to avoid an error.
|
||||
Use char because int might match the return type of a GCC
|
||||
builtin and then its argument prototype would still apply. */
|
||||
#ifdef __cplusplus
|
||||
extern "C"
|
||||
#endif
|
||||
char getopt_long_only ();
|
||||
int
|
||||
main ()
|
||||
{
|
||||
return getopt_long_only ();
|
||||
;
|
||||
return 0;
|
||||
}
|
||||
_ACEOF
|
||||
if ac_fn_c_try_link "$LINENO"; then :
|
||||
ac_cv_lib_c_getopt_long_only=yes
|
||||
else
|
||||
ac_cv_lib_c_getopt_long_only=no
|
||||
fi
|
||||
rm -f core conftest.err conftest.$ac_objext \
|
||||
conftest$ac_exeext conftest.$ac_ext
|
||||
LIBS=$ac_check_lib_save_LIBS
|
||||
fi
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_c_getopt_long_only" >&5
|
||||
$as_echo "$ac_cv_lib_c_getopt_long_only" >&6; }
|
||||
if test "x$ac_cv_lib_c_getopt_long_only" = xyes; then :
|
||||
|
||||
$as_echo "#define HAVE_GETOPT_LONG_ONLY 1" >>confdefs.h
|
||||
|
||||
else
|
||||
|
||||
$as_echo "#undef HAVE_GETOPT_LONG_ONLY" >>confdefs.h
|
||||
|
||||
fi
|
||||
|
||||
else
|
||||
if test "x$ac_cv_lib_c_getopt_long_only" = xyes; then
|
||||
|
||||
$as_echo "#define HAVE_GETOPT_LONG_ONLY 1" >>confdefs.h
|
||||
|
||||
elif test "x$ac_cv_func_getopt_long_only" = xyes; then
|
||||
|
||||
$as_echo "#define HAVE_GETOPT_LONG_ONLY 1" >>confdefs.h
|
||||
|
||||
else
|
||||
|
||||
$as_echo "#undef HAVE_GETOPT_LONG_ONLY" >>confdefs.h
|
||||
|
||||
fi
|
||||
fi
|
||||
|
||||
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking m2 front end checking c library for getpid" >&5
|
||||
$as_echo_n "checking m2 front end checking c library for getpid... " >&6; }
|
||||
if test x$gcc_no_link != xyes; then
|
||||
|
@ -92,8 +92,8 @@ AC_HEADER_SYS_WAIT
|
||||
AC_CHECK_HEADER([math.h],
|
||||
[AC_DEFINE([HAVE_MATH_H], [1], [have math.h])])
|
||||
|
||||
AC_CHECK_HEADERS(limits.h stddef.h string.h strings.h stdlib.h \
|
||||
time.h \
|
||||
AC_CHECK_HEADERS(getopt.h limits.h stddef.h string.h strings.h \
|
||||
stdlib.h time.h \
|
||||
fcntl.h unistd.h sys/file.h sys/time.h sys/mman.h \
|
||||
sys/resource.h sys/param.h sys/times.h sys/stat.h \
|
||||
sys/socket.h \
|
||||
@ -102,7 +102,6 @@ AC_CHECK_HEADERS(limits.h stddef.h string.h strings.h stdlib.h \
|
||||
pthread.h stdarg.h stdio.h sys/types.h termios.h \
|
||||
netinet/in.h netdb.h sys/uio.h sys/stat.h wchar.h)
|
||||
|
||||
|
||||
AC_CANONICAL_HOST
|
||||
ACX_NONCANONICAL_HOST
|
||||
ACX_NONCANONICAL_TARGET
|
||||
@ -296,6 +295,8 @@ GM2_CHECK_LIB([c],[fcntl],[FCNTL])
|
||||
GM2_CHECK_LIB([c],[fstat],[FSTAT])
|
||||
GM2_CHECK_LIB([c],[getdents],[GETDENTS])
|
||||
GM2_CHECK_LIB([c],[getgid],[GETGID])
|
||||
GM2_CHECK_LIB([c],[getopt_long],[GETOPT_LONG])
|
||||
GM2_CHECK_LIB([c],[getopt_long_only],[GETOPT_LONG_ONLY])
|
||||
GM2_CHECK_LIB([c],[getpid],[GETPID])
|
||||
GM2_CHECK_LIB([c],[gettimeofday],[GETTIMEOFD])
|
||||
GM2_CHECK_LIB([c],[getuid],[GETUID])
|
||||
|
@ -108,15 +108,15 @@ target_triplet = @target@
|
||||
@BUILD_CORLIB_TRUE@@ENABLE_DARWIN_AT_RPATH_TRUE@am__append_1 = -nodefaultrpaths -Wl,-rpath,@loader_path/
|
||||
subdir = libm2cor
|
||||
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
|
||||
am__aclocal_m4_deps = $(top_srcdir)/../config/acx.m4 \
|
||||
am__aclocal_m4_deps = $(top_srcdir)/../libtool.m4 \
|
||||
$(top_srcdir)/../ltoptions.m4 $(top_srcdir)/../ltsugar.m4 \
|
||||
$(top_srcdir)/../ltversion.m4 $(top_srcdir)/../lt~obsolete.m4 \
|
||||
$(top_srcdir)/../config/acx.m4 \
|
||||
$(top_srcdir)/../config/depstand.m4 \
|
||||
$(top_srcdir)/../config/lead-dot.m4 \
|
||||
$(top_srcdir)/../config/multi.m4 \
|
||||
$(top_srcdir)/../config/no-executables.m4 \
|
||||
$(top_srcdir)/../config/override.m4 \
|
||||
$(top_srcdir)/../libtool.m4 $(top_srcdir)/../ltoptions.m4 \
|
||||
$(top_srcdir)/../ltsugar.m4 $(top_srcdir)/../ltversion.m4 \
|
||||
$(top_srcdir)/../lt~obsolete.m4 $(top_srcdir)/configure.ac
|
||||
$(top_srcdir)/../config/override.m4 $(top_srcdir)/configure.ac
|
||||
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
|
||||
$(ACLOCAL_M4)
|
||||
DIST_COMMON = $(srcdir)/Makefile.am
|
||||
|
@ -108,15 +108,15 @@ target_triplet = @target@
|
||||
@BUILD_ISOLIB_TRUE@@ENABLE_DARWIN_AT_RPATH_TRUE@am__append_1 = -nodefaultrpaths -Wl,-rpath,@loader_path/
|
||||
subdir = libm2iso
|
||||
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
|
||||
am__aclocal_m4_deps = $(top_srcdir)/../config/acx.m4 \
|
||||
am__aclocal_m4_deps = $(top_srcdir)/../libtool.m4 \
|
||||
$(top_srcdir)/../ltoptions.m4 $(top_srcdir)/../ltsugar.m4 \
|
||||
$(top_srcdir)/../ltversion.m4 $(top_srcdir)/../lt~obsolete.m4 \
|
||||
$(top_srcdir)/../config/acx.m4 \
|
||||
$(top_srcdir)/../config/depstand.m4 \
|
||||
$(top_srcdir)/../config/lead-dot.m4 \
|
||||
$(top_srcdir)/../config/multi.m4 \
|
||||
$(top_srcdir)/../config/no-executables.m4 \
|
||||
$(top_srcdir)/../config/override.m4 \
|
||||
$(top_srcdir)/../libtool.m4 $(top_srcdir)/../ltoptions.m4 \
|
||||
$(top_srcdir)/../ltsugar.m4 $(top_srcdir)/../ltversion.m4 \
|
||||
$(top_srcdir)/../lt~obsolete.m4 $(top_srcdir)/configure.ac
|
||||
$(top_srcdir)/../config/override.m4 $(top_srcdir)/configure.ac
|
||||
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
|
||||
$(ACLOCAL_M4)
|
||||
DIST_COMMON = $(srcdir)/Makefile.am
|
||||
|
@ -108,15 +108,15 @@ target_triplet = @target@
|
||||
@BUILD_LOGLIB_TRUE@@ENABLE_DARWIN_AT_RPATH_TRUE@am__append_1 = -nodefaultrpaths -Wl,-rpath,@loader_path/
|
||||
subdir = libm2log
|
||||
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
|
||||
am__aclocal_m4_deps = $(top_srcdir)/../config/acx.m4 \
|
||||
am__aclocal_m4_deps = $(top_srcdir)/../libtool.m4 \
|
||||
$(top_srcdir)/../ltoptions.m4 $(top_srcdir)/../ltsugar.m4 \
|
||||
$(top_srcdir)/../ltversion.m4 $(top_srcdir)/../lt~obsolete.m4 \
|
||||
$(top_srcdir)/../config/acx.m4 \
|
||||
$(top_srcdir)/../config/depstand.m4 \
|
||||
$(top_srcdir)/../config/lead-dot.m4 \
|
||||
$(top_srcdir)/../config/multi.m4 \
|
||||
$(top_srcdir)/../config/no-executables.m4 \
|
||||
$(top_srcdir)/../config/override.m4 \
|
||||
$(top_srcdir)/../libtool.m4 $(top_srcdir)/../ltoptions.m4 \
|
||||
$(top_srcdir)/../ltsugar.m4 $(top_srcdir)/../ltversion.m4 \
|
||||
$(top_srcdir)/../lt~obsolete.m4 $(top_srcdir)/configure.ac
|
||||
$(top_srcdir)/../config/override.m4 $(top_srcdir)/configure.ac
|
||||
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
|
||||
$(ACLOCAL_M4)
|
||||
DIST_COMMON = $(srcdir)/Makefile.am
|
||||
|
@ -108,15 +108,15 @@ target_triplet = @target@
|
||||
@ENABLE_DARWIN_AT_RPATH_TRUE@am__append_1 = -nodefaultrpaths -Wl,-rpath,@loader_path/
|
||||
subdir = libm2min
|
||||
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
|
||||
am__aclocal_m4_deps = $(top_srcdir)/../config/acx.m4 \
|
||||
am__aclocal_m4_deps = $(top_srcdir)/../libtool.m4 \
|
||||
$(top_srcdir)/../ltoptions.m4 $(top_srcdir)/../ltsugar.m4 \
|
||||
$(top_srcdir)/../ltversion.m4 $(top_srcdir)/../lt~obsolete.m4 \
|
||||
$(top_srcdir)/../config/acx.m4 \
|
||||
$(top_srcdir)/../config/depstand.m4 \
|
||||
$(top_srcdir)/../config/lead-dot.m4 \
|
||||
$(top_srcdir)/../config/multi.m4 \
|
||||
$(top_srcdir)/../config/no-executables.m4 \
|
||||
$(top_srcdir)/../config/override.m4 \
|
||||
$(top_srcdir)/../libtool.m4 $(top_srcdir)/../ltoptions.m4 \
|
||||
$(top_srcdir)/../ltsugar.m4 $(top_srcdir)/../ltversion.m4 \
|
||||
$(top_srcdir)/../lt~obsolete.m4 $(top_srcdir)/configure.ac
|
||||
$(top_srcdir)/../config/override.m4 $(top_srcdir)/configure.ac
|
||||
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
|
||||
$(ACLOCAL_M4)
|
||||
DIST_COMMON = $(srcdir)/Makefile.am
|
||||
|
@ -108,15 +108,15 @@ target_triplet = @target@
|
||||
@BUILD_PIMLIB_TRUE@@ENABLE_DARWIN_AT_RPATH_TRUE@am__append_1 = -nodefaultrpaths -Wl,-rpath,@loader_path/
|
||||
subdir = libm2pim
|
||||
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
|
||||
am__aclocal_m4_deps = $(top_srcdir)/../config/acx.m4 \
|
||||
am__aclocal_m4_deps = $(top_srcdir)/../libtool.m4 \
|
||||
$(top_srcdir)/../ltoptions.m4 $(top_srcdir)/../ltsugar.m4 \
|
||||
$(top_srcdir)/../ltversion.m4 $(top_srcdir)/../lt~obsolete.m4 \
|
||||
$(top_srcdir)/../config/acx.m4 \
|
||||
$(top_srcdir)/../config/depstand.m4 \
|
||||
$(top_srcdir)/../config/lead-dot.m4 \
|
||||
$(top_srcdir)/../config/multi.m4 \
|
||||
$(top_srcdir)/../config/no-executables.m4 \
|
||||
$(top_srcdir)/../config/override.m4 \
|
||||
$(top_srcdir)/../libtool.m4 $(top_srcdir)/../ltoptions.m4 \
|
||||
$(top_srcdir)/../ltsugar.m4 $(top_srcdir)/../ltversion.m4 \
|
||||
$(top_srcdir)/../lt~obsolete.m4 $(top_srcdir)/configure.ac
|
||||
$(top_srcdir)/../config/override.m4 $(top_srcdir)/configure.ac
|
||||
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
|
||||
$(ACLOCAL_M4)
|
||||
DIST_COMMON = $(srcdir)/Makefile.am
|
||||
|
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user