summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Makefile.am21
-rw-r--r--configure.ac31
-rw-r--r--contrib/Makefile.am7
-rw-r--r--examples/Makefile.am5
-rw-r--r--examples/vncev.c1
-rw-r--r--libvncserver-config.in64
-rw-r--r--libvncserver.spec.in6
7 files changed, 122 insertions, 13 deletions
diff --git a/Makefile.am b/Makefile.am
index 9a52747..23b8d11 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -1,12 +1,24 @@
SUBDIRS=. examples contrib
DIST_SUBDIRS=examples contrib
+bin_SCRIPTS = libvncserver-config
+
include_HEADERS=include/rfb.h include/rfbconfig.h include/rfbproto.h \
include/keysym.h
+noinst_HEADERS=sraRegion.h d3des.h zrleDecode.h zrleEncode.h \
+ include/default8x16.h \
+ rdr/Exception.h rdr/FdInStream.h rdr/FdOutStream.h \
+ rdr/FixedMemOutStream.h rdr/InStream.h rdr/MemInStream.h \
+ rdr/MemOutStream.h rdr/NullOutStream.h rdr/OutStream.h \
+ rdr/ZlibInStream.h rdr/ZlibOutStream.h rdr/types.h
+
ZRLE_SRCS=zrle.cxx rdr/FdInStream.cxx rdr/FdOutStream.cxx rdr/InStream.cxx \
rdr/NullOutStream.cxx rdr/ZlibInStream.cxx rdr/ZlibOutStream.cxx
+EXTRA_DIST=tableinit24.c tableinittctemplate.c tabletranstemplate.c \
+ tableinitcmtemplate.c tabletrans24template.c $(ZRLE_SRCS)
+
LIB_SOURCES = main.c rfbserver.c sraRegion.c auth.c sockets.c \
stats.c corre.c hextile.c rre.c translate.c cutpaste.c \
zlib.c tight.c httpd.c cursor.c font.c \
@@ -19,3 +31,12 @@ libvncserver_a_SOURCES=$(LIB_SOURCES)
endif
lib_LIBRARIES=libvncserver.a
+
+if HAVE_RPM
+$(PACKAGE)-$(VERSION).tar.gz: dist
+
+# Rule to build RPM distribution package
+rpm: $(PACKAGE)-$(VERSION).tar.gz
+ cp $(PACKAGE)-$(VERSION).tar.gz @RPMSOURCEDIR@
+ rpm -ba libvncserver.spec
+endif
diff --git a/configure.ac b/configure.ac
index 822e5ef..58e0ede 100644
--- a/configure.ac
+++ b/configure.ac
@@ -5,7 +5,7 @@ AM_CONFIG_HEADER([include/rfbconfig.h])
# Checks for programs.
AC_PROG_CC
-CCLD=$CC
+CCLD="\$(CC)"
AC_PROG_MAKE_SET
AC_PROG_RANLIB
@@ -39,10 +39,12 @@ AC_CHECK_HEADERS(jpeglib.h pthread.h zlib.h)
if test ! -z "$HAVE_JPEGLIB.H"; then
AC_CHECK_LIB(jpeg, jpeg_CreateCompress)
fi
-AM_CONDITIONAL(HAVE_LIBPTHREAD, test ! -z "$HAVE_PTHREAD.H")
if test ! -z "$HAVE_PTHREAD.H"; then
AC_CHECK_LIB(pthread, pthread_mutex_lock)
+ AC_CHECK_LIB(pthread, pthread_mutex_lock, HAVE_LIBPTHREAD="true")
fi
+#AM_CONDITIONAL(HAVE_LIBPTHREAD, test ! -z "$HAVE_PTHREAD.H")
+AM_CONDITIONAL(HAVE_LIBPTHREAD, test ! -z "$HAVE_LIBPTHREAD")
if test ! -z "$HAVE_ZLIB.H"; then
AC_CHECK_LIB(z, deflate)
# check for c++, but don't fail if not found
@@ -51,7 +53,7 @@ if test ! -z "$HAVE_ZLIB.H"; then
if test x$CXX != xnone; then
AC_DEFINE(HAVE_ZRLE)
AC_PROG_CXX
- CCLD=$CXX
+ CCLD="\$(CXX)"
fi
else
CXX=none
@@ -59,10 +61,6 @@ fi
AM_CONDITIONAL(HAVE_CXX, test x$CXX != xnone)
AC_SUBST(CCLD)
-VNCLIBS="-L.. -lvncserver"
-
-LIBS="$VNCLIBS $LIBS"
-
# Checks for header files.
AC_HEADER_STDC
AC_CHECK_HEADERS([arpa/inet.h fcntl.h netdb.h netinet/in.h stdlib.h string.h sys/socket.h sys/time.h sys/timeb.h syslog.h unistd.h])
@@ -79,10 +77,27 @@ AC_FUNC_MEMCMP
AC_FUNC_STAT
AC_FUNC_STRFTIME
AC_FUNC_VPRINTF
+AC_CHECK_LIB(nsl,gethostbyname)
+AC_CHECK_LIB(socket,socket)
AC_CHECK_FUNCS([ftime gethostbyname gethostname gettimeofday inet_ntoa memmove memset mkfifo select socket strchr strcspn strdup strerror strstr])
+# Check for rpm SOURCES path
+echo -n "checking for rpm sources path... "
+RPMSOURCEDIR="NOT-FOUND"
+for directory in packages OpenLinux redhat RedHat rpm RPM "" ; do
+ if test -d /usr/src/${directory}/SOURCES; then
+ RPMSOURCEDIR="/usr/src/${directory}/SOURCES/"
+ fi
+done
+echo "$RPMSOURCEDIR"
+AM_CONDITIONAL(HAVE_RPM, test "$RPMSOURCEDIR" != "NOT-FOUND")
+AC_SUBST(RPMSOURCEDIR)
+
+LDADD="-L.. -lvncserver"
+
AC_CONFIG_FILES([Makefile
contrib/Makefile
examples/Makefile
- libvncserver.spec])
+ libvncserver.spec
+ libvncserver-config])
AC_OUTPUT
diff --git a/contrib/Makefile.am b/contrib/Makefile.am
index de73c82..bd5b291 100644
--- a/contrib/Makefile.am
+++ b/contrib/Makefile.am
@@ -1,10 +1,13 @@
+LDADD = -L.. -lvncserver
+
noinst_PROGRAMS=zippy
if HAVE_X
bin_PROGRAMS=x11vnc
x11vnc_SOURCES=x11vnc.c
-x11vnc_CFLAGSADD=@X_CFLAGS@
-x11vnc_LDADD=@X_LIBS@
+INCLUDES=@X_CFLAGS@
+x11vnc_LDADD=@X_LIBS@ $(LDADD)
endif
zippy_SOURCES=zippy.c
+
diff --git a/examples/Makefile.am b/examples/Makefile.am
index 16dff2a..98a4647 100644
--- a/examples/Makefile.am
+++ b/examples/Makefile.am
@@ -2,5 +2,10 @@ if HAVE_LIBPTHREAD
BACKGROUND_TEST=blooptest
endif
+noinst_HEADERS=radon.h
+
noinst_PROGRAMS=example pnmshow sratest pnmshow24 fontsel \
vncev storepasswd $(BACKGROUND_TEST)
+
+LDADD = -L.. -lvncserver
+
diff --git a/examples/vncev.c b/examples/vncev.c
index 8116815..663611d 100644
--- a/examples/vncev.c
+++ b/examples/vncev.c
@@ -1,6 +1,7 @@
/* This program is a simple server to show events coming from the client */
#include <stdio.h>
#include <stdlib.h>
+#include <sys/types.h>
#include <sys/socket.h>
#include "rfb.h"
#include "default8x16.h"
diff --git a/libvncserver-config.in b/libvncserver-config.in
new file mode 100644
index 0000000..7de2fbf
--- /dev/null
+++ b/libvncserver-config.in
@@ -0,0 +1,64 @@
+#!/bin/sh
+
+prefix=@prefix@
+exec_prefix=@exec_prefix@
+exec_prefix_set=no
+
+usage="\
+Usage: @PACKAGE@-config [--prefix[=DIR]] [--exec-prefix[=DIR]] [--version] [--libs] [--cflags]"
+
+if test $# -eq 0; then
+ echo "${usage}" 1>&2
+ exit 1
+fi
+
+while test $# -gt 0; do
+ case "$1" in
+ -*=*) optarg=`echo "$1" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
+ *) optarg= ;;
+ esac
+
+ case $1 in
+ --prefix=*)
+ prefix=$optarg
+ if test $exec_prefix_set = no ; then
+ exec_prefix=$optarg
+ fi
+ ;;
+ --prefix)
+ echo $prefix
+ ;;
+ --exec-prefix=*)
+ exec_prefix=$optarg
+ exec_prefix_set=yes
+ ;;
+ --exec-prefix)
+ echo $exec_prefix
+ ;;
+ --version)
+ echo @VERSION@
+ ;;
+ --cflags)
+ if test @includedir@ != /usr/include ; then
+ includes=-I@includedir@
+ fi
+ echo $includes
+ ;;
+ --libs)
+ if [ "`uname`" = "SunOS" ]; then
+ libdirs="-L@libdir@ -R@libdir@"
+ else
+ libdirs="-L@libdir@"
+ fi
+ echo $libdirs -lvncserver @LIBS@
+ ;;
+ --link)
+ echo @CCLD@
+ ;;
+ *)
+ echo "${usage}" 1>&2
+ exit 1
+ ;;
+ esac
+ shift
+done
diff --git a/libvncserver.spec.in b/libvncserver.spec.in
index b621591..5c51acc 100644
--- a/libvncserver.spec.in
+++ b/libvncserver.spec.in
@@ -51,8 +51,8 @@ make install prefix=$RPM_BUILD_ROOT%{prefix}
%files
%defattr(-,root,root)
%{prefix}
-%{_mandir}/man1/*
-%doc AUTHORS COPYING ChangeLog README TODO
%changelog
-see ChangeLog
+* Sun Feb 9 2003 Johannes Schindelin
+- created libvncserver.spec.in
+