From: Constantin Kaplinsky Date: Fri, 2 Jun 2006 04:07:49 +0000 (+0000) Subject: Updated build scripts in unix/ for new directory layout. X-Git-Tag: v0.0.90~384^2~260 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=a3b60c41167d57ce0953c2cc1e3cd208e4ae7e26;p=tigervnc.git Updated build scripts in unix/ for new directory layout. git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@617 3789f03b-4d11-0410-bbf8-ca57d06f2519 --- diff --git a/common/configure b/common/configure index ac0e498c..10a9c029 100755 --- a/common/configure +++ b/common/configure @@ -1251,119 +1251,10 @@ fi - -ac_ext=c -# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. -ac_cpp='$CPP $CPPFLAGS' -ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' -ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' -cross_compiling=$ac_cv_prog_cc_cross - -echo $ac_n "checking for gethostbyname""... $ac_c" 1>&6 -echo "configure:1264: checking for gethostbyname" >&5 -if eval "test \"`echo '$''{'ac_cv_func_gethostbyname'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - cat > conftest.$ac_ext < -/* Override any gcc2 internal prototype to avoid an error. */ -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char gethostbyname(); - -int main() { - -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined (__stub_gethostbyname) || defined (__stub___gethostbyname) -choke me -#else -gethostbyname(); -#endif - -; return 0; } -EOF -if { (eval echo configure:1292: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - eval "ac_cv_func_gethostbyname=yes" -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - eval "ac_cv_func_gethostbyname=no" -fi -rm -f conftest* -fi - -if eval "test \"`echo '$ac_cv_func_'gethostbyname`\" = yes"; then - echo "$ac_t""yes" 1>&6 - INET_LIB_REQ= -else - echo "$ac_t""no" 1>&6 -INET_LIB_REQ=yes -fi - -if test "$INET_LIB_REQ" = yes; then - echo $ac_n "checking for gethostbyname in -lbsd""... $ac_c" 1>&6 -echo "configure:1314: checking for gethostbyname in -lbsd" >&5 -ac_lib_var=`echo bsd'_'gethostbyname | sed 'y%./+-%__p_%'` -if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - ac_save_LIBS="$LIBS" -LIBS="-lbsd $LIBS" -cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=yes" -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=no" -fi -rm -f conftest* -LIBS="$ac_save_LIBS" - -fi -if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then - echo "$ac_t""yes" 1>&6 - INET_LIB=-lbsd -else - echo "$ac_t""no" 1>&6 -INET_LIB= -fi - -fi -ac_ext=C -# CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. -ac_cpp='$CXXCPP $CPPFLAGS' -ac_compile='${CXX-g++} -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' -ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' -cross_compiling=$ac_cv_prog_cxx_cross - - - echo $ac_n "checking for socklen_t""... $ac_c" 1>&6 -echo "configure:1365: checking for socklen_t" >&5 +echo "configure:1256: checking for socklen_t" >&5 cat > conftest.$ac_ext < #include @@ -1372,7 +1263,7 @@ socklen_t x; accept(0, 0, &x); ; return 0; } EOF -if { (eval echo configure:1376: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1267: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* echo "$ac_t""yes" 1>&6 SOCKLEN_T_DEFINE='-DVNC_SOCKLEN_T=socklen_t' @@ -1556,7 +1447,6 @@ s%@JPEG_LIB@%$JPEG_LIB%g s%@VSNPRINTF_DEFINE@%$VSNPRINTF_DEFINE%g s%@STRCASECMP_DEFINE@%$STRCASECMP_DEFINE%g s%@STRNCASECMP_DEFINE@%$STRNCASECMP_DEFINE%g -s%@INET_LIB@%$INET_LIB%g s%@SOCKLEN_T_DEFINE@%$SOCKLEN_T_DEFINE%g CEOF diff --git a/common/configure.in b/common/configure.in index 9470cc4a..576eac7a 100644 --- a/common/configure.in +++ b/common/configure.in @@ -95,19 +95,6 @@ AC_CHECK_FUNC(strncasecmp,STRNCASECMP_DEFINE='-DHAVE_STRNCASECMP', STRNCASECMP_DEFINE=) AC_SUBST(STRNCASECMP_DEFINE) -dnl Under Lynx/OS 2.3, we have to link with -lbsd to resolve -dnl gethostbyname, inet_addr, htons etc. Check if it's necessary. -dnl NOTE: Did not want to use AC_SEARCH_LIBS which would add -dnl -lbsd to LIBS. We set INET_LIB instead. -AC_LANG_SAVE -AC_LANG_C -AC_CHECK_FUNC(gethostbyname,INET_LIB_REQ=,INET_LIB_REQ=yes) -if test "$INET_LIB_REQ" = yes; then - AC_CHECK_LIB(bsd,gethostbyname,INET_LIB=-lbsd,INET_LIB=) -fi -AC_LANG_RESTORE -AC_SUBST(INET_LIB) - AC_MSG_CHECKING(for socklen_t) AC_TRY_COMPILE( [#include diff --git a/unix/Makefile.in b/unix/Makefile.in index be38406e..34b0a048 100644 --- a/unix/Makefile.in +++ b/unix/Makefile.in @@ -2,7 +2,6 @@ PACKAGE = @PACKAGE@ VERSION = @VERSION@ -SUBDIRS = @ZLIB_DIR@ @JPEG_DIR@ intl rdr network Xregion rfb tx x0vncserver \ - vncviewer_unix po vncpasswd @VNCCONFIG_DIR@ +SUBDIRS = ../common intl tx x0vncserver vncviewer po vncpasswd @VNCCONFIG_DIR@ # followed by boilerplate.mk diff --git a/unix/README b/unix/README index 77871721..2b2fd807 100644 --- a/unix/README +++ b/unix/README @@ -132,7 +132,7 @@ the java directory to some suitable installation directory such as /usr/local/vnc/classes: % mkdir -p /usr/local/vnc/classes - % cp java/* /usr/local/vnc/classes + % cp ../common/javabin/* /usr/local/vnc/classes We recommend that you use the vncserver script to run Xvnc for you. You can edit the script as appropriate for your site. Things you may need to change diff --git a/unix/common.mk b/unix/common.mk new file mode 100644 index 00000000..95a8753a --- /dev/null +++ b/unix/common.mk @@ -0,0 +1,2 @@ +COMMON = @top_srcdir@/../common +TOP = @top_srcdir@ diff --git a/unix/configure.in b/unix/configure.in index 9b58f275..eaddfcd2 100644 --- a/unix/configure.in +++ b/unix/configure.in @@ -1,5 +1,5 @@ dnl Process this file with autoconf to produce a configure script. -AC_INIT(vncviewer_unix/vncviewer.cxx) +AC_INIT(vncviewer/vncviewer.cxx) PACKAGE=tightvnc VERSION=1.5.0 @@ -8,6 +8,11 @@ AC_DEFINE_UNQUOTED(VERSION, "$VERSION") AC_SUBST(PACKAGE) AC_SUBST(VERSION) +dnl Configure the common directory +echo "configuring common..." +(cd ../common; ./configure $*) +echo "...done configuring common" + dnl dirty hack to prevent use of -g in CFLAGS and CXXFLAGS ac_cv_prog_cc_g=no ac_cv_prog_cxx_g=no @@ -71,12 +76,9 @@ if test "$with_installed_zlib" = yes; then echo "using installed zlib" ZLIB_LIB=-lz else - ZLIB_DIR=zlib - ZLIB_INCLUDE='-I$(top_srcdir)/zlib' - ZLIB_LIB='$(top_srcdir)/zlib/libz.a' - echo "configuring zlib..." - (cd zlib; ./configure) - echo "...done configuring zlib" + ZLIB_DIR='$(COMMON)/zlib' + ZLIB_INCLUDE='-I$(COMMON)/zlib' + ZLIB_LIB='$(COMMON)/zlib/libz.a' fi AC_SUBST(ZLIB_DIR) @@ -91,12 +93,9 @@ if test "$with_installed_jpeg" = yes; then echo "using installed jpeg" JPEG_LIB=-ljpeg else - JPEG_DIR=jpeg/build - JPEG_INCLUDE='-I$(top_srcdir)/jpeg' - JPEG_LIB='$(top_srcdir)/jpeg/build/libjpeg.a' - echo "configuring jpeg..." - (mkdir jpeg/build; cd jpeg/build; ../configure) - echo "...done configuring jpeg" + JPEG_DIR='$(COMMON)/jpeg/build' + JPEG_INCLUDE='-I$(COMMON)/jpeg' + JPEG_LIB='$(COMMON)/jpeg/build/libjpeg.a' fi AC_SUBST(JPEG_DIR) @@ -110,7 +109,7 @@ if test "$enable_vncconfig" = no; then echo "vncconfig utility will not be built" VNCCONFIG_DIR= else - VNCCONFIG_DIR='vncconfig_unix' + VNCCONFIG_DIR='vncconfig' fi AC_SUBST(VNCCONFIG_DIR) @@ -139,17 +138,6 @@ else fi AC_SUBST(READDISPLAY_DEFINE) -AC_CHECK_FUNC(vsnprintf,VSNPRINTF_DEFINE='-DHAVE_VSNPRINTF',VSNPRINTF_DEFINE=) -AC_SUBST(VSNPRINTF_DEFINE) - -AC_CHECK_FUNC(strcasecmp,STRCASECMP_DEFINE='-DHAVE_STRCASECMP', - STRCASECMP_DEFINE=) -AC_SUBST(STRCASECMP_DEFINE) - -AC_CHECK_FUNC(strncasecmp,STRNCASECMP_DEFINE='-DHAVE_STRNCASECMP', - STRNCASECMP_DEFINE=) -AC_SUBST(STRNCASECMP_DEFINE) - dnl Under Lynx/OS 2.3, we have to link with -lbsd to resolve dnl gethostbyname, inet_addr, htons etc. Check if it's necessary. dnl NOTE: Did not want to use AC_SEARCH_LIBS which would add @@ -163,18 +151,6 @@ fi AC_LANG_RESTORE AC_SUBST(INET_LIB) -AC_MSG_CHECKING(for socklen_t) -AC_TRY_COMPILE( -[#include - #include ], -[socklen_t x; -accept(0, 0, &x);], -AC_MSG_RESULT(yes) -SOCKLEN_T_DEFINE='-DVNC_SOCKLEN_T=socklen_t', -AC_MSG_RESULT(using int) -SOCKLEN_T_DEFINE='-DVNC_SOCKLEN_T=int') -AC_SUBST(SOCKLEN_T_DEFINE) - AM_GNU_GETTEXT BOILERPLATE=boilerplate.mk @@ -185,14 +161,12 @@ if (sh -c "make --version" 2>/dev/null | grep GNU 2>&1 >/dev/null); then fi fi -AC_OUTPUT(Makefile:Makefile.in:$BOILERPLATE intl/Makefile po/Makefile.in \ - rdr/Makefile:rdr/Makefile.in:$BOILERPLATE \ - network/Makefile:network/Makefile.in:$BOILERPLATE \ - Xregion/Makefile:Xregion/Makefile.in:$BOILERPLATE \ - rfb/Makefile:rfb/Makefile.in:$BOILERPLATE \ - tx/Makefile:tx/Makefile.in:$BOILERPLATE \ - x0vncserver/Makefile:x0vncserver/Makefile.in:$BOILERPLATE \ - vncviewer_unix/Makefile:vncviewer_unix/Makefile.in:$BOILERPLATE \ - vncconfig_unix/Makefile:vncconfig_unix/Makefile.in:$BOILERPLATE \ - vncpasswd/Makefile:vncpasswd/Makefile.in:$BOILERPLATE \ +AC_OUTPUT(Makefile:common.mk:Makefile.in:$BOILERPLATE \ + tx/Makefile:common.mk:tx/Makefile.in:$BOILERPLATE \ + x0vncserver/Makefile:common.mk:x0vncserver/Makefile.in:$BOILERPLATE \ + vncviewer/Makefile:common.mk:vncviewer/Makefile.in:$BOILERPLATE \ + vncconfig/Makefile:common.mk:vncconfig/Makefile.in:$BOILERPLATE \ + vncpasswd/Makefile:common.mk:vncpasswd/Makefile.in:$BOILERPLATE \ + intl/Makefile \ + po/Makefile.in \ ) diff --git a/unix/tx/Makefile.in b/unix/tx/Makefile.in index 89c30b17..92f44949 100644 --- a/unix/tx/Makefile.in +++ b/unix/tx/Makefile.in @@ -3,7 +3,7 @@ SRCS = TXWindow.cxx TXScrollbar.cxx TXViewport.cxx TXImage.cxx TXMenu.cxx OBJS = $(SRCS:.cxx=.o) -DIR_CPPFLAGS = -I$(top_srcdir) @X_CFLAGS@ # X_CFLAGS are really CPPFLAGS +DIR_CPPFLAGS = -I$(COMMON) @X_CFLAGS@ # X_CFLAGS are really CPPFLAGS library = libtx.a diff --git a/unix/vncconfig/Makefile.in b/unix/vncconfig/Makefile.in index 4891fcd8..527a79ed 100644 --- a/unix/vncconfig/Makefile.in +++ b/unix/vncconfig/Makefile.in @@ -5,12 +5,13 @@ OBJS = vncExt.o vncconfig.o QueryConnectDialog.o program = vncconfig -DEP_LIBS = ../tx/libtx.a ../rfb/librfb.a ../network/libnetwork.a \ - ../rdr/librdr.a +DEP_LIBS = $(TOP)/tx/libtx.a $(COMMON)/rfb/librfb.a \ + $(COMMON)/network/libnetwork.a \ + $(COMMON)/rdr/librdr.a EXTRA_LIBS = @X_PRE_LIBS@ @X_LIBS@ -lX11 -lXext @X_EXTRA_LIBS@ -DIR_CPPFLAGS = -I$(top_srcdir) -I$(top_srcdir)/tx @X_CFLAGS@ # X_CFLAGS are really CPPFLAGS +DIR_CPPFLAGS = -I$(COMMON) -I$(TOP)/tx @X_CFLAGS@ # X_CFLAGS are really CPPFLAGS all:: $(program) diff --git a/unix/vncpasswd/Makefile.in b/unix/vncpasswd/Makefile.in index 927a7b92..a159b726 100644 --- a/unix/vncpasswd/Makefile.in +++ b/unix/vncpasswd/Makefile.in @@ -5,9 +5,9 @@ OBJS = vncpasswd.o program = vncpasswd -DEP_LIBS = ../rfb/librfb.a +DEP_LIBS = $(COMMON)/rfb/librfb.a -DIR_CPPFLAGS = -I$(top_srcdir) +DIR_CPPFLAGS = -I$(COMMON) all:: $(program) diff --git a/unix/vncviewer/Makefile.in b/unix/vncviewer/Makefile.in index 782b6804..3f574042 100644 --- a/unix/vncviewer/Makefile.in +++ b/unix/vncviewer/Makefile.in @@ -12,12 +12,14 @@ OBJS = $(SRCS:.cxx=.o) program = vncviewer -DEP_LIBS = ../tx/libtx.a ../rfb/librfb.a ../network/libnetwork.a \ - ../rdr/librdr.a +DEP_LIBS = $(TOP)/tx/libtx.a \ + $(COMMON)/rfb/librfb.a \ + $(COMMON)/network/libnetwork.a \ + $(COMMON)/rdr/librdr.a EXTRA_LIBS = @ZLIB_LIB@ @JPEG_LIB@ @X_PRE_LIBS@ @X_LIBS@ -lXext -lX11 @X_EXTRA_LIBS@ @LIBINTL@ -DIR_CPPFLAGS = -DLOCALEDIR=\"$(localedir)\" -I$(top_srcdir) -I$(top_srcdir)/tx -I$(top_srcdir)/intl @X_CFLAGS@ # X_CFLAGS are really CPPFLAGS +DIR_CPPFLAGS = -I$(COMMON) -I$(TOP) -I$(TOP)/tx -I$(TOP)/intl -DLOCALEDIR=\"$(localedir)\" @X_CFLAGS@ # X_CFLAGS are really CPPFLAGS all:: $(program) diff --git a/unix/x0vncserver/Makefile.in b/unix/x0vncserver/Makefile.in index cbb9fed6..39e66853 100644 --- a/unix/x0vncserver/Makefile.in +++ b/unix/x0vncserver/Makefile.in @@ -1,22 +1,22 @@ SRCS = Image.cxx TimeMillis.cxx PollingScheduler.cxx PollingManager.cxx \ Geometry.cxx \ - x0vncserver.cxx ../vncconfig_unix/QueryConnectDialog.cxx + x0vncserver.cxx ../vncconfig/QueryConnectDialog.cxx OBJS = $(SRCS:.cxx=.o) program = x0vncserver -DEP_LIBS = ../rfb/librfb.a \ - ../network/libnetwork.a \ - ../rdr/librdr.a \ - ../tx/libtx.a +DEP_LIBS = $(COMMON)/rfb/librfb.a \ + $(COMMON)/network/libnetwork.a \ + $(COMMON)/rdr/librdr.a \ + $(TOP)/tx/libtx.a EXTRA_LIBS = @ZLIB_LIB@ @JPEG_LIB@ @INET_LIB@ @X_PRE_LIBS@ @X_LIBS@ \ @XTEST_LIB@ -lXext -lX11 @X_EXTRA_LIBS@ # X_CFLAGS are really CPPFLAGS -DIR_CPPFLAGS = -I$(top_srcdir) -I$(top_srcdir)/tx -I$(top_srcdir)/vncconfig_unix \ +DIR_CPPFLAGS = -I$(COMMON) -I$(TOP) -I$(TOP)/tx -I$(TOP)/vncconfig \ @XTEST_DEFINE@ @READDISPLAY_DEFINE@ @MITSHM_DEFINE@ @X_CFLAGS@ all:: $(program) diff --git a/unix/x0vncserver/x0vncserver.cxx b/unix/x0vncserver/x0vncserver.cxx index 80483bf8..96240ea1 100644 --- a/unix/x0vncserver/x0vncserver.cxx +++ b/unix/x0vncserver/x0vncserver.cxx @@ -34,7 +34,7 @@ #include #include -#include +#include #include #include