Browse Source

Fixed libconfig compiling issues in CentOS 5 (follow-up to r15572) (pid:78747).

git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@15584 54d463be-8e91-2dee-dedb-b68131a5f0ec
gepard1984 13 years ago
parent
commit
a2424f2c92
3 changed files with 89 additions and 58 deletions
  1. 1 1
      3rdparty/libconfig/Makefile.in
  2. 83 53
      configure
  3. 5 4
      configure.in

+ 1 - 1
3rdparty/libconfig/Makefile.in

@@ -21,4 +21,4 @@ help:
 #####################################################################
 #####################################################################
 
 
 %.o: %.c $(LIBCONFIG_H)
 %.o: %.c $(LIBCONFIG_H)
-	@CC@ @CFLAGS@ @LDFLAGS@ @CPPFLAGS@ -c $(OUTPUT_OPTION) $<
+	@CC@ @CFLAGS@ @DEFS@ @LDFLAGS@ @CPPFLAGS@ -c $(OUTPUT_OPTION) $<

+ 83 - 53
configure

@@ -1,5 +1,5 @@
 #! /bin/sh
 #! /bin/sh
-# From configure.in Revision: 15572 .
+# From configure.in Revision: 15573 .
 # Guess values for system-dependent variables and create Makefiles.
 # Guess values for system-dependent variables and create Makefiles.
 # Generated by GNU Autoconf 2.59.
 # Generated by GNU Autoconf 2.59.
 #
 #
@@ -1342,6 +1342,12 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu
 
 
 
 
 
 
+cat >>confdefs.h <<\_ACEOF
+#define _GNU_SOURCE 1
+_ACEOF
+
+
+
 #
 #
 # Memory managers
 # Memory managers
 #
 #
@@ -3738,9 +3744,13 @@ fi
 
 
 
 
 # libconfig
 # libconfig
-echo "$as_me:$LINENO: checking for uselocale" >&5
-echo $ECHO_N "checking for uselocale... $ECHO_C" >&6
-if test "${ac_cv_func_uselocale+set}" = set; then
+
+for ac_func in uselocale
+do
+as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
+echo "$as_me:$LINENO: checking for $ac_func" >&5
+echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
+if eval "test \"\${$as_ac_var+set}\" = set"; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
 else
   cat >conftest.$ac_ext <<_ACEOF
   cat >conftest.$ac_ext <<_ACEOF
@@ -3749,12 +3759,12 @@ _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 /* end confdefs.h.  */
-/* Define uselocale to an innocuous variant, in case <limits.h> declares uselocale.
+/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
    For example, HP-UX 11i <limits.h> declares gettimeofday.  */
    For example, HP-UX 11i <limits.h> declares gettimeofday.  */
-#define uselocale innocuous_uselocale
+#define $ac_func innocuous_$ac_func
 
 
 /* System header to define __stub macros and hopefully few prototypes,
 /* System header to define __stub macros and hopefully few prototypes,
-    which can conflict with char uselocale (); below.
+    which can conflict with char $ac_func (); below.
     Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
     Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
     <limits.h> exists even on freestanding compilers.  */
     <limits.h> exists even on freestanding compilers.  */
 
 
@@ -3764,7 +3774,7 @@ cat >>conftest.$ac_ext <<_ACEOF
 # include <assert.h>
 # include <assert.h>
 #endif
 #endif
 
 
-#undef uselocale
+#undef $ac_func
 
 
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* Override any gcc2 internal prototype to avoid an error.  */
 #ifdef __cplusplus
 #ifdef __cplusplus
@@ -3773,14 +3783,14 @@ extern "C"
 #endif
 #endif
 /* We use char because int might match the return type of a gcc2
 /* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
    builtin and then its argument prototype would still apply.  */
-char uselocale ();
+char $ac_func ();
 /* The GNU C library defines this for functions which it implements
 /* The GNU C library defines this for functions which it implements
     to always fail with ENOSYS.  Some functions are actually named
     to always fail with ENOSYS.  Some functions are actually named
     something starting with __ and the normal name is an alias.  */
     something starting with __ and the normal name is an alias.  */
