From 56e406490a90c1570b9008f226e70974b5d8874d Mon Sep 17 00:00:00 2001 From: Ovidiu Predescu Date: Fri, 3 Oct 1997 22:02:27 +0000 Subject: [PATCH] Use the host install program if possible. git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/tools/make/trunk@2479 72102866-910b-0410-8b05-ffd578937521 --- ChangeLog | 12 ++++++++++++ Makefile.in | 6 +++++- config.make.in | 2 +- configure | 50 +++++++++++++++++++++++++++++++------------------- configure.in | 11 +++++++++++ which_lib.c | 21 +++++++++++---------- 6 files changed, 71 insertions(+), 31 deletions(-) diff --git a/ChangeLog b/ChangeLog index e556f162..447a8193 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,15 @@ +Fri Oct 3 14:48:15 1997 Ovidiu Predescu + + * Support the host install program if any. + * Makefile.in: Added definitions for INSTALL variable. Delete the + which_lib program in the clean target. + * config.make.in: Define INSTALL to be the value of HOST_INSTALL + instead of INSTALL. + * configure.in: Check if the INSTALL program is the install-sh script. + If so define HOST_INSTALL to be the install script; otherwise it is + the host install program. + * which_lib.c: Include limits.h. + Fri Oct 3 13:43:18 1997 Ovidiu Predescu * Added support for linking with different types of a library, diff --git a/Makefile.in b/Makefile.in index 7d8eaeaf..f7abdbb6 100644 --- a/Makefile.in +++ b/Makefile.in @@ -46,6 +46,10 @@ GNUSTEP_TARGET_OS := $(shell ./clean_os.sh $(GNUSTEP_TARGET_OS)) makedir = $(prefix)/Makefiles GNUSTEP_TARGET_DIR = $(GNUSTEP_TARGET_CPU)/$(GNUSTEP_TARGET_OS) +INSTALL = @INSTALL@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_DATA = @INSTALL_DATA@ + all: which_lib which_lib: which_lib.c @@ -72,7 +76,7 @@ uninstall: rm -rf $(makedir) clean: - rm -f *~ + rm -f *~ which_lib distclean: clean rm -f Makefile config.make diff --git a/config.make.in b/config.make.in index 0af14d1e..c06ff077 100644 --- a/config.make.in +++ b/config.make.in @@ -45,7 +45,7 @@ RANLIB = @RANLIB@ RC = @RC@ DLLTOOL = @DLLTOOL@ -INSTALL = @INSTALL@ +INSTALL = @HOST_INSTALL@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_DATA = @INSTALL_DATA@ diff --git a/configure b/configure index 23735c75..d05e1d1d 100755 --- a/configure +++ b/configure @@ -939,6 +939,7 @@ else echo "$ac_t""no" 1>&6 fi + # Find a good install program. We prefer a C program (faster), # so one script is as good as another. But avoid the broken or # incompatible versions: @@ -950,7 +951,7 @@ fi # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # ./install, which can be erroneously created by make from ./install.sh. echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6 -echo "configure:954: checking for a BSD compatible install" >&5 +echo "configure:955: checking for a BSD compatible install" >&5 if test -z "$INSTALL"; then if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -999,8 +1000,18 @@ test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' +# HOST_INSTALL is the name of the install program in config.make so set it up +# to point to the install-sh script in the GNUstep tree if no system install is +# found. + +if test "$INSTALL" = "$ac_install_sh"; then + HOST_INSTALL=$prefix/Makefiles/$INSTALL +else + HOST_INSTALL=$INSTALL +fi + echo $ac_n "checking whether ln -s works""... $ac_c" 1>&6 -echo "configure:1004: checking whether ln -s works" >&5 +echo "configure:1015: checking whether ln -s works" >&5 if eval "test \"`echo '$''{'ac_cv_prog_LN_S'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1029,7 +1040,7 @@ fi # Uses ac_ vars as temps to allow command line to override cache and checks. # --without-x overrides everything else, but does not touch the cache. echo $ac_n "checking for X""... $ac_c" 1>&6 -echo "configure:1033: checking for X" >&5 +echo "configure:1044: checking for X" >&5 # Check whether --with-x or --without-x was given. if test "${with_x+set}" = set; then @@ -1091,12 +1102,12 @@ if test "$ac_x_includes" = NO; then # First, try using that file with no special directory specified. cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1100: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1111: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then rm -rf conftest* @@ -1165,14 +1176,14 @@ if test "$ac_x_libraries" = NO; then ac_save_LIBS="$LIBS" LIBS="-l$x_direct_test_library $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:1187: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* LIBS="$ac_save_LIBS" # We can link X programs with no special library path. @@ -1275,12 +1286,12 @@ for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr that defines DIR""... $ac_c" 1>&6 -echo "configure:1279: checking for $ac_hdr that defines DIR" >&5 +echo "configure:1290: checking for $ac_hdr that defines DIR" >&5 if eval "test \"`echo '$''{'ac_cv_header_dirent_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include <$ac_hdr> @@ -1288,7 +1299,7 @@ int main() { DIR *dirp = 0; ; return 0; } EOF -if { (eval echo configure:1292: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1303: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* eval "ac_cv_header_dirent_$ac_safe=yes" else @@ -1313,7 +1324,7 @@ done # Two versions of opendir et al. are in -ldir and -lx on SCO Xenix. if test $ac_header_dirent = dirent.h; then echo $ac_n "checking for opendir in -ldir""... $ac_c" 1>&6 -echo "configure:1317: checking for opendir in -ldir" >&5 +echo "configure:1328: checking for opendir in -ldir" >&5 ac_lib_var=`echo dir'_'opendir | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -1321,7 +1332,7 @@ else ac_save_LIBS="$LIBS" LIBS="-ldir $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:1347: \"$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 @@ -1354,7 +1365,7 @@ fi else echo $ac_n "checking for opendir in -lx""... $ac_c" 1>&6 -echo "configure:1358: checking for opendir in -lx" >&5 +echo "configure:1369: checking for opendir in -lx" >&5 ac_lib_var=`echo x'_'opendir | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -1362,7 +1373,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lx $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:1388: \"$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 @@ -1399,17 +1410,17 @@ for ac_hdr in sys/param.h sys/file.h dir.h string.h stdlib.h sys/types.h sys/s do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:1403: checking for $ac_hdr" >&5 +echo "configure:1414: 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:1413: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1424: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then rm -rf conftest* @@ -1612,6 +1623,7 @@ s%@CPP@%$CPP%g s%@RANLIB@%$RANLIB%g s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g s%@INSTALL_DATA@%$INSTALL_DATA%g +s%@HOST_INSTALL@%$HOST_INSTALL%g s%@LN_S@%$LN_S%g s%@X_INCLUDE@%$X_INCLUDE%g s%@X_LIBS@%$X_LIBS%g diff --git a/configure.in b/configure.in index 843e30f4..14c0ccb2 100644 --- a/configure.in +++ b/configure.in @@ -43,7 +43,18 @@ AC_CANONICAL_SYSTEM AC_PROG_CC AC_PROG_CPP AC_PROG_RANLIB + AC_PROG_INSTALL +# HOST_INSTALL is the name of the install program in config.make so set it up +# to point to the install-sh script in the GNUstep tree if no system install is +# found. +AC_SUBST(HOST_INSTALL) +if test "$INSTALL" = "$ac_install_sh"; then + HOST_INSTALL=$prefix/Makefiles/$INSTALL +else + HOST_INSTALL=$INSTALL +fi + AC_LN_S #-------------------------------------------------------------------- diff --git a/which_lib.c b/which_lib.c index 8fec3d5d..09cd2701 100644 --- a/which_lib.c +++ b/which_lib.c @@ -53,6 +53,12 @@ # include #endif +#if HAVE_SYS_STAT_H +# include +#endif + +#include + #if defined(HAVE_DIRENT_H) # include #elif defined(HAVE_SYS_DIR_H) @@ -79,13 +85,14 @@ /* determine filesystem max path length */ -#ifdef _POSIX_VERSION # include /* for PATH_MAX */ + +#ifdef _POSIX_VERSION # include #else -#if HAVE_SYS_PARAM_H -# include /* for MAXPATHLEN */ -#endif +# if HAVE_SYS_PARAM_H +# include /* for MAXPATHLEN */ +# endif #endif #ifndef PATH_MAX @@ -104,12 +111,6 @@ #include #endif -#if HAVE_SYS_STAT_H -# include -#endif - -#include - #define PATH_SEP "/" /* Array of strings that are the library paths passed to compiler */