On 13.05.2011 11:04, Stephan Witt wrote:
Am 13.05.2011 um 09:48 schrieb Kornel:

Am Freitag, 13. Mai 2011 schrieb Stephan Witt:
Am 13.05.2011 um 00:06 schrieb kuem...@lyx.org:
Author: kuemmel
Date: Fri May 13 00:06:06 2011
New Revision: 38733
URL: http://www.lyx.org/trac/changeset/38733

Log:
cmake on mac: also build with LYX_NLS=0

Modified:
   lyx-devel/trunk/src/client/CMakeLists.txt
   lyx-devel/trunk/src/tex2lyx/CMakeLists.txt

Peter, thanks for your effort. In principle it works (compiles) for me on
Mac now. When using -DLYX_EXTERNAL_LIBINTL=OFF I have to apply this patch
to avoid compiler warnings.

Index: development/cmake/intl/libgnuintl.h.cmake
===================================================================
--- development/cmake/intl/libgnuintl.h.cmake   (Revision 38734)
+++ development/cmake/intl/libgnuintl.h.cmake   (Arbeitskopie)
@@ -19,6 +19,10 @@
  #ifndef _LIBINTL_H
  #define _LIBINTL_H    1

+#undef HAVE_POSIX_PRINTF
+#undef HAVE_ASPRINTF
+#undef HAVE_WPRINTF
Where is it defined?

This is one of the messages...

CompileC 
/Users/stephan/cvs/lyx/lyx-build/cmake/lyx-devel/intl/lyx.build/Debug/intl.build/Objects-normal/i386/textdomain.o
 intl/textdomain.c normal i386 c com.apple.compilers.gcc.4_2
cd /Users/stephan/cvs/lyx/lyx-devel
setenv LANG en_US.US-ASCII
/Developer/usr/bin/gcc-4.2 -x c -arch i386 -fmessage-length=0 -pipe -Wno-trigraphs 
-fpascal-strings -fasm-blocks -O0 -DCMAKE_INTDIR="Debug" -DHAVE_CONFIG_H=1 
-DMAKE_INTL_LIB -DIN_LIBINTL -DENABLE_RELOCATABLE=1 -DIN_LIBRARY -DNO_XMALLOC 
-Dset_relocation_prefix=libintl_set_relocation_prefix -Drelocate=libintl_relocate 
-DDEPENDS_ON_LIBICONV=1 -isysroot /Developer/SDKs/MacOSX10.5.sdk 
-mmacosx-version-min=10.5 -gdwarf-2 -Wmost -Wno-four-char-constants -Wno-unknown-pragmas 
-F/Users/stephan/cvs/lyx/lyx-build/cmake/lyx-devel/lib/Debug 
-I/Users/stephan/cvs/lyx/lyx-build/cmake/lyx-devel/lib/Debug/include 
-I/Users/stephan/cvs/lyx/lyx-build/cmake/lyx-devel -I/Users/stephan/cvs/lyx/lyx-devel/src 
-I/Users/stephan/cvs/lyx/lyx-build/SpellChecker.lib/include 
-I/Users/stephan/cvs/lyx/lyx-devel/po -I/Users/stephan/cvs/lyx/lyx-devel/intl 
-I/Users/stephan/cvs/lyx/lyx-build/cmake/lyx-devel/intl 
-I/Users/stephan/cvs/lyx/lyx-build/cmake/lyx-devel/intl/lyx.build/Debug/intl.build/DerivedSources/i38
6 -I/Users/stephan/cvs/lyx/lyx-build/cmake/lyx-devel/intl/lyx.build/Debug/intl.build/DerivedSources 
-DLOCALEDIR="" -DLOCALE_ALIAS_PATH="" -DLIBDIR="/Users/stephan/cvs/lyx/lyx-devel" 
-DINSTALLDIR="~/bin/LyX" -c /Users/stephan/cvs/lyx/lyx-devel/intl/textdomain.c -o 
/Users/stephan/cvs/lyx/lyx-build/cmake/lyx-devel/intl/lyx.build/Debug/intl.build/Objects-normal/i386/textdomain.o

In file included from /Users/stephan/cvs/lyx/lyx-devel/intl/gettextP.h:64,
                  from /Users/stephan/cvs/lyx/lyx-devel/intl/textdomain.c:26:
/Users/stephan/cvs/lyx/lyx-build/cmake/lyx-devel/intl/libgnuintl.h:28:1: warning: 
"HAVE_POSIX_PRINTF" redefined
In file included from 
/Users/stephan/cvs/lyx/lyx-build/cmake/lyx-devel/config.h:20,
                  from /Users/stephan/cvs/lyx/lyx-devel/intl/textdomain.c:20:
/Users/stephan/cvs/lyx/lyx-build/cmake/lyx-devel/configCompiler.h:54:1: 
warning: this is the location of the previous definition
In file included from /Users/stephan/cvs/lyx/lyx-devel/intl/gettextP.h:64,
                  from /Users/stephan/cvs/lyx/lyx-devel/intl/textdomain.c:26:
/Users/stephan/cvs/lyx/lyx-build/cmake/lyx-devel/intl/libgnuintl.h:29:1: warning: 
"HAVE_ASPRINTF" redefined
In file included from 
/Users/stephan/cvs/lyx/lyx-build/cmake/lyx-devel/config.h:20,
                  from /Users/stephan/cvs/lyx/lyx-devel/intl/textdomain.c:20:
/Users/stephan/cvs/lyx/lyx-build/cmake/lyx-devel/configCompiler.h:51:1: 
warning: this is the location of the previous definition


Do you still have this warning with current trunk? I could not reproduce it.
Peter



  #cmakedefine01 HAVE_POSIX_PRINTF
  #cmakedefine01 HAVE_ASPRINTF
  #cmakedefine01 HAVE_WPRINTF

===================================================================
The questions I have now are:
1) shouldn't config.h be included here? And/Or the cmakedefine01 lines
removed? 2) HAVE_ASPRINTF and HAVE_POSIX_PRINTF are set to 0 on Mac - but
I have them, AFAICS.
But where?

in libc?

PRINTF(3)                BSD Library Functions Manual                PRINTF(3)

NAME
      asprintf, fprintf, printf, snprintf, sprintf, vasprintf, vfprintf, 
vprintf, vsnprintf, vsprintf -- formatted output conversion

LIBRARY
      Standard C Library (libc, -lc)

SYNOPSIS
      #include<stdio.h>

      int
      asprintf(char **ret, const char *format, ...);

      int
      fprintf(FILE *restrict stream, const char *restrict format, ...);

      int
      printf(const char *restrict format, ...);

      int
      snprintf(char *restrict s, size_t n, const char *restrict format, ...);

      int
      sprintf(char *restrict s, const char *restrict format, ...);

      #include<stdarg.h>
      #include<stdio.h>

1.) No. The definisions in config.h differ from use there.
     E.g. in config.h there is either
                #define HAVE_ASPRINTF 1
    or
                /* undef HAVE_ASPRINTF */
   while here it is
        #define HAVE_ASPRINTF 1
    or
        #define HAVE_ASPRINTF 0
    respectivelly.

I see... but in intl/libgnuintl.h it is, e.g.:

#if HAVE_ASPRINTF

So it should work, shouldn't it?

Stephan

Reply via email to