Commits

Anonymous committed 3bafbde

Now p4_gm4 compiles.

  • Participants
  • Parent commits 0ccaff8
  • Branches conversion-to-cmake

Comments (0)

Files changed (6)

File src/wml_backend/p4_gm4/CMakeLists.txt

+SET (PACKAGE_RAW "m4")
+SET (VERSION_RAW "1.4")
+
+SET (PACKAGE "\"${PACKAGE_RAW}\"")
+SET (PACKAGE_VERSION "\"${VERSION_RAW}\"")
+
+SET (PACKAGE_DATE "\"19-Jan-2008\"")
+
+# see - http://www.cmake.org/Wiki/CMake_FAQ#Is_there_an_option_to_produce_more_.27verbose.27_compiling.3F
+SET(CMAKE_VERBOSE_MAKEFILE ON)
+
+include("${CMAKE_CURRENT_SOURCE_DIR}/../../Common.cmake")
+SUBDIRS (
+    lib
+    src
+)
+
+# CHECK_INCLUDE_FILE("stdarg.h" HAVE_STDARG_H)
+# CHECK_INCLUDE_FILE("unistd.h" HAVE_UNISTD_H)
+# CHECK_INCLUDE_FILE("stdio.h" HAVE_STDIO_H)
+
+SET (INCLUDE_FILES_TO_CHECK
+    alloca.h
+    argz.h
+    assert.h
+    ctype.h
+    dirent.h
+    dld.h
+    dlfcn.h
+    dl.h
+    errno.h
+    grp.h
+    inttypes.h
+    limits.h
+    locale.h
+    malloc.h
+    memory.h
+    ndir.h
+    nl/types.h
+    pwd.h
+    stdarg.h
+    stddef.h
+    stdint.h
+    stdio.h
+    stdlib.h
+    string.h
+    strings.h
+    strings.h
+    sys/dir.h
+    sys/dl.h
+    sys/ndir.h
+    sys/param.h
+    sys/stat.h
+    sys/times.h
+    sys/types.h
+    time.h
+    unistd.h
+    )
+CHECK_MULTI_INCLUDE_FILES(${INCLUDE_FILES_TO_CHECK})
+
+SET (REQUIRED_STDC_HEADERS float.h string.h stdlib.h stdarg.h)
+CHECK_INCLUDE_FILES("${REQUIRED_STDC_HEADERS}" STDC_HEADERS)
+
+SET (FUNCTIONS_TO_CHECK 
+    __argz_count
+    __argz_next
+    __argz_stringify
+    alloca
+    argz_append
+    argz_create_sep
+    argz_insert
+    argz_next
+    argz_stringify
+    dlerror
+    ecvt
+    feof_unlocked
+    fgets_unlocked
+    getc_unlocked
+    getcwd
+    getegid
+    geteuid
+    getgid
+    getgrgid
+    getpagesize
+    getpwuid
+    getuid
+    iconv
+    index
+    memcpy
+    memmove
+    mempcpy
+    mkstemp
+    munmap
+    obstack
+    putenv
+    rindex
+    setenv
+    setlocale
+    stpcpy
+    strcasecmp
+    strchr
+    strcmp
+    strdup
+    strerror
+    strrchr
+    strtol
+    strtoul
+    tmpfile
+    tsearch
+    vprintf
+    xmalloc
+    xstrdup
+    )
+CHECK_MULTI_FUNCTIONS_EXISTS(${FUNCTIONS_TO_CHECK})
+
+SET (VERSION ${PACKAGE_VERSION})
+SET (PACKAGE_NAME ${PACKAGE})
+
+SET (PACKAGE_STRING "\"${PACKAGE_RAW} ${VERSION_RAW}\"")
+
+SET (PRODUCT ${PACKAGE})
+
+CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/config.h.cmake ${CMAKE_CURRENT_SOURCE_DIR}/config.h)

File src/wml_backend/p4_gm4/config.h.cmake

