From: Alexandre Oliva Date: Wed, 20 Jan 1999 13:01:27 +0000 (+0000) Subject: * demo/configure.in (AC_C_CONST): added, for portability X-Git-Tag: ild-branchpoint~45 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3770203057a8c8755e97c8263dfb51f511561b27;p=thirdparty%2Flibtool.git * demo/configure.in (AC_C_CONST): added, for portability * mdemo/configure.in (AC_C_CONST): ditto * libltdl/configure.in (AC_C_CONST, AC_C_INLINE): ditto * libltdl/ltdl.c (LTDL_FILENAME_MAX): use FILENAME_MAX if defined (FILENAME_MAX): replace all explicit uses with LTDL_FILENAME_MAX (presym_free_symlists, trim): don't return void, for portability (lt_dlgetsearchpath): replace (void) with __P((void)) --- diff --git a/ChangeLog b/ChangeLog index 723c68cbc..343c159c6 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,13 @@ 1999-01-20 Alexandre Oliva + * demo/configure.in (AC_C_CONST): added, for portability + * mdemo/configure.in (AC_C_CONST): ditto + * libltdl/configure.in (AC_C_CONST, AC_C_INLINE): ditto + * libltdl/ltdl.c (LTDL_FILENAME_MAX): use FILENAME_MAX if defined + (FILENAME_MAX): replace all explicit uses with LTDL_FILENAME_MAX + (presym_free_symlists, trim): don't return void, for portability + (lt_dlgetsearchpath): replace (void) with __P((void)) + * ltmain.in (compile): when compiling both PIC and non-PIC, write the PIC object to .libs/.lo and only rename it to .lo after compiling the .o, to avoid fooling make dependencies diff --git a/demo/configure.in b/demo/configure.in index 97511c2eb..f151af918 100644 --- a/demo/configure.in +++ b/demo/configure.in @@ -3,6 +3,7 @@ AC_INIT(hello.c) AM_INIT_AUTOMAKE(hell,1.0) AC_PROG_CC +AC_C_CONST AC_EXEEXT AM_PROG_LIBTOOL diff --git a/libltdl/configure.in b/libltdl/configure.in index 377198bbd..41e5a84cf 100644 --- a/libltdl/configure.in +++ b/libltdl/configure.in @@ -19,6 +19,8 @@ AC_SUBST(LIBLIBS) AC_SUBST(NOINSTLIBS) AC_PROG_CC +AC_C_CONST +AC_C_INLINE AM_PROG_LIBTOOL AC_SUBST(LIBTOOL_DEPS) diff --git a/libltdl/ltdl.c b/libltdl/ltdl.c index 1accd116a..5ea3fd72e 100644 --- a/libltdl/ltdl.c +++ b/libltdl/ltdl.c @@ -52,7 +52,11 @@ Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. /* max. filename length */ #ifndef LTDL_FILENAME_MAX -#define LTDL_FILENAME_MAX 1024 +# ifdef FILENAME_MAX +# define LTDL_FILENAME_MAX FILENAME_MAX +# else +# define LTDL_FILENAME_MAX 1024 +# endif #endif #ifndef LTDL_SEARCHPATH_MAX @@ -540,7 +544,7 @@ presym_init () return 0; } -static void +static int /* not all compilers support void */ presym_free_symlists () { lt_dlsymlists_t *lists = preloaded_symbols; @@ -552,6 +556,7 @@ presym_free_symlists () free(tmp); } preloaded_symbols = 0; + return 0; } static int @@ -751,7 +756,7 @@ lt_dlexit () return errors; } -static void +static int /* not all compilers support void */ trim (dest, s) char *dest; const char *s; @@ -764,6 +769,7 @@ trim (dest, s) dest[len-3] = '\0'; } else *dest = '\0'; + return 0; } static int @@ -867,7 +873,7 @@ find_library (handle, basename, search_path) while (cur) { next = strchr(cur, ':'); if (next) { - if (next - cur + 1 >= FILENAME_MAX) { + if (next - cur + 1 >= LTDL_FILENAME_MAX) { last_error = buffer_overflow_error; return 1; } @@ -875,7 +881,7 @@ find_library (handle, basename, search_path) filename[next - cur] = '\0'; cur = next+1; } else { - if (strlen(cur)+1 >= FILENAME_MAX) { + if (strlen(cur)+1 >= LTDL_FILENAME_MAX) { last_error = buffer_overflow_error; return 1; } @@ -977,7 +983,7 @@ lt_dlopen (filename) basename++; else basename = filename; - if (basename - filename >= FILENAME_MAX) { + if (basename - filename >= LTDL_FILENAME_MAX) { last_error = buffer_overflow_error; return 0; } @@ -1236,7 +1242,7 @@ lt_dlsetsearchpath (search_path) } const char * -lt_dlgetsearchpath (void) +lt_dlgetsearchpath __P((void)) { return usr_search_path; } diff --git a/mdemo/configure.in b/mdemo/configure.in index acad449d4..b070b9083 100644 --- a/mdemo/configure.in +++ b/mdemo/configure.in @@ -3,6 +3,7 @@ AC_INIT(main.c) AM_INIT_AUTOMAKE(mdemo,0.1) AC_PROG_CC +AC_C_CONST AC_EXEEXT AM_PROG_LIBTOOL