-#if defined (__stub_uselocale) || defined (__stub___uselocale)
+#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
 choke me
 choke me
 #else
 #else
-char (*f) () = uselocale;
+char (*f) () = $ac_func;
 #endif
 #endif
 #ifdef __cplusplus
 #ifdef __cplusplus
 }
 }
@@ -3789,7 +3799,7 @@ char (*f) () = uselocale;
 int
 int
 main ()
 main ()
 {
 {
-return f != uselocale;
+return f != $ac_func;
   ;
   ;
   return 0;
   return 0;
 }
 }
@@ -3816,25 +3826,33 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
   ac_status=$?
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   (exit $ac_status); }; }; then
-  ac_cv_func_uselocale=yes
+  eval "$as_ac_var=yes"
 else
 else
   echo "$as_me: failed program was:" >&5
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 
-ac_cv_func_uselocale=no
+eval "$as_ac_var=no"
 fi
 fi
 rm -f conftest.err conftest.$ac_objext \
 rm -f conftest.err conftest.$ac_objext \
       conftest$ac_exeext conftest.$ac_ext
       conftest$ac_exeext conftest.$ac_ext
 fi
 fi
-echo "$as_me:$LINENO: result: $ac_cv_func_uselocale" >&5
-echo "${ECHO_T}$ac_cv_func_uselocale" >&6
-if test $ac_cv_func_uselocale = yes; then
-  CFLAGS="$CFLAGS -DHAVE_USELOCALE"
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
+if test `eval echo '${'$as_ac_var'}'` = yes; then
+  cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
+_ACEOF
+
 fi
 fi
+done
+
 
 
-echo "$as_me:$LINENO: checking for newlocale" >&5
-echo $ECHO_N "checking for newlocale... $ECHO_C" >&6
-if test "${ac_cv_func_newlocale+set}" = set; then
+for ac_func in newlocale
+do
+as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
+echo "$as_me:$LINENO: checking for $ac_func" >&5
+echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
+if eval "test \"\${$as_ac_var+set}\" = set"; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
 else
   cat >conftest.$ac_ext <<_ACEOF
   cat >conftest.$ac_ext <<_ACEOF
@@ -3843,12 +3861,12 @@ _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 /* end confdefs.h.  */
-/* Define newlocale to an innocuous variant, in case <limits.h> declares newlocale.
+/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
    For example, HP-UX 11i <limits.h> declares gettimeofday.  */
    For example, HP-UX 11i <limits.h> declares gettimeofday.  */
-#define newlocale innocuous_newlocale
+#define $ac_func innocuous_$ac_func
 
 
 /* System header to define __stub macros and hopefully few prototypes,
 /* System header to define __stub macros and hopefully few prototypes,
-    which can conflict with char newlocale (); below.
+    which can conflict with char $ac_func (); below.
     Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
     Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
     <limits.h> exists even on freestanding compilers.  */
     <limits.h> exists even on freestanding compilers.  */
 
 
@@ -3858,7 +3876,7 @@ cat >>conftest.$ac_ext <<_ACEOF
 # include <assert.h>
 # include <assert.h>
 #endif
 #endif
 
 
-#undef newlocale
+#undef $ac_func
 
 
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* Override any gcc2 internal prototype to avoid an error.  */
 #ifdef __cplusplus
 #ifdef __cplusplus
@@ -3867,14 +3885,14 @@ extern "C"
 #endif
 #endif
 /* We use char because int might match the return type of a gcc2
 /* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
    builtin and then its argument prototype would still apply.  */
-char newlocale ();
+char $ac_func ();
 /* The GNU C library defines this for functions which it implements
 /* The GNU C library defines this for functions which it implements
     to always fail with ENOSYS.  Some functions are actually named
     to always fail with ENOSYS.  Some functions are actually named
     something starting with __ and the normal name is an alias.  */
     something starting with __ and the normal name is an alias.  */