+/* config.h.in.  Generated automatically from configure.in by autoheader.  */
+
+/* Define if on AIX 3.
+   System headers sometimes define this.
+   We just want to avoid a redefinition error message.  */
+#ifndef _ALL_SOURCE
+#undef _ALL_SOURCE
+#endif
+
+/* Define if using alloca.c.  */
+#cmakedefine C_ALLOCA
+
+/* Define to empty if the keyword does not work.  */
+#cmakedefine const
+
+/* Define to one of _getb67, GETB67, getb67 for Cray-2 and Cray-YMP systems.
+   This function is required for alloca.c support on those systems.  */
+#cmakedefine CRAY_STACKSEG_END
+
+/* Define if you have alloca, as a function or macro.  */
+#cmakedefine HAVE_ALLOCA 1
+
+/* Define if you have <alloca.h> and it should be used (not on Ultrix).  */
+#cmakedefine HAVE_ALLOCA_H 1
+
+/* Define if you don't have vprintf but do have _doprnt.  */
+#cmakedefine HAVE_DOPRNT 1
+
+/* Define if you have the vprintf function.  */
+#cmakedefine HAVE_VPRINTF 1
+
+/* Define if on MINIX.  */
+#cmakedefine _MINIX
+
+/* Define if the system does not provide POSIX.1 features except
+   with this defined.  */
+#cmakedefine _POSIX_1_SOURCE
+
+/* Define if you need to in order for stat and other things to work.  */
+#cmakedefine _POSIX_SOURCE
+
+/* Define as the return type of signal handlers (int or void).  */
+#cmakedefine RETSIGTYPE
+
+/* Define to `unsigned' if <sys/types.h> doesn't define.  */
+#cmakedefine size_t
+
+/* If using the C implementation of alloca, define if you know the
+   direction of stack growth for your system; otherwise it will be
+   automatically deduced at run-time.
+ STACK_DIRECTION > 0 => grows toward higher addresses
+ STACK_DIRECTION < 0 => grows toward lower addresses
+ STACK_DIRECTION = 0 => direction of growth unknown
+ */
+#cmakedefine STACK_DIRECTION
+
+/* Define if you have the ANSI C header files.  */
+#cmakedefine STDC_HEADERS
+
+/* Define to 1 if the changeword(REGEXP) functionnality is wanted.  */
+#cmakedefine ENABLE_CHANGEWORD
+
+/* Define to 1 if you have ecvt(3), fcvt(3) and gcvt(3), define to 2 if
+   these are declared in <stdlib.h>.  */
+#cmakedefine HAVE_EFGCVT 1
+
+/* Define to the name of the distribution.  */
+#cmakedefine PRODUCT @PRODUCT@
+
+/* Define to 1 if ANSI function prototypes are usable.  */
+#cmakedefine PROTOTYPES
+
+/* Define to the version of the distribution.  */
+#cmakedefine VERSION @VERSION@
+
+/* Define to 1 for better use of the debugging malloc library.  See 
+   site ftp.antaire.com in antaire/src, file dmalloc/dmalloc.tar.gz.  */
+#cmakedefine WITH_DMALLOC
+
+/* Define if you have the ecvt function.  */
+#cmakedefine HAVE_ECVT 1
+
+/* Define if you have the mkstemp function.  */
+#cmakedefine HAVE_MKSTEMP 1
+
+/* Define if you have the sigaction function.  */
+#cmakedefine HAVE_SIGACTION 1
+
+/* Define if you have the sigaltstack function.  */
+#cmakedefine HAVE_SIGALTSTACK 1
+
+/* Define if you have the sigstack function.  */
+#cmakedefine HAVE_SIGSTACK 1
+
+/* Define if you have the sigvec function.  */
+#cmakedefine HAVE_SIGVEC 1
+
+/* Define if you have the strerror function.  */
+#cmakedefine HAVE_STRERROR 1
+
+/* Define if you have the strtol function.  */
+#cmakedefine HAVE_STRTOL 1
+
+/* Define if you have the tmpfile function.  */
+#cmakedefine HAVE_TMPFILE 1
+
+/* Define if you have the <limits.h> header file.  */
+#cmakedefine HAVE_LIMITS_H 1
+
+/* Define if you have the <memory.h> header file.  */
+#cmakedefine HAVE_MEMORY_H 1
+
+/* Define if you have the <siginfo.h> header file.  */
+#cmakedefine HAVE_SIGINFO_H 1
+
+/* Define if you have the <string.h> header file.  */
+#cmakedefine HAVE_STRING_H 1
+
+/* Define if you have the <unistd.h> header file.  */
+#cmakedefine HAVE_UNISTD_H 1

File src/wml_backend/p4_gm4/lib/CMakeLists.txt

