Try to fix configure and automake files so everything builds a bit cleaner.

Also try to fix the warnings on the GNU C Library.
Still a lot of work and testing to be done here, but making progress.

svn path=/trunk/yasm/; revision=204
0.3
Peter Johnson 24 years ago
parent 60fd596a66
commit 91f41e241b
  1. 3
      acconfig.h
  2. 4
      check/Makefile.am
  3. 30
      configure.ac
  4. 30
      configure.in
  5. 2
      libyasm/tests/Makefile.am
  6. 11
      libyasm/util.h
  7. 4
      modules/objfmts/dbg/Makefile.am
  8. 4
      modules/optimizers/basic/Makefile.am
  9. 4
      modules/optimizers/dbg/Makefile.am
  10. 4
      modules/parsers/nasm/Makefile.am
  11. 4
      modules/preprocs/raw/Makefile.am
  12. 4
      src/Makefile.am
  13. 4
      src/objfmts/dbg/Makefile.am
  14. 4
      src/optimizers/basic/Makefile.am
  15. 4
      src/optimizers/dbg/Makefile.am
  16. 4
      src/parsers/nasm/Makefile.am
  17. 4
      src/preprocs/raw/Makefile.am
  18. 2
      src/tests/Makefile.am
  19. 11
      src/util.h
  20. 2
      tests/Makefile.am
  21. 11
      util.h

@ -21,6 +21,9 @@
/* combined test for fork/way/msg* */
#undef USE_FORKWAITMSG
/* Check for GNU C Library */
#undef HAVE_GNU_C_LIBRARY
@BOTTOM@
#endif /* YASM_CONFIG_H */

@ -28,9 +28,7 @@ nocheck_error:
@echo "Run configure with --enable-check before running make check"
@exit 1
if DEV
CFLAGS = -ansi -pedantic -Wall -g
endif
CFLAGS = @ANSI_CFLAGS@ @CHECK_CFLAGS@
EXTRA_DIST = \
NEWS \

@ -28,6 +28,17 @@ AM_CONDITIONAL(CHECK, test x$check = xtrue)
AM_PROG_CC_STDC
if ${dev}; then
DEVFLAGS="-g"
fi
if test "$GCC" = yes; then
ANSI_CFLAGS="-ansi -pedantic -Wall $DEVFLAGS"
else
ANSI_CFLAGS="$DEVFLAGS"
fi
AC_SUBST(ANSI_CFLAGS)
ALL_LINGUAS=""
AM_GNU_GETTEXT
@ -74,7 +85,24 @@ AC_REPLACE_FUNCS(strdup strtoul)
AC_CHECK_HEADERS(limits.h sys/queue.h sys/cdefs.h)
# Check for GNU C Library
AC_CHECK_HEADERS(features.h)
if test "$ac_cv_header_features_h" = yes; then
AC_MSG_CHECKING([for GNU C Library])
AC_EGREP_CPP(gnulib,
[#include <features.h>
#ifdef __GNU_LIBRARY__
gnulib
#endif
], have_gnulib=yes, have_gnulib=no)
AC_MSG_RESULT([$have_gnulib])
if test "$have_gnulib" = yes; then
AC_DEFINE(HAVE_GNU_C_LIBRARY)
fi
fi
# Check for stuff wanted by the test suite. None of this is required.
CHECK_CFLAGS=
if ${check}; then
AC_CHECK_FUNCS(fork wait msgctl msgget msgrcv msgsnd strerror)
if test "$ac_cv_func_fork" = yes &&
@ -84,11 +112,13 @@ if ${check}; then
test "$ac_cv_func_msgrcv" = yes &&
test "$ac_cv_func_msgsnd" = yes; then
AC_DEFINE(USE_FORKWAITMSG)
CHECK_CFLAGS="-D_SVID_SOURCE"
fi
AC_TYPE_PID_T
AC_HEADER_SYS_WAIT
AC_CHECK_HEADERS(sys/types.h sys/ipc.h sys/msg.h unistd.h)
fi
AC_SUBST(CHECK_CFLAGS)
# Check for some target-specific stuff
case "$host" in