-#if defined (__stub_newlocale) || defined (__stub___newlocale)
+#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
 choke me
 choke me
 #else
 #else
-char (*f) () = newlocale;
+char (*f) () = $ac_func;
 #endif
 #endif
 #ifdef __cplusplus
 #ifdef __cplusplus
 }
 }
@@ -3883,7 +3901,7 @@ char (*f) () = newlocale;
 int
 int
 main ()
 main ()
 {
 {
-return f != newlocale;
+return f != $ac_func;
   ;
   ;
   return 0;
   return 0;
 }
 }
@@ -3910,25 +3928,33 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
   ac_status=$?
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   (exit $ac_status); }; }; then
-  ac_cv_func_newlocale=yes
+  eval "$as_ac_var=yes"
 else
 else
   echo "$as_me: failed program was:" >&5
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 
-ac_cv_func_newlocale=no
+eval "$as_ac_var=no"
 fi
 fi
 rm -f conftest.err conftest.$ac_objext \
 rm -f conftest.err conftest.$ac_objext \
       conftest$ac_exeext conftest.$ac_ext
       conftest$ac_exeext conftest.$ac_ext
 fi
 fi
-echo "$as_me:$LINENO: result: $ac_cv_func_newlocale" >&5
-echo "${ECHO_T}$ac_cv_func_newlocale" >&6
-if test $ac_cv_func_newlocale = yes; then
-  CFLAGS="$CFLAGS -DHAVE_NEWLOCALE"
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
+if test `eval echo '${'$as_ac_var'}'` = yes; then
+  cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
+_ACEOF
+
 fi
 fi
+done
+
 
 
-echo "$as_me:$LINENO: checking for freelocale" >&5
-echo $ECHO_N "checking for freelocale... $ECHO_C" >&6
-if test "${ac_cv_func_freelocale+set}" = set; then
+for ac_func in freelocale
+do
+as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
+echo "$as_me:$LINENO: checking for $ac_func" >&5
+echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
+if eval "test \"\${$as_ac_var+set}\" = set"; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
 else
   cat >conftest.$ac_ext <<_ACEOF
   cat >conftest.$ac_ext <<_ACEOF
@@ -3937,12 +3963,12 @@ _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 /* end confdefs.h.  */
-/* Define freelocale to an innocuous variant, in case <limits.h> declares freelocale.
+/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
    For example, HP-UX 11i <limits.h> declares gettimeofday.  */
    For example, HP-UX 11i <limits.h> declares gettimeofday.  */
-#define freelocale innocuous_freelocale
+#define $ac_func innocuous_$ac_func
 
 
 /* System header to define __stub macros and hopefully few prototypes,
 /* System header to define __stub macros and hopefully few prototypes,
-    which can conflict with char freelocale (); below.
+    which can conflict with char $ac_func (); below.
     Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
     Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
     <limits.h> exists even on freestanding compilers.  */
     <limits.h> exists even on freestanding compilers.  */
 
 
@@ -3952,7 +3978,7 @@ cat >>conftest.$ac_ext <<_ACEOF
 # include <assert.h>
 # include <assert.h>
 #endif
 #endif
 
 
-#undef freelocale
+#undef $ac_func
 
 
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* Override any gcc2 internal prototype to avoid an error.  */
 #ifdef __cplusplus
 #ifdef __cplusplus
@@ -3961,14 +3987,14 @@ extern "C"
 #endif
 #endif
 /* We use char because int might match the return type of a gcc2
 /* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
    builtin and then its argument prototype would still apply.  */
-char freelocale ();
+char $ac_func ();
 /* The GNU C library defines this for functions which it implements
 /* The GNU C library defines this for functions which it implements
     to always fail with ENOSYS.  Some functions are actually named
     to always fail with ENOSYS.  Some functions are actually named
     something starting with __ and the normal name is an alias.  */
     something starting with __ and the normal name is an alias.  */
-#if defined (__stub_freelocale) || defined (__stub___freelocale)
+#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
 choke me
 choke me
 #else
 #else
