From 6cbd82fea8c65cfa5384c75c6a2977b0561c79f8 Mon Sep 17 00:00:00 2001 From: eku Date: Wed, 12 Mar 2003 12:39:58 +0000 Subject: [PATCH] Editline changes: o got a FB-compliant makefile o uses configure o eventually compiles on SINIX-Z --- builds/posix/Makefile.in.extern.editline | 72 ++++++++++++++++++++++++ builds/posix/Makefile.in.firebird | 8 +-- builds/posix/make.defaults | 4 +- configure.in | 15 +++-- src/extern/editline/complete.c | 6 +- src/extern/editline/editline.h | 13 +++-- src/extern/editline/unix.h | 6 +- src/include/gen/autoconfig_msvc.h | 8 +++ src/make.new/config/config.h.in | 10 +++- 9 files changed, 119 insertions(+), 23 deletions(-) create mode 100644 builds/posix/Makefile.in.extern.editline diff --git a/builds/posix/Makefile.in.extern.editline b/builds/posix/Makefile.in.extern.editline new file mode 100644 index 0000000000..8f5ee86e7f --- /dev/null +++ b/builds/posix/Makefile.in.extern.editline @@ -0,0 +1,72 @@ +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# You may obtain a copy of the Licence at +# http://www.gnu.org/licences/lgpl.html +# +# As a special exception this file can also be included in modules +# with other source code as long as that source code has been +# released under an Open Source Initiative certificed licence. +# More information about OSI certification can be found at: +# http://www.opensource.org +# +# This module is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Lesser General Public Licence for more details. +# +# This module was created by members of the firebird development +# team. All individual contributions remain the Copyright (C) of +# those individuals and all rights are reserved. Contributors to +# this file are either listed below or can be obtained from a CVS +# history command. +# +# Created by: Erik Kunze +# +# Contributor(s): +# +# +# $Id: Makefile.in.extern.editline,v 1.1 2003-03-12 12:39:56 eku Exp $ +# +ROOT=.. +ObjModuleName=editline +## Set your options: +## -DANSI_ARROWS ANSI arrows keys work like emacs. +## -DHIDE Make static functions static (non debug). +## -DHIST_SIZE=n History size. +## -DUNIQUE_HISTORY Don't save command if same as last one. +## -DDO_SIGTSTP Send SIGTSTP on "suspend" key +CFLAGS:= -DANSI_ARROWS -DHIDE -DHIST_SIZE=100 -DUNIQUE_HISTORY -DSYS_UNIX + +include $(ROOT)/gen/make.platform +include $(ROOT)/gen/make.rules +include $(ROOT)/gen/make.defaults +include $(ROOT)/gen/make.shared.variables + +@SET_MAKE@ + +EDITLINE_Files = editline.c complete.c sysunix.c +EDITLINE_Sources = $(addprefix extern/editline/, $(EDITLINE_Files)) +EDITLINE_Objects = $(addprefix $(OBJ)/, $(addsuffix .o, $(basename $(EDITLINE_Sources)))) + +AllObjects = $(EDITLINE_Objects) +Dependencies = $(AllObjects:.o=.d) + + + +.PHONY: libeditline + + +libeditline : $(LIB)/libeditline.a + +$(LIB)/libeditline.a: $(EDITLINE_Objects) + -$(RM) $@ + $(AR) $@ $^ + -$(RANLIB) $@ + $(CHMOD_6) $@ + + +include $(ROOT)/gen/make.shared.targets + +-include $(Dependencies) diff --git a/builds/posix/Makefile.in.firebird b/builds/posix/Makefile.in.firebird index a57c4138e7..7cacec79e8 100644 --- a/builds/posix/Makefile.in.firebird +++ b/builds/posix/Makefile.in.firebird @@ -27,7 +27,7 @@ # Contributor(s): # # -# $Id: Makefile.in.firebird,v 1.29 2003-03-05 16:19:08 brodsom Exp $ +# $Id: Makefile.in.firebird,v 1.30 2003-03-12 12:39:56 eku Exp $ # ROOT=.. @@ -183,13 +183,13 @@ jrd/build_no.h : misc/writeBuildNum.sh # EXTERNAL_LIBRARIES= ifeq ($(EDITLINE_FLG),Y) -EXTERNAL_LIBRARIES:= $(EXTERNAL_LIBRARIES) $(LIBEDIT_A) +EXTERNAL_LIBRARIES:= $(EXTERNAL_LIBRARIES) $(LIBEDITLINE_A) endif external_libraries: $(EXTERNAL_LIBRARIES) -$(LIBEDIT_A): - $(MAKE) -C $(SRC_ROOT)/extern/editline +$(LIBEDITLINE_A): + $(MAKE) -f $(MAKE_ROOT)/Makefile.extern.editline #--------------------------------------------------------------------------- diff --git a/builds/posix/make.defaults b/builds/posix/make.defaults index 5581ec9715..f04eecb143 100755 --- a/builds/posix/make.defaults +++ b/builds/posix/make.defaults @@ -26,7 +26,7 @@ # Contributor(s): # # -# $Id: make.defaults,v 1.17 2003-03-05 15:49:07 brodsom Exp $ +# $Id: make.defaults,v 1.18 2003-03-12 12:39:56 eku Exp $ # @@ -131,7 +131,7 @@ LIBFBINTL_SO = $(FIREBIRD)/intl/libfbintl.$(SHRLIB_EXT) LIBFBCOMMON_A = $(LIB)/libfbcommon.a LIBFBSTATIC_A = $(LIB)/libfbstatic.a -LIBEDIT_A = $(LIB)/libedit.a +LIBEDITLINE_A = $(LIB)/libeditline.a ifdef UseSharedLibraries LIBGDS_LA = $(LIBGDS_SO) diff --git a/configure.in b/configure.in index 0f6b51eaf9..e0e8a644ca 100644 --- a/configure.in +++ b/configure.in @@ -1,4 +1,4 @@ -dnl $Id: configure.in,v 1.128 2003-03-12 11:57:54 skidder Exp $ +dnl $Id: configure.in,v 1.129 2003-03-12 12:39:54 eku Exp $ dnl ############################# INITIALISATION ############################### @@ -100,7 +100,7 @@ case "$target" in PLATFORM="SINIX-Z" AC_DEFINE(SINIXZ) LOCK_MANAGER_FLG=N - EDITLINE_FLG=N + EDITLINE_FLG=Y SHRLIB_EXT=so ;; @@ -290,9 +290,10 @@ AC_CHECK_HEADERS(stdlib.h) AC_CHECK_HEADERS(string.h) AC_CHECK_HEADERS(signal.h) if test "$EDITLINE_FLG" = "Y"; then + AC_CHECK_HEADERS(termio.h termios.h) + AC_HEADER_DIRENT AC_DEFINE(HAVE_EDITLINE_H) fi -AC_CHECK_HEADERS(pwd.h) AC_CHECK_HEADERS(unistd.h) AC_CHECK_HEADERS(varargs.h) AC_CHECK_HEADERS(crypt.h) @@ -314,7 +315,7 @@ AC_CHECK_LIB(crypt, main) AC_CHECK_LIB(curses, main) dnl AC_CHECK_LIB(termcap, main) if test "$EDITLINE_FLG" = "Y"; then - AC_SUBST(EDITLINE_A, -ledit) + AC_SUBST(EDITLINE_A, -leditline) fi AC_CHECK_LIB(stdc++, main,,, $LIBS) @@ -379,6 +380,7 @@ if test "$ac_cv_func_getmntent" = "yes"; then [AC_DEFINE(GETMNTENT_TAKES_TWO_ARGUMENTS) AC_MSG_RESULT(yes)], [AC_MSG_RESULT(no)]) fi +AC_CHECK_FUNCS(tcgetattr strdup) dnl Check for other things @@ -485,7 +487,7 @@ case "$PLATFORM" in [FB_PIPE_NAME=${withval}]) AC_DEFINE_UNQUOTED(FB_PIPE_NAME,"$FB_PIPE_NAME") AC_SUBST(FB_PIPE_NAME) - XE_PREPEND(-lmpr -lcomctl32 -lversion -lws2_32 -lgdi32 ,LIBS) + XE_PREPEND(-lmpr -lcomctl32 -lversion -lws2_32 -lgdi32,LIBS) ;; *) @@ -687,6 +689,8 @@ mkdir -p gen/libfbembed/common/classes mkdir -p gen/libfbembed/common/config mkdir -p gen/RPM/RPMS/i686 mkdir -p gen/RPM/BUILD + +mkdir -p gen/editline/extern/editline ]) @@ -769,6 +773,7 @@ gen/Makefile.embed.gpre:${MAKE_SRC_DIR}/Makefile.in.embed.gpre src/v5_examples/Makefile:${MAKE_SRC_DIR}/Makefile.in.example5 gen/Makefile.install:src/install/arch-specific/${MAKEFILE_PREFIX}/Makefile.in Makefile:Makefile.in +gen/Makefile.extern.editline:${MAKE_SRC_DIR}/Makefile.in.extern.editline ) diff --git a/src/extern/editline/complete.c b/src/extern/editline/complete.c index c5c7bd50ba..aa6bb1191d 100644 --- a/src/extern/editline/complete.c +++ b/src/extern/editline/complete.c @@ -1,11 +1,11 @@ -/* $Revision: 1.1 $ +/* $Revision: 1.2 $ ** ** History and file completion functions for editline library. */ #include "editline.h" -#if defined(NEED_STRDUP) +#ifndef HAVE_STRDUP /* ** Return an allocated copy of a string. */ @@ -19,7 +19,7 @@ strdup(p) (void)strcpy(new, p); return new; } -#endif /* defined(NEED_STRDUP) */ +#endif /* !HAVE_STRDUP */ /* ** strcmp-like sorting predicate for qsort. diff --git a/src/extern/editline/editline.h b/src/extern/editline/editline.h index d14553393f..be6c183fe0 100644 --- a/src/extern/editline/editline.h +++ b/src/extern/editline/editline.h @@ -1,12 +1,15 @@ -/* $Revision: 1.1 $ +/* $Revision: 1.2 $ ** ** Internal header file for editline library. */ + +#include "gen/autoconfig.h" + #include -#if defined(HAVE_STDLIB) +#if defined(HAVE_STDLIB_H) #include #include -#endif /* defined(HAVE_STDLIB) */ +#endif /* defined(HAVE_STDLIB_H) */ #if defined(SYS_UNIX) #include "unix.h" #endif /* defined(SYS_UNIX) */ @@ -63,7 +66,7 @@ extern int rl_list_possib(); extern void rl_ttyset(); extern void rl_add_slash(); -#if !defined(HAVE_STDLIB) +#if !defined(HAVE_STDLIB_H) extern char *getenv(); extern char *malloc(); extern char *realloc(); @@ -76,4 +79,4 @@ extern char *strdup(); extern int strcmp(); extern int strlen(); extern int strncmp(); -#endif /* !defined(HAVE_STDLIB) */ +#endif /* !defined(HAVE_STDLIB_H) */ diff --git a/src/extern/editline/unix.h b/src/extern/editline/unix.h index fe6beedcec..080f009819 100644 --- a/src/extern/editline/unix.h +++ b/src/extern/editline/unix.h @@ -1,4 +1,4 @@ -/* $Revision: 1.1 $ +/* $Revision: 1.2 $ ** ** Editline system header file for Unix. */ @@ -9,13 +9,13 @@ #include #include -#if defined(USE_DIRENT) +#ifdef HAVE_DIRENT_H #include typedef struct dirent DIRENTRY; #else #include typedef struct direct DIRENTRY; -#endif /* defined(USE_DIRENT) */ +#endif /* HAVE_DIRENT_H */ #if !defined(S_ISDIR) #define S_ISDIR(m) (((m) & S_IFMT) == S_IFDIR) diff --git a/src/include/gen/autoconfig_msvc.h b/src/include/gen/autoconfig_msvc.h index 8d337ed59f..2fd50a6be8 100644 --- a/src/include/gen/autoconfig_msvc.h +++ b/src/include/gen/autoconfig_msvc.h @@ -98,6 +98,12 @@ #define HAVE_STRING_H #define HAVE_SIGNAL_H #undef HAVE_EDITLINE_H +#undef HAVE_TERMIO_H +#undef HAVE_TERMIOS_H +#undef HAVE_DIRENT_H +#undef HAVE_SYS_NDIR_H +#undef HAVE_SYS_DIR_H +#undef HAVE_NDIR_H #undef HAVE_UNISTD_H #undef HAVE_VARARGS_H #undef HAVE_VFORK_H @@ -153,6 +159,8 @@ #undef HAVE_SETMNTENT #undef HAVE_GETMNTENT #undef GETMNTENT_TAKES_TWO_ARGUMENTS +#undef HAVE_TCGETATTR +#define HAVE_STRDUP /* Types */ diff --git a/src/make.new/config/config.h.in b/src/make.new/config/config.h.in index cc10c5faa1..7c3ded3a23 100644 --- a/src/make.new/config/config.h.in +++ b/src/make.new/config/config.h.in @@ -1,4 +1,4 @@ -#ident "$Id: config.h.in,v 1.72 2003-02-20 06:36:40 eku Exp $" +#ident "$Id: config.h.in,v 1.73 2003-03-12 12:39:58 eku Exp $" /* * 2002.02.15 Sean Leyne - Code Cleanup, removed obsolete ports: @@ -46,6 +46,12 @@ #undef HAVE_STDLIB_H #undef HAVE_STRING_H #undef HAVE_SIGNAL_H +#undef HAVE_TERMIO_H +#undef HAVE_TERMIOS_H +#undef HAVE_DIRENT_H +#undef HAVE_SYS_NDIR_H +#undef HAVE_SYS_DIR_H +#undef HAVE_NDIR_H #undef HAVE_UNISTD_H #undef HAVE_VARARGS_H #undef HAVE_VFORK_H @@ -101,6 +107,8 @@ #undef HAVE_SETMNTENT #undef HAVE_GETMNTENT #undef GETMNTENT_TAKES_TWO_ARGUMENTS +#undef HAVE_TCGETATTR +#undef HAVE_STRDUP /* Types */