@ -28,6 +28,17 @@ AM_CONDITIONAL(CHECK, test x$check = xtrue)
AM_PROG_CC_STDC
if ${dev}; then
DEVFLAGS="-g"
fi
if test "$GCC" = yes; then
ANSI_CFLAGS="-ansi -pedantic -Wall $DEVFLAGS"
else
ANSI_CFLAGS="$DEVFLAGS"
fi
AC_SUBST(ANSI_CFLAGS)
ALL_LINGUAS=""
AM_GNU_GETTEXT
@ -74,7 +85,24 @@ AC_REPLACE_FUNCS(strdup strtoul)
AC_CHECK_HEADERS(limits.h sys/queue.h sys/cdefs.h)
# Check for GNU C Library
AC_CHECK_HEADERS(features.h)
if test "$ac_cv_header_features_h" = yes; then
AC_MSG_CHECKING([for GNU C Library])
AC_EGREP_CPP(gnulib,
[#include <features.h>
#ifdef __GNU_LIBRARY__
gnulib
#endif
], have_gnulib=yes, have_gnulib=no)
AC_MSG_RESULT([$have_gnulib])
if test "$have_gnulib" = yes; then
AC_DEFINE(HAVE_GNU_C_LIBRARY)
fi
fi
# Check for stuff wanted by the test suite. None of this is required.
CHECK_CFLAGS=
if ${check}; then
AC_CHECK_FUNCS(fork wait msgctl msgget msgrcv msgsnd strerror)
if test "$ac_cv_func_fork" = yes &&
@ -84,11 +112,13 @@ if ${check}; then
test "$ac_cv_func_msgrcv" = yes &&
test "$ac_cv_func_msgsnd" = yes; then
AC_DEFINE(USE_FORKWAITMSG)
CHECK_CFLAGS="-D_SVID_SOURCE"
fi
AC_TYPE_PID_T
AC_HEADER_SYS_WAIT
AC_CHECK_HEADERS(sys/types.h sys/ipc.h sys/msg.h unistd.h)
fi
AC_SUBST(CHECK_CFLAGS)
# Check for some target-specific stuff
case "$host" in

@ -1,5 +1,7 @@
# $IdPath$
CFLAGS = @ANSI_CFLAGS@
if CHECK
TESTS = \
bytecode_test

@ -22,11 +22,11 @@
#ifndef YASM_UTIL_H
#define YASM_UTIL_H
#ifndef HAVE_STRDUP
#if !defined(HAVE_STRDUP) || defined(HAVE_GNU_C_LIBRARY)
char *strdup(const char *str);
#endif
#ifndef HAVE_STRTOUL
#if !defined(HAVE_STRTOUL) || defined(HAVE_GNU_C_LIBRARY)
unsigned long strtoul(const char *nptr, char **endptr, int base);
#endif
@ -39,12 +39,15 @@ unsigned long strtoul(const char *nptr, char **endptr, int base);
# define strcasecmp(x, y) strncmpi(x, y)
# else
# define USE_OUR_OWN_STRCASECMP
# endif
#endif
#if defined(USE_OUR_OWN_STRCASECMP) || defined(HAVE_GNU_C_LIBRARY)
int strcasecmp(const char *s1, const char *s2);
int strncasecmp(const char *s1, const char *s2, size_t n);
# endif
#endif
#ifndef HAVE_TOASCII
#if !defined(HAVE_TOASCII) || defined(HAVE_GNU_C_LIBRARY)
# define toascii(c) ((c) & 0x7F)
#endif

@ -9,6 +9,4 @@ INCLUDES = \
-I$(top_srcdir)/src \
-I$(top_builddir)/intl
if DEV
CFLAGS = -ansi -pedantic -Wall -g
endif
CFLAGS = @ANSI_CFLAGS@

@ -9,6 +9,4 @@ INCLUDES = \
-I$(top_srcdir)/src \
-I$(top_builddir)/intl
if DEV
CFLAGS = -ansi -pedantic -Wall -g
endif
CFLAGS = @ANSI_CFLAGS@

@ -9,6 +9,4 @@ INCLUDES = \
-I$(top_srcdir)/src \
-I$(top_builddir)/intl
if DEV
CFLAGS = -ansi -pedantic -Wall -g
endif
CFLAGS = @ANSI_CFLAGS@

@ -31,9 +31,7 @@ INCLUDES = \
-I$(top_srcdir)/src \
-I$(top_builddir)/intl
if DEV
CFLAGS = -ansi -pedantic -Wall -g
endif
CFLAGS = @ANSI_CFLAGS@
token.l bison.y: $(top_srcdir)/src/instrs.dat token.l.in bison.y.in gen_instr.pl
if DEV

@ -9,6 +9,4 @@ INCLUDES = \
-I$(top_srcdir)/src \
-I$(top_builddir)/intl
if DEV
CFLAGS = -ansi -pedantic -Wall -g
endif
CFLAGS = @ANSI_CFLAGS@

