From 13e5603c9b1a53bacdd52a0ea42fc4680591aae9 Mon Sep 17 00:00:00 2001
From: Jerome Duval <jerome.duval@gmail.com>
Date: Sat, 19 Apr 2014 21:36:18 +0000
Subject: Fix gcc2 build.


diff --git a/configure.ac b/configure.ac
index f8f7f7d..dc352ab 100644
--- a/configure.ac
+++ b/configure.ac
@@ -260,7 +260,7 @@ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([
 dnl empty_array_size
 AC_MSG_CHECKING([how to create empty arrays])
 
-empty_array_size="xxxx"
+empty_array_size="xxx"
 AC_TRY_COMPILE([],[struct { int foo; int bar[]; } doo;], empty_array_size="")
 
 if test "x$empty_array_size" = "xxxx"; then
@@ -645,7 +645,7 @@ if test "x$enable_cddb" != "xno"; then
     ],
     [AC_MSG_WARN([new enough libcddb not found. CDDB access disabled. Get libcddb from http://libcddb.sourceforge.net])
     HAVE_CDDB=no])
-    AC_CHECK_LIB(socket, connect)
+    AC_CHECK_LIB(network, connect)
     AC_CHECK_FUNC(gethostbyname, , AC_CHECK_LIB(nsl, gethostbyname))
 fi
 
diff --git a/lib/driver/abs_path.c b/lib/driver/abs_path.c
index 2b62956..f3905c8 100644
--- a/lib/driver/abs_path.c
+++ b/lib/driver/abs_path.c
@@ -93,11 +93,13 @@ cdio_dirname(const char *fname)
 char *
 cdio_abspath(const char *cwd, const char *fname)
 {
+    size_t len;
+    char* result;
     if (isdirsep(*fname))
       return strdup(fname);
     else {
-      size_t len   = strlen(cwd) + strlen(fname) + 2;
-      char* result = calloc(sizeof(char), len);
+      len   = strlen(cwd) + strlen(fname) + 2;
+      result = calloc(sizeof(char), len);
       snprintf(result, len, "%s%c%s",
 	       cwd, CDIO_FILE_SEPARATOR, fname);
       return result;
-- 
2.16.4


From 7d70318dbf4ec6981ebc51a41e2c87045c92b9aa Mon Sep 17 00:00:00 2001
From: begasus <begasus@gmail.com>
Date: Fri, 31 Aug 2018 18:46:24 +0200
Subject: fix realpath for the test


diff --git a/configure.ac b/configure.ac
index dc352ab..7486cfd 100644
--- a/configure.ac
+++ b/configure.ac
@@ -565,7 +565,7 @@ AC_SUBST(LIBCDIO_SOURCE_PATH)
 AC_CHECK_FUNCS( [chdir drand48 fseeko fseeko64 ftruncate geteuid getgid \
 		 getuid getpwuid gettimeofday lseek64 lstat memcpy memset mkstemp rand \
 		 seteuid setegid snprintf setenv strndup unsetenv tzset sleep \
-		 _stati64 usleep vsnprintf readlink realpath gmtime_r localtime_r] )
+		 _stati64 usleep vsnprintf readlink gmtime_r localtime_r] )
 
 # check for timegm() support
 AC_CHECK_FUNC(timegm, AC_DEFINE(HAVE_TIMEGM,1,
-- 
2.16.4

