- use unix/configure.ac as top-level configure.ac base
- create stub top-level Makefile.am
- make common/ subtree compilable
git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/branches/unified_buildsys@3892 3789f03b-4d11-0410-bbf8-ca57d06f2519
diff --git a/common/common-config.win.h b/common/common-config.win.h
deleted file mode 100644
index 2f84e9c..0000000
--- a/common/common-config.win.h
+++ /dev/null
@@ -1,11 +0,0 @@
-/* common-config.win.h - Platform-specific definitions for Windows */
-
-#define HAVE_VSNPRINTF 1
-#ifdef _MSC_VER
-/* Older versions of MSVC lacks vsnprintf. MinGW has it, and if this
- macro is defined before stdio.h is included, things will break. */
-#define vsnprintf _vsnprintf
-#endif
-
-#define HAVE_SNPRINTF 1
-#define snprintf _snprintf
diff --git a/common/configure.ac b/common/configure.ac
deleted file mode 100644
index 54e2f3d..0000000
--- a/common/configure.ac
+++ /dev/null
@@ -1,89 +0,0 @@
-dnl Process this file with autoconf to produce a configure script.
-AC_PREREQ([2.57])
-AC_INIT([librfb], [0.0.91], [http://www.tigervnc.org])
-
-AM_INIT_AUTOMAKE([-Wall foreign dist-bzip2])
-
-dnl Checks for programs.
-AC_PROG_CC
-AC_PROG_CXX
-AC_PROG_LIBTOOL
-AC_LANG([C++])
-
-AC_CONFIG_HEADERS([common-config.h])
-CPPFLAGS="-DHAVE_COMMON_CONFIG_H $CPPFLAGS"
-
-case "`(uname -sr) 2>/dev/null`" in
-"SunOS 5"*)
- SOLARIS=yes
- ;;
-"IRIX 6"*)
- LDFLAGS="-L/usr/lib32 $LDFLAGS"
- ;;
-"LynxOS 2"*)
- SJLJ_EXCEPTIONS=yes
- ;;
-esac
-
-case "$host_os" in
- mingw*)
- CPPFLAGS="$CPPFLAGS -DWINVER=0x0500 -D_WIN32_IE=0x0500"
- CXXFLAGS="$CXXFLAGS -mthreads"
- ;;
-esac
-
-dnl FIXME: Remove duplication between this script and ../unix/configure.in
-if test "$GCC" = yes; then
- CFLAGS="$CFLAGS -Wall"
- if test "$SOLARIS" = yes; then
- CFLAGS="$CFLAGS -Wno-unknown-pragmas -Wno-implicit-int"
- fi
-fi
-if test "$GXX" = yes; then
- CXXFLAGS="$CXXFLAGS -Wall"
- if test "$SOLARIS" = yes; then
- CXXFLAGS="$CXXFLAGS -Wno-unknown-pragmas -fpermissive"
- fi
- if test "$SJLJ_EXCEPTIONS" = yes; then
- CXXFLAGS="$CXXFLAGS -fsjlj-exceptions"
- fi
-fi
-
-dnl Check for zlib library
-INCLUDED_ZLIB=no
-AC_ARG_WITH([included-zlib],
- AS_HELP_STRING([--with-included-zlib],
- [use libz which is distributed with VNC]),
- [INCLUDED_ZLIB=yes],
- [AC_SEARCH_LIBS([inflateEnd], [z], [], [INCLUDED_ZLIB=yes])])
-
-AM_CONDITIONAL([INCLUDED_ZLIB], [ test "x$INCLUDED_ZLIB" = xyes ])
-AC_CONFIG_SUBDIRS([zlib])
-
-dnl Check for libjpeg library
-INCLUDED_JPEG=yes
-AC_ARG_WITH([system-jpeg],
- AS_HELP_STRING([--with-system-jpeg],
- [use libjpeg which is distributed with the O/S]),
- [AC_SEARCH_LIBS([jpeg_destroy_compress], [jpeg],
- [INCLUDED_JPEG=no], [])],
- [])
-
-AM_CONDITIONAL([INCLUDED_JPEG], [ test "x$INCLUDED_JPEG" = xyes ])
-AC_CONFIG_SUBDIRS([jpeg])
-
-AC_CHECK_FUNCS([vsnprintf snprintf strcasecmp strncasecmp])
-
-# IPv6 related functions
-AC_CHECK_FUNCS([inet_ntop getaddrinfo])
-
-AC_CHECK_TYPES([socklen_t], [], [], [[#include <sys/socket.h>]])
-
-AC_CHECK_HEADERS([sys/select.h])
-
-AC_OUTPUT([Makefile
- os/Makefile
- rdr/Makefile
- network/Makefile
- Xregion/Makefile
- rfb/Makefile])
diff --git a/common/network/Makefile.am b/common/network/Makefile.am
index c4bad93..3db5536 100644
--- a/common/network/Makefile.am
+++ b/common/network/Makefile.am
@@ -4,5 +4,5 @@
libnetwork_la_SOURCES = $(HDRS) TcpSocket.cxx
-libnetwork_la_CPPFLAGS = -I$(top_srcdir)
+libnetwork_la_CPPFLAGS = -I$(top_srcdir)/common
diff --git a/common/network/TcpSocket.cxx b/common/network/TcpSocket.cxx
index 7ceff0b..c95dfcf 100644
--- a/common/network/TcpSocket.cxx
+++ b/common/network/TcpSocket.cxx
@@ -16,8 +16,8 @@
* USA.
*/
-#ifdef HAVE_COMMON_CONFIG_H
-#include <common-config.h>
+#ifdef HAVE_CONFIG_H
+#include <config.h>
#endif
#ifdef WIN32
diff --git a/common/os/Makefile.am b/common/os/Makefile.am
index 3d89260..5e37290 100644
--- a/common/os/Makefile.am
+++ b/common/os/Makefile.am
@@ -3,3 +3,6 @@
HDRS = net.h print.h
libos_la_SOURCES = $(HDRS) print.c net.c
+
+libos_la_CPPFLAGS = -I$(top_srcdir)/common
+
diff --git a/common/os/net.c b/common/os/net.c
index 50ce868..5c0ac2d 100644
--- a/common/os/net.c
+++ b/common/os/net.c
@@ -16,8 +16,8 @@
* USA.
*/
-#ifdef HAVE_COMMON_CONFIG_H
-#include <common-config.h>
+#ifdef HAVE_CONFIG_H
+#include <config.h>
#endif
#include <stdlib.h>
diff --git a/common/os/net.h b/common/os/net.h
index acaf50f..bd8b21c 100644
--- a/common/os/net.h
+++ b/common/os/net.h
@@ -19,12 +19,8 @@
#ifndef OS_NET_H
#define OS_NET_H
-#ifdef HAVE_COMMON_CONFIG_H
-#include <common-config.h>
-#endif
-
-#ifdef WIN32
-#include <common-config.win.h>
+#ifdef HAVE_CONFIG_H
+#include <config.h>
#endif
#ifdef __cplusplus
diff --git a/common/os/print.c b/common/os/print.c
index 0f26de3..4be2203 100644
--- a/common/os/print.c
+++ b/common/os/print.c
@@ -16,8 +16,8 @@
* USA.
*/
-#ifdef HAVE_COMMON_CONFIG_H
-#include <common-config.h>
+#ifdef HAVE_CONFIG_H
+#include <config.h>
#endif
#include <os/print.h>
diff --git a/common/os/print.h b/common/os/print.h
index 523f3a1..442dd64 100644
--- a/common/os/print.h
+++ b/common/os/print.h
@@ -19,12 +19,8 @@
#ifndef OS_PRINT_H
#define OS_PRINT_H
-#ifdef HAVE_COMMON_CONFIG_H
-#include <common-config.h>
-#endif
-
-#ifdef WIN32
-#include <common-config.win.h>
+#ifdef HAVE_CONFIG_H
+#include <config.h>
#endif
#include <stdarg.h>
diff --git a/common/rdr/FdInStream.cxx b/common/rdr/FdInStream.cxx
index e2281b4..adb14c5 100644
--- a/common/rdr/FdInStream.cxx
+++ b/common/rdr/FdInStream.cxx
@@ -16,8 +16,8 @@
* USA.
*/
-#ifdef HAVE_COMMON_CONFIG_H
-#include <common-config.h>
+#ifdef HAVE_CONFIG_H
+#include <config.h>
#endif
#include <stdio.h>
diff --git a/common/rdr/FdOutStream.cxx b/common/rdr/FdOutStream.cxx
index c771166..c84c946 100644
--- a/common/rdr/FdOutStream.cxx
+++ b/common/rdr/FdOutStream.cxx
@@ -16,8 +16,8 @@
* USA.
*/
-#ifdef HAVE_COMMON_CONFIG_H
-#include <common-config.h>
+#ifdef HAVE_CONFIG_H
+#include <config.h>
#endif
#include <stdio.h>
diff --git a/common/rdr/Makefile.am b/common/rdr/Makefile.am
index e9a01c1..589ad80 100644
--- a/common/rdr/Makefile.am
+++ b/common/rdr/Makefile.am
@@ -9,10 +9,10 @@
InStream.cxx RandomStream.cxx ZlibInStream.cxx ZlibOutStream.cxx \
HexInStream.cxx HexOutStream.cxx
-librdr_la_CPPFLAGS = -I$(top_srcdir)
+librdr_la_CPPFLAGS = -I$(top_srcdir)/common
librdr_la_LIBADD =
if INCLUDED_ZLIB
-librdr_la_CPPFLAGS += -I$(top_srcdir)/zlib
-librdr_la_LIBADD += $(top_srcdir)/zlib/libz.la
+librdr_la_CPPFLAGS += -I$(top_srcdir)/common/zlib
+librdr_la_LIBADD += $(top_srcdir)/common/zlib/libz.la
endif
diff --git a/common/rfb/Makefile.am b/common/rfb/Makefile.am
index fdb119d..eec0076 100644
--- a/common/rfb/Makefile.am
+++ b/common/rfb/Makefile.am
@@ -41,10 +41,10 @@
VNCServerST.cxx ZRLEEncoder.cxx ZRLEDecoder.cxx encodings.cxx \
secTypes.cxx util.cxx
-librfb_la_CPPFLAGS = -I$(top_srcdir) -I$(top_srcdir)/../win
+librfb_la_CPPFLAGS = -I$(top_srcdir)/common -I$(top_srcdir)/win
librfb_la_LIBADD =
if INCLUDED_JPEG
-librfb_la_CPPFLAGS += -I$(top_srcdir)/jpeg
-librfb_la_LIBADD += $(top_srcdir)/jpeg/libjpeg.la
+librfb_la_CPPFLAGS += -I$(top_srcdir)/common/jpeg
+librfb_la_LIBADD += $(top_srcdir)/common/jpeg/libjpeg.la
endif
diff --git a/common/rfb/util.cxx b/common/rfb/util.cxx
index a50ea58..265114f 100644
--- a/common/rfb/util.cxx
+++ b/common/rfb/util.cxx
@@ -30,8 +30,8 @@
* is provided ``as is'' without express or implied warranty.
*/
-#ifdef HAVE_COMMON_CONFIG_H
-#include <common-config.h>
+#ifdef HAVE_CONFIG_H
+#include <config.h>
#endif
#include <rfb/util.h>
diff --git a/common/rfb/util.h b/common/rfb/util.h
index 933df52..4124769 100644
--- a/common/rfb/util.h
+++ b/common/rfb/util.h
@@ -23,8 +23,8 @@
#ifndef __RFB_UTIL_H__
#define __RFB_UTIL_H__
-#ifdef HAVE_COMMON_CONFIG_H
-#include <common-config.h>
+#ifdef HAVE_CONFIG_H
+#include <config.h>
#endif
#include <limits.h>