+SET(CMAKE_VERBOSE_MAKEFILE ON)
+ADD_DEFINITIONS(-DHAVE_CONFIG_H)
+
+########### next target ###############
+
+include("${CMAKE_CURRENT_SOURCE_DIR}/../../../Common.cmake")
+INCLUDE_DIRECTORIES( ${CMAKE_CURRENT_SOURCE_DIR}/..)
+REPLACE_FUNCTIONS(LIB_SOURCES strtol obstack xmalloc xstrdup)
+SET(mp4h_STAT_SRCS
+   error.c
+   ${LIB_SOURCES}
+   )
+
+ADD_LIBRARY(m4_lib STATIC ${mp4h_STAT_SRCS})
+
+
+########### install files ###############
+
+
+
+
+#original Makefile.am contents follow:
+
+#
+#INCLUDES = @INTLINCL@
+#
+#noinst_LIBRARIES  = libmp4h.a
+#
+#libmp4h_a_SOURCES = error.c
+#libmp4h_a_LIBADD  = @LIBOBJS@
+#noinst_HEADERS    = error.h getopt.h obstack.h
+#

File src/wml_backend/p4_gm4/lib/error.c

 
 #include <stdio.h>
 
-#if HAVE_VPRINTF || HAVE_DOPRNT || _LIBC
+#if defined(HAVE_VPRINTF) || defined(HAVE_DOPRNT) || defined(_LIBC)
 # if __STDC__
 #  include <stdarg.h>
 #  define VA_START(args, lastarg) va_start(args, lastarg)
 # define va_dcl char *a1, *a2, *a3, *a4, *a5, *a6, *a7, *a8;
 #endif
 
-#if STDC_HEADERS || _LIBC
+#if defined(STDC_HEADERS) || defined(_LIBC)
 # include <stdlib.h>
 # include <string.h>
 #else
 # ifdef HAVE_STRERROR_R
 #  define __strerror_r strerror_r
 # else
-#  if HAVE_STRERROR
+#  ifdef HAVE_STRERROR
 #   ifndef strerror		/* On some systems, strerror is a macro */
 char *strerror ();
 #   endif
 
 #ifdef VA_START
   VA_START (args, message);
-# if HAVE_VPRINTF || _LIBC
+# if defined(HAVE_VPRINTF) || defined(_LIBC)
   vfprintf (stderr, message, args);
 # else
   _doprnt (message, args, stderr);
 
 #ifdef VA_START
   VA_START (args, message);
-# if HAVE_VPRINTF || _LIBC
+# if defined(HAVE_VPRINTF) || defined(_LIBC)
   vfprintf (stderr, message, args);
 # else
   _doprnt (message, args, stderr);

File src/wml_backend/p4_gm4/lib/xmalloc.c

 
 #include <sys/types.h>
 
-#if STDC_HEADERS
+#if defined(STDC_HEADERS)
 # include <stdlib.h>
 #else
 VOID *calloc ();
    The caller may set it to some other value.  */
 int xmalloc_exit_failure = EXIT_FAILURE;
 
-#if __STDC__ && (HAVE_VPRINTF || HAVE_DOPRNT)
+#if defined(__STDC__) && (defined(HAVE_VPRINTF) || defined(HAVE_DOPRNT))
 void error (int, int, const char *, ...);
 #else
 void error ();

File src/wml_backend/p4_gm4/src/CMakeLists.txt

+SET(CMAKE_VERBOSE_MAKEFILE ON)
+ADD_DEFINITIONS(-DHAVE_CONFIG_H)
+
+# TODO - replace ".." by the fully qualified path.
+INCLUDE_DIRECTORIES( ${CMAKE_CURRENT_SOURCE_DIR}/.. ${CMAKE_CURRENT_SOURCE_DIR}/../lib ${CMAKE_CURRENT_SOURCE_DIR})
+
+########### next target ###############
+
+SET(m4_SRCS
+   m4.c
+   builtin.c
+   debug.c
+   eval.c
+   format.c
+   freeze.c
+   input.c
+   macro.c
+   output.c
+   path.c
+   symtab.c
+   )
+
+ADD_EXECUTABLE(m4 ${m4_SRCS})
+
+TARGET_LINK_LIBRARIES( m4 m m4_lib )
+
+INSTALL( TARGETS m4 DESTINATION bin)
+