-char (*f) () = freelocale;
+char (*f) () = $ac_func;
 #endif
 #endif
 #ifdef __cplusplus
 #ifdef __cplusplus
 }
 }
@@ -3977,7 +4003,7 @@ char (*f) () = freelocale;
 int
 int
 main ()
 main ()
 {
 {
-return f != freelocale;
+return f != $ac_func;
   ;
   ;
   return 0;
   return 0;
 }
 }
@@ -4004,21 +4030,25 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
   ac_status=$?
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   (exit $ac_status); }; }; then
-  ac_cv_func_freelocale=yes
+  eval "$as_ac_var=yes"
 else
 else
   echo "$as_me: failed program was:" >&5
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 
-ac_cv_func_freelocale=no
+eval "$as_ac_var=no"
 fi
 fi
 rm -f conftest.err conftest.$ac_objext \
 rm -f conftest.err conftest.$ac_objext \
       conftest$ac_exeext conftest.$ac_ext
       conftest$ac_exeext conftest.$ac_ext
 fi
 fi
-echo "$as_me:$LINENO: result: $ac_cv_func_freelocale" >&5
-echo "${ECHO_T}$ac_cv_func_freelocale" >&6
-if test $ac_cv_func_freelocale = yes; then
-  CFLAGS="$CFLAGS -DHAVE_FREELOCALE"
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
+if test `eval echo '${'$as_ac_var'}'` = yes; then
+  cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
+_ACEOF
+
 fi
 fi
+done
 
 
 
 
 echo "$as_me:$LINENO: checking for egrep" >&5
 echo "$as_me:$LINENO: checking for egrep" >&5
@@ -4419,7 +4449,7 @@ if test `eval echo '${'$as_ac_Header'}'` = yes; then
   cat >>confdefs.h <<_ACEOF
   cat >>confdefs.h <<_ACEOF
 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
 _ACEOF
 _ACEOF
- CFLAGS="$CFLAGS -DHAVE_XLOCALE_H"
+
 fi
 fi
 
 
 done
 done

+ 5 - 4
configure.in

@@ -10,6 +10,7 @@ AC_CONFIG_FILES([3rdparty/mt19937ar/Makefile 3rdparty/libconfig/Makefile])
 AC_CONFIG_FILES([src/char/Makefile src/login/Makefile])
 AC_CONFIG_FILES([src/char/Makefile src/login/Makefile])
 AC_CONFIG_FILES([src/map/Makefile src/plugins/Makefile src/tool/Makefile])
 AC_CONFIG_FILES([src/map/Makefile src/plugins/Makefile src/tool/Makefile])
 
 
+AC_GNU_SOURCE
 
 
 #
 #
 # Memory managers
 # Memory managers
@@ -469,10 +470,10 @@ AC_CHECK_FUNC([setrlimit],[CFLAGS="$CFLAGS -DHAVE_SETRLIMIT"])
 AC_CHECK_FUNC([strnlen],[CFLAGS="$CFLAGS -DHAVE_STRNLEN"])
 AC_CHECK_FUNC([strnlen],[CFLAGS="$CFLAGS -DHAVE_STRNLEN"])
 
 
 # libconfig
 # libconfig
-AC_CHECK_FUNC([uselocale],[CFLAGS="$CFLAGS -DHAVE_USELOCALE"])
-AC_CHECK_FUNC([newlocale],[CFLAGS="$CFLAGS -DHAVE_NEWLOCALE"])
-AC_CHECK_FUNC([freelocale],[CFLAGS="$CFLAGS -DHAVE_FREELOCALE"])
-AC_CHECK_HEADERS([xlocale.h],[CFLAGS="$CFLAGS -DHAVE_XLOCALE_H"])
+AC_CHECK_FUNCS([uselocale])
+AC_CHECK_FUNCS([newlocale])
+AC_CHECK_FUNCS([freelocale])
+AC_CHECK_HEADERS([xlocale.h])
 
 
 #
 #
 # Memory manager
 # Memory manager