From 5033596aee203aaa630b69ff388f72ecf8ed6c84 Mon Sep 17 00:00:00 2001 From: hyung-hwan Date: Mon, 20 Aug 2012 15:08:06 +0000 Subject: [PATCH] fixed Makefile.am not to link unicosw in the mchar mode --- qse/cmd/awk/Makefile.am | 8 ++++++-- qse/cmd/awk/Makefile.in | 9 ++++----- qse/cmd/sed/Makefile.am | 2 ++ qse/cmd/sed/Makefile.in | 4 ++-- qse/cmd/sed/sed.c | 1 + qse/configure | 14 ++++++++++++++ qse/configure.ac | 1 + qse/include/qse/macros.h | 6 ++++++ 8 files changed, 36 insertions(+), 9 deletions(-) diff --git a/qse/cmd/awk/Makefile.am b/qse/cmd/awk/Makefile.am index 24b5537a..1a037de1 100644 --- a/qse/cmd/awk/Makefile.am +++ b/qse/cmd/awk/Makefile.am @@ -13,9 +13,11 @@ qseawk_SOURCES = awk.c qseawk_LDFLAGS = -L../../lib/awk -L../../lib/cmn -L$(libdir) qseawk_LDADD = -lqseawk -lqsecmn $(LIBM) -if WIN32 +if WIN32 +if WCHAR qseawk_LDADD += $(UNICOWS_LIBS) endif +endif #####################################################################3 @@ -27,8 +29,10 @@ qseawkmp_CPPFLAGS = $(AM_CPPFLAGS) $(MPI_CFLAGS) qseawkmp_LDFLAGS = -L../../lib/awk -L../../lib/cmn -L$(libdir) $(MPI_CLDFLAGS) qseawkmp_LDADD = -lqseawkmp -lqseawk -lqsecmn $(LIBM) -if WIN32 +if WIN32 +if WCHAR qseawkmp_LDADD += $(UNICOWS_LIBS) endif +endif endif diff --git a/qse/cmd/awk/Makefile.in b/qse/cmd/awk/Makefile.in index 5bb71520..666f801c 100644 --- a/qse/cmd/awk/Makefile.in +++ b/qse/cmd/awk/Makefile.in @@ -35,11 +35,11 @@ POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ bin_PROGRAMS = qseawk$(EXEEXT) $(am__EXEEXT_1) -@WIN32_TRUE@am__append_1 = $(UNICOWS_LIBS) +@WCHAR_TRUE@@WIN32_TRUE@am__append_1 = $(UNICOWS_LIBS) #####################################################################3 @HAVE_C_MPI_TRUE@am__append_2 = qseawkmp -@HAVE_C_MPI_TRUE@@WIN32_TRUE@am__append_3 = $(UNICOWS_LIBS) +@HAVE_C_MPI_TRUE@@WCHAR_TRUE@@WIN32_TRUE@am__append_3 = $(UNICOWS_LIBS) subdir = cmd/awk DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 @@ -60,7 +60,7 @@ PROGRAMS = $(bin_PROGRAMS) am_qseawk_OBJECTS = awk.$(OBJEXT) qseawk_OBJECTS = $(am_qseawk_OBJECTS) am__DEPENDENCIES_1 = -@WIN32_TRUE@am__DEPENDENCIES_2 = $(am__DEPENDENCIES_1) +@WCHAR_TRUE@@WIN32_TRUE@am__DEPENDENCIES_2 = $(am__DEPENDENCIES_1) qseawk_DEPENDENCIES = $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_2) qseawk_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(qseawk_LDFLAGS) \ @@ -68,8 +68,7 @@ qseawk_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ am__qseawkmp_SOURCES_DIST = mpi.c @HAVE_C_MPI_TRUE@am_qseawkmp_OBJECTS = qseawkmp-mpi.$(OBJEXT) qseawkmp_OBJECTS = $(am_qseawkmp_OBJECTS) -@HAVE_C_MPI_TRUE@@WIN32_TRUE@am__DEPENDENCIES_3 = \ -@HAVE_C_MPI_TRUE@@WIN32_TRUE@ $(am__DEPENDENCIES_1) +@HAVE_C_MPI_TRUE@@WCHAR_TRUE@@WIN32_TRUE@am__DEPENDENCIES_3 = $(am__DEPENDENCIES_1) @HAVE_C_MPI_TRUE@qseawkmp_DEPENDENCIES = $(am__DEPENDENCIES_1) \ @HAVE_C_MPI_TRUE@ $(am__DEPENDENCIES_3) qseawkmp_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ diff --git a/qse/cmd/sed/Makefile.am b/qse/cmd/sed/Makefile.am index bbfbb17b..7e2d09df 100644 --- a/qse/cmd/sed/Makefile.am +++ b/qse/cmd/sed/Makefile.am @@ -12,5 +12,7 @@ qsesed_LDFLAGS = -L../../lib/sed -L../../lib/cmn -L$(libdir) qsesed_LDADD = -lqsesed -lqsecmn if WIN32 +if WCHAR qsesed_LDADD += $(UNICOWS_LIBS) endif +endif diff --git a/qse/cmd/sed/Makefile.in b/qse/cmd/sed/Makefile.in index 59c055a4..6e3331c5 100644 --- a/qse/cmd/sed/Makefile.in +++ b/qse/cmd/sed/Makefile.in @@ -35,7 +35,7 @@ POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ bin_PROGRAMS = qsesed$(EXEEXT) -@WIN32_TRUE@am__append_1 = $(UNICOWS_LIBS) +@WCHAR_TRUE@@WIN32_TRUE@am__append_1 = $(UNICOWS_LIBS) subdir = cmd/sed DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 @@ -55,7 +55,7 @@ PROGRAMS = $(bin_PROGRAMS) am_qsesed_OBJECTS = sed.$(OBJEXT) qsesed_OBJECTS = $(am_qsesed_OBJECTS) am__DEPENDENCIES_1 = -@WIN32_TRUE@am__DEPENDENCIES_2 = $(am__DEPENDENCIES_1) +@WCHAR_TRUE@@WIN32_TRUE@am__DEPENDENCIES_2 = $(am__DEPENDENCIES_1) qsesed_DEPENDENCIES = $(am__DEPENDENCIES_2) qsesed_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(qsesed_LDFLAGS) \ diff --git a/qse/cmd/sed/sed.c b/qse/cmd/sed/sed.c index 1776fafe..0ffdcc02 100644 --- a/qse/cmd/sed/sed.c +++ b/qse/cmd/sed/sed.c @@ -929,5 +929,6 @@ int qse_main (int argc, qse_achar_t* argv[]) setlocale (LC_ALL, ""); qse_setdflcmgr (qse_slmbcmgr); #endif + return qse_runmain (argc, argv, sed_main); } diff --git a/qse/configure b/qse/configure index 904c7fa4..8ed99941 100755 --- a/qse/configure +++ b/qse/configure @@ -634,6 +634,8 @@ ax_pthread_config ENABLE_CXX_FALSE ENABLE_CXX_TRUE BUILD_MODE +WCHAR_FALSE +WCHAR_TRUE CHAR_MODE HAVE_C_MPI_FALSE HAVE_C_MPI_TRUE @@ -18439,6 +18441,14 @@ $as_echo "#define QSE_CHAR_IS_MCHAR /**/" >>confdefs.h CHAR_MODE="QSE_CHAR_IS_MCHAR" fi + if test "${enable_wchar_is}" = "yes" ; then + WCHAR_TRUE= + WCHAR_FALSE='#' +else + WCHAR_TRUE='#' + WCHAR_FALSE= +fi + # Check whether --enable-syscall was given. if test "${enable_syscall+set}" = set; then : @@ -19108,6 +19118,10 @@ if test -z "${HAVE_C_MPI_TRUE}" && test -z "${HAVE_C_MPI_FALSE}"; then Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi +if test -z "${WCHAR_TRUE}" && test -z "${WCHAR_FALSE}"; then + as_fn_error $? "conditional \"WCHAR\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi if test -z "${ENABLE_CXX_TRUE}" && test -z "${ENABLE_CXX_FALSE}"; then as_fn_error $? "conditional \"ENABLE_CXX\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 diff --git a/qse/configure.ac b/qse/configure.ac index 15b1eb2c..1cdd59b7 100644 --- a/qse/configure.ac +++ b/qse/configure.ac @@ -282,6 +282,7 @@ else AC_DEFINE([QSE_CHAR_IS_MCHAR],[],[char is mchar]) AC_SUBST(CHAR_MODE, "QSE_CHAR_IS_MCHAR") fi +AM_CONDITIONAL(WCHAR, test "${enable_wchar_is}" = "yes" ) AC_ARG_ENABLE([syscall], [AS_HELP_STRING([--enable-syscall],[use the syscall() function to call system calls (default. no)])], enable_syscall_is=$enableval,enable_syscall_is=no) diff --git a/qse/include/qse/macros.h b/qse/include/qse/macros.h index 4479faeb..d6038591 100644 --- a/qse/include/qse/macros.h +++ b/qse/include/qse/macros.h @@ -75,6 +75,12 @@ # define QSE_PRIVATE #endif +#if defined(__GNUC__) +# define QSE_OPTIMIZE_NEVER __attribute__((optimize("O0"))) +#else +# define QSE_OPTIMIZE_NEVER +#endif + /** * The QSE_SIZEOF() macro gets data size in bytes. It is equivalent to the * sizeof operator. The following code snippet should print sizeof(int)*128.