From: Christian Bauer Date: Thu, 11 Nov 1999 18:51:50 +0000 (+0000) Subject: - removed strdup() replacement from ginsh X-Git-Tag: release_0-5-0~176 X-Git-Url: https://www.ginac.de/ginac.git//ginac.git?p=ginac.git;a=commitdiff_plain;h=9b35043e6fb19831aefd02cbbf9f9ce0bacc3291 - removed strdup() replacement from ginsh --- diff --git a/config.h.in b/config.h.in index 2be7888b..68ccf3ce 100644 --- a/config.h.in +++ b/config.h.in @@ -9,9 +9,6 @@ /* Define to the version of the distribution. */ #undef VERSION -/* Define if you have the strdup function. */ -#undef HAVE_STRDUP - /* Define if you have the header file. */ #undef HAVE_CLN_CLN_H diff --git a/configure b/configure index 177b3a8d..ef612180 100755 --- a/configure +++ b/configure @@ -2121,81 +2121,21 @@ else fi done -for ac_func in strdup -do -echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:2128: checking for $ac_func" >&5 -if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+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. */ -#ifdef __cplusplus -extern "C" -#endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char $ac_func(); - -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_$ac_func) || defined (__stub___$ac_func) -choke me -#else -$ac_func(); -#endif - -; return 0; } -EOF -if { (eval echo configure:2159: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then - rm -rf conftest* - eval "ac_cv_func_$ac_func=yes" -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - eval "ac_cv_func_$ac_func=no" -fi -rm -f conftest* -fi - -if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then - echo "$ac_t""yes" 1>&6 - ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` - cat >> confdefs.h <&6 -LIBOBJS="$LIBOBJS ${ac_func}.o" -fi -done - - for ac_hdr in readline/readline.h readline/history.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:2189: checking for $ac_hdr" >&5 +echo "configure:2129: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2199: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2139: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then rm -rf conftest* @@ -2222,7 +2162,7 @@ fi done echo $ac_n "checking for readline in -lreadline""... $ac_c" 1>&6 -echo "configure:2226: checking for readline in -lreadline" >&5 +echo "configure:2166: checking for readline in -lreadline" >&5 ac_lib_var=`echo readline'_'readline | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -2230,7 +2170,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lreadline $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:2188: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -2275,7 +2215,7 @@ fi # Extract the first word of "doxygen", so it can be a program name with args. set dummy doxygen; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:2279: checking for $ac_word" >&5 +echo "configure:2219: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_DOXYGEN'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2307,7 +2247,7 @@ fi # Extract the first word of "latex", so it can be a program name with args. set dummy latex; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:2311: checking for $ac_word" >&5 +echo "configure:2251: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_LATEX'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2339,7 +2279,7 @@ fi # Extract the first word of "makeindex", so it can be a program name with args. set dummy makeindex; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:2343: checking for $ac_word" >&5 +echo "configure:2283: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_MAKEINDEX'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2371,7 +2311,7 @@ fi # Extract the first word of "dvips", so it can be a program name with args. set dummy dvips; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:2375: checking for $ac_word" >&5 +echo "configure:2315: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_DVIPS'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2403,7 +2343,7 @@ fi # Extract the first word of "fig2dev", so it can be a program name with args. set dummy fig2dev; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:2407: checking for $ac_word" >&5 +echo "configure:2347: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_FIG2DEV'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2435,7 +2375,7 @@ fi # Extract the first word of "jade", so it can be a program name with args. set dummy jade; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:2439: checking for $ac_word" >&5 +echo "configure:2379: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_JADE'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2467,7 +2407,7 @@ fi # Extract the first word of "jadetex", so it can be a program name with args. set dummy jadetex; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:2471: checking for $ac_word" >&5 +echo "configure:2411: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_JADETEX'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2668,7 +2608,6 @@ s%@LEXLIB@%$LEXLIB%g s%@CPP@%$CPP%g s%@LEX_OUTPUT_ROOT@%$LEX_OUTPUT_ROOT%g s%@YACC@%$YACC%g -s%@LIBOBJS@%$LIBOBJS%g s%@DOXYGEN@%$DOXYGEN%g s%@LATEX@%$LATEX%g s%@MAKEINDEX@%$MAKEINDEX%g diff --git a/configure.in b/configure.in index cfdf0fc0..22ba092b 100644 --- a/configure.in +++ b/configure.in @@ -77,7 +77,6 @@ GINAC_CHECK_LIBCLN dnl Check for stuff needed for building the GiNaC interactive shell (ginsh): AC_CHECK_HEADERS(unistd.h) -AC_REPLACE_FUNCS(strdup) AC_CHECK_HEADERS(readline/readline.h readline/history.h) AC_CHECK_LIB(readline, readline) diff --git a/ginsh/Makefile.am b/ginsh/Makefile.am index cc02f92d..beadb19a 100644 --- a/ginsh/Makefile.am +++ b/ginsh/Makefile.am @@ -1,7 +1,7 @@ ## Process this file with automake to produce Makefile.in bin_PROGRAMS = ginsh ginsh_SOURCES = ginsh_parser.yy ginsh_lexer.ll ginsh.h -ginsh_LDADD = @LIBOBJS@ ../ginac/libginac.la +ginsh_LDADD = ../ginac/libginac.la man_MANS = ginsh.1 YFLAGS = -d EXTRA_DIST = ginsh_parser.h diff --git a/ginsh/Makefile.in b/ginsh/Makefile.in index 0d919048..a97b8fbe 100644 --- a/ginsh/Makefile.in +++ b/ginsh/Makefile.in @@ -93,7 +93,7 @@ YACC = @YACC@ bin_PROGRAMS = ginsh ginsh_SOURCES = ginsh_parser.yy ginsh_lexer.ll ginsh.h -ginsh_LDADD = @LIBOBJS@ ../ginac/libginac.la +ginsh_LDADD = ../ginac/libginac.la man_MANS = ginsh.1 YFLAGS = -d EXTRA_DIST = ginsh_parser.h @@ -108,7 +108,7 @@ CPPFLAGS = @CPPFLAGS@ LDFLAGS = @LDFLAGS@ LIBS = @LIBS@ ginsh_OBJECTS = ginsh_parser.o ginsh_lexer.o -ginsh_DEPENDENCIES = @LIBOBJS@ ../ginac/libginac.la +ginsh_DEPENDENCIES = ../ginac/libginac.la ginsh_LDFLAGS = LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LEXLIB = @LEXLIB@ @@ -124,15 +124,14 @@ man1dir = $(mandir)/man1 MANS = $(man_MANS) NROFF = nroff -DIST_COMMON = Makefile.am Makefile.in ginsh_lexer.cc ginsh_parser.cc \ -strdup.c +DIST_COMMON = Makefile.am Makefile.in ginsh_lexer.cc ginsh_parser.cc DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST) TAR = tar GZIP = --best -DEP_FILES = .deps/ginsh_lexer.P .deps/ginsh_parser.P .deps/strdup.P +DEP_FILES = .deps/ginsh_lexer.P .deps/ginsh_parser.P CXXMKDEP = $(CXX) -M $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CXXFLAGS) SOURCES = $(ginsh_SOURCES) OBJECTS = $(ginsh_OBJECTS) diff --git a/ginsh/strdup.c b/ginsh/strdup.c deleted file mode 100644 index 0d5f1056..00000000 --- a/ginsh/strdup.c +++ /dev/null @@ -1,27 +0,0 @@ -/** @file strdup.c - * - * Replacement for strdup() function for systems that don't have it. - * - * GiNaC (C) 1999 Johannes Gutenberg University Mainz, Germany - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -char *strdup(const char *s) -{ - char *n = (char *)malloc(strlen(s) + 1); - strcpy(n, s); - return n; -}