sync the two build systems w.r.t. dirname() and basename()

This commit is contained in:
Charles Kerr 2007-07-30 14:31:03 +00:00
parent b9076b9f0d
commit 7ba03d40b7
5 changed files with 14 additions and 14 deletions

2
configure vendored
View File

@ -231,7 +231,7 @@ int main()
EOF
if runcmd $CC -o testconf testconf.c
then
CFLAGS="$CFLAGS -DHAVE_LIBGEN"
CFLAGS="$CFLAGS -DHAVE_DIRNAME -DHAVE_BASENAME"
fi
rm -f testconf*
}

View File

@ -19,7 +19,7 @@ AC_PROG_CC
AC_PROG_CXX
AC_HEADER_STDC
AC_HEADER_TIME
AC_CHECK_FUNCS([lrintf strlcpy strlcat daemon])
AC_CHECK_FUNCS([lrintf strlcpy strlcat daemon dirname basename])
AC_PROG_INSTALL
AC_PROG_MAKE_SET
AC_PROG_RANLIB
@ -33,7 +33,6 @@ ALL_LINGUAS="bg es fi fr it pl ro ru sv"
AM_GLIB_GNU_GETTEXT
transmissionlocaledir='${prefix}/${DATADIRNAME}/locale'
AC_CHECK_LIB([gen],[basename])
AC_CHECK_LIB([crypto],[CRYPTO_new_ex_data])
AC_CHECK_LIB([ssl],[SSL_library_init])
AC_SEARCH_LIBS([socket], [socket net])

View File

@ -17,7 +17,7 @@
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
#ifndef HAVE_LIBGEN
#ifndef HAVE_BASENAME
#include <errno.h>
#include <string.h>
@ -64,4 +64,4 @@ basename(const char *path)
return (bname);
}
#endif /* HAVE_LIBGEN */
#endif /* HAVE_BASENAME */

View File

@ -17,7 +17,7 @@
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
#ifndef HAVE_LIBGEN
#ifndef HAVE_DIRNAME
#include <errno.h>
#include <string.h>
@ -68,4 +68,4 @@ dirname(const char *path)
return (dname);
}
#endif /* HAVE_LIBGEN */
#endif /* HAVE_DIRNAME */

View File

@ -42,13 +42,14 @@ int asprintf( char **, const char *, ... );
int vasprintf( char **, const char *, va_list );
#endif
#ifdef HAVE_LIBGEN
# include <libgen.h>
#else
char *
dirname(const char *path);
char *
basename(const char *path);
#if defined(HAVE_DIRNAME) || defined(HAVE_BASENAME)
#include <libgen.h>
#endif
#ifndef HAVE_DIRNAME
char* dirname(const char *path);
#endif
#ifndef HAVE_BASENAME
char* basename(const char *path);
#endif
#endif /* TRCOMPAT_H */