@ -41,9 +41,7 @@ libyasm_a_SOURCES = \
optimizer.h \
strcasecmp.c
if DEV
CFLAGS = -ansi -pedantic -Wall -g
endif
CFLAGS = @ANSI_CFLAGS@
EXTRA_DIST = \
instrs.dat \

@ -9,6 +9,4 @@ INCLUDES = \
-I$(top_srcdir)/src \
-I$(top_builddir)/intl
if DEV
CFLAGS = -ansi -pedantic -Wall -g
endif
CFLAGS = @ANSI_CFLAGS@

@ -9,6 +9,4 @@ INCLUDES = \
-I$(top_srcdir)/src \
-I$(top_builddir)/intl
if DEV
CFLAGS = -ansi -pedantic -Wall -g
endif
CFLAGS = @ANSI_CFLAGS@

@ -9,6 +9,4 @@ INCLUDES = \
-I$(top_srcdir)/src \
-I$(top_builddir)/intl
if DEV
CFLAGS = -ansi -pedantic -Wall -g
endif
CFLAGS = @ANSI_CFLAGS@

@ -31,9 +31,7 @@ INCLUDES = \
-I$(top_srcdir)/src \
-I$(top_builddir)/intl
if DEV
CFLAGS = -ansi -pedantic -Wall -g
endif
CFLAGS = @ANSI_CFLAGS@
token.l bison.y: $(top_srcdir)/src/instrs.dat token.l.in bison.y.in gen_instr.pl
if DEV

@ -9,6 +9,4 @@ INCLUDES = \
-I$(top_srcdir)/src \
-I$(top_builddir)/intl
if DEV
CFLAGS = -ansi -pedantic -Wall -g
endif
CFLAGS = @ANSI_CFLAGS@

@ -1,5 +1,7 @@
# $IdPath$
CFLAGS = @ANSI_CFLAGS@
if CHECK
TESTS = \
bytecode_test

@ -22,11 +22,11 @@
#ifndef YASM_UTIL_H
#define YASM_UTIL_H
#ifndef HAVE_STRDUP
#if !defined(HAVE_STRDUP) || defined(HAVE_GNU_C_LIBRARY)
char *strdup(const char *str);
#endif
#ifndef HAVE_STRTOUL
#if !defined(HAVE_STRTOUL) || defined(HAVE_GNU_C_LIBRARY)
unsigned long strtoul(const char *nptr, char **endptr, int base);
#endif
@ -39,12 +39,15 @@ unsigned long strtoul(const char *nptr, char **endptr, int base);
# define strcasecmp(x, y) strncmpi(x, y)
# else
# define USE_OUR_OWN_STRCASECMP
# endif
#endif
#if defined(USE_OUR_OWN_STRCASECMP) || defined(HAVE_GNU_C_LIBRARY)
int strcasecmp(const char *s1, const char *s2);
int strncasecmp(const char *s1, const char *s2, size_t n);
# endif
#endif
#ifndef HAVE_TOASCII
#if !defined(HAVE_TOASCII) || defined(HAVE_GNU_C_LIBRARY)
# define toascii(c) ((c) & 0x7F)
#endif

@ -1,5 +1,7 @@
# $IdPath$
CFLAGS = @ANSI_CFLAGS@
if CHECK
#TESTS = \

@ -22,11 +22,11 @@
#ifndef YASM_UTIL_H
#define YASM_UTIL_H
#ifndef HAVE_STRDUP
#if !defined(HAVE_STRDUP) || defined(HAVE_GNU_C_LIBRARY)
char *strdup(const char *str);
#endif
#ifndef HAVE_STRTOUL
#if !defined(HAVE_STRTOUL) || defined(HAVE_GNU_C_LIBRARY)
unsigned long strtoul(const char *nptr, char **endptr, int base);
#endif
@ -39,12 +39,15 @@ unsigned long strtoul(const char *nptr, char **endptr, int base);
# define strcasecmp(x, y) strncmpi(x, y)
# else
# define USE_OUR_OWN_STRCASECMP
# endif
#endif
#if defined(USE_OUR_OWN_STRCASECMP) || defined(HAVE_GNU_C_LIBRARY)
int strcasecmp(const char *s1, const char *s2);
int strncasecmp(const char *s1, const char *s2, size_t n);
# endif
#endif
#ifndef HAVE_TOASCII
#if !defined(HAVE_TOASCII) || defined(HAVE_GNU_C_LIBRARY)
# define toascii(c) ((c) & 0x7F)
#endif

Loading…
Cancel
Save