rev 159 - in trunk: . include src

SVN User <[email protected]>
Newsgroups gmane.comp.lang.prothon.cvs
Message-ID <[email protected]>
Author: bcollins
Date: 2004-03-27 14:09:10 -0500 (Sat, 27 Mar 2004)
New Revision: 159

Removed:
   trunk/acconfig.h
Modified:
   trunk/Rules.mk.in
   trunk/configure
   trunk/configure.in
   trunk/include/config.h.in
   trunk/src/sys.c
Log:
Update the autoheader stuff, and also make use of checks for sys/utsname.h
for doing the uname() on Sys.platform.


Modified: trunk/Rules.mk.in
===================================================================
--- trunk/Rules.mk.in	2004-03-27 18:44:40 UTC (rev 158)
+++ trunk/Rules.mk.in	2004-03-27 19:09:10 UTC (rev 159)
@@ -21,6 +21,7 @@
 
 CFLAGS=@CFLAGS@
 CPPFLAGS=@CPPFLAGS@ -I$(abs_srcdir)/include -I$(srcdir) \
+	-I$(abs_builddir)/include \
 	-DPROTHON_DEFAULT_MODDIR="\"$(PROTHON_DEFAULT_MODDIR)\""
 
 LDFLAGS=@LDFLAGS@

Deleted: trunk/acconfig.h
===================================================================
--- trunk/acconfig.h	2004-03-27 18:44:40 UTC (rev 158)
+++ trunk/acconfig.h	2004-03-27 19:09:10 UTC (rev 159)
@@ -1,2 +0,0 @@
-/* Prothon version */
-#undef VERSION

Modified: trunk/configure
===================================================================
--- trunk/configure	2004-03-27 18:44:40 UTC (rev 158)
+++ trunk/configure	2004-03-27 19:09:10 UTC (rev 159)
@@ -463,7 +463,7 @@
 # include <unistd.h>
 #endif"
 
-ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT build build_cpu build_vendor build_os host host_cpu host_vendor host_os EGREP LN_S ECHO AR ac_ct_AR RANLIB ac_ct_RANLIB STRIP ac_ct_STRIP CPP CXX CXXFLAGS ac_ct_CXX CXXCPP F77 FFLAGS ac_ct_F77 LIBTOOL INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA YACC VERSION PROTHON_DEFAULT_MODDIR HAVE_BOOST_REGEX BOOST_REGEX_LIBS LINK_LD LINK_LIBTOOL LIBOBJS LTLIBOBJS'
+ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS VERSION CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT build build_cpu build_vendor build_os host host_cpu host_vendor host_os EGREP LN_S ECHO AR ac_ct_AR RANLIB ac_ct_RANLIB STRIP ac_ct_STRIP CPP CXX CXXFLAGS ac_ct_CXX CXXCPP F77 FFLAGS ac_ct_F77 LIBTOOL INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA YACC PROTHON_DEFAULT_MODDIR HAVE_BOOST_REGEX BOOST_REGEX_LIBS LINK_LD LINK_LIBTOOL LIBOBJS LTLIBOBJS'
 ac_subst_files=''
 
 # Initialize some variables set by options.
@@ -1957,6 +1957,12 @@
 
 VERSION="0.0"
 
+cat >>confdefs.h <<_ACEOF
+#define VERSION "${VERSION}"
+_ACEOF
+
+
+
 ac_ext=c
 ac_cpp='$CPP $CPPFLAGS'
 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
@@ -3505,7 +3511,7 @@
   ;;
 *-*-irix6*)
   # Find out which ABI we are using.
-  echo '#line 3508 "configure"' > conftest.$ac_ext
+  echo '#line 3514 "configure"' > conftest.$ac_ext
   if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
@@ -4960,7 +4966,7 @@
 
 
 # Provide some information about the compiler.
-echo "$as_me:4963:" \
+echo "$as_me:4969:" \
      "checking for Fortran 77 compiler version" >&5
 ac_compiler=`set X $ac_compile; echo $2`
 { (eval echo "$as_me:$LINENO: \"$ac_compiler --version </dev/null >&5\"") >&5
@@ -5996,11 +6002,11 @@
    -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:5999: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:6005: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>conftest.err)
    ac_status=$?
    cat conftest.err >&5
-   echo "$as_me:6003: \$? = $ac_status" >&5
+   echo "$as_me:6009: \$? = $ac_status" >&5
    if (exit $ac_status) && test -s "$ac_outfile"; then
      # The compiler can only warn and ignore the option if not recognized
      # So say no if there are warnings
@@ -6229,11 +6235,11 @@
    -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:6232: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:6238: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>conftest.err)
    ac_status=$?
    cat conftest.err >&5
-   echo "$as_me:6236: \$? = $ac_status" >&5
+   echo "$as_me:6242: \$? = $ac_status" >&5
    if (exit $ac_status) && test -s "$ac_outfile"; then
      # The compiler can only warn and ignore the option if not recognized
      # So say no if there are warnings
@@ -6289,11 +6295,11 @@
    -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:6292: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:6298: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>out/conftest.err)
    ac_status=$?
    cat out/conftest.err >&5
-   echo "$as_me:6296: \$? = $ac_status" >&5
+   echo "$as_me:6302: \$? = $ac_status" >&5
    if (exit $ac_status) && test -s out/conftest2.$ac_objext
    then
      # The compiler can only warn and ignore the option if not recognized
@@ -8464,7 +8470,7 @@
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<EOF
-#line 8467 "configure"
+#line 8473 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -8562,7 +8568,7 @@
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<EOF
-#line 8565 "configure"
+#line 8571 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -10743,11 +10749,11 @@
    -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:10746: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:10752: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>conftest.err)
    ac_status=$?
    cat conftest.err >&5
-   echo "$as_me:10750: \$? = $ac_status" >&5
+   echo "$as_me:10756: \$? = $ac_status" >&5
    if (exit $ac_status) && test -s "$ac_outfile"; then
      # The compiler can only warn and ignore the option if not recognized
      # So say no if there are warnings
@@ -10803,11 +10809,11 @@
    -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:10806: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:10812: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>out/conftest.err)
    ac_status=$?
    cat out/conftest.err >&5
-   echo "$as_me:10810: \$? = $ac_status" >&5
+   echo "$as_me:10816: \$? = $ac_status" >&5
    if (exit $ac_status) && test -s out/conftest2.$ac_objext
    then
      # The compiler can only warn and ignore the option if not recognized
@@ -12157,7 +12163,7 @@
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<EOF
-#line 12160 "configure"
+#line 12166 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -12255,7 +12261,7 @@
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<EOF
-#line 12258 "configure"
+#line 12264 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -13082,11 +13088,11 @@
    -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:13085: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:13091: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>conftest.err)
    ac_status=$?
    cat conftest.err >&5
-   echo "$as_me:13089: \$? = $ac_status" >&5
+   echo "$as_me:13095: \$? = $ac_status" >&5
    if (exit $ac_status) && test -s "$ac_outfile"; then
      # The compiler can only warn and ignore the option if not recognized
      # So say no if there are warnings
@@ -13142,11 +13148,11 @@
    -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:13145: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:13151: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>out/conftest.err)
    ac_status=$?
    cat out/conftest.err >&5
-   echo "$as_me:13149: \$? = $ac_status" >&5
+   echo "$as_me:13155: \$? = $ac_status" >&5
    if (exit $ac_status) && test -s out/conftest2.$ac_objext
    then
      # The compiler can only warn and ignore the option if not recognized
@@ -15178,11 +15184,11 @@
    -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:15181: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:15187: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>conftest.err)
    ac_status=$?
    cat conftest.err >&5
-   echo "$as_me:15185: \$? = $ac_status" >&5
+   echo "$as_me:15191: \$? = $ac_status" >&5
    if (exit $ac_status) && test -s "$ac_outfile"; then
      # The compiler can only warn and ignore the option if not recognized
      # So say no if there are warnings
@@ -15411,11 +15417,11 @@
    -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:15414: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:15420: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>conftest.err)
    ac_status=$?
    cat conftest.err >&5
-   echo "$as_me:15418: \$? = $ac_status" >&5
+   echo "$as_me:15424: \$? = $ac_status" >&5
    if (exit $ac_status) && test -s "$ac_outfile"; then
      # The compiler can only warn and ignore the option if not recognized
      # So say no if there are warnings
@@ -15471,11 +15477,11 @@
    -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:15474: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:15480: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>out/conftest.err)
    ac_status=$?
    cat out/conftest.err >&5
-   echo "$as_me:15478: \$? = $ac_status" >&5
+   echo "$as_me:15484: \$? = $ac_status" >&5
    if (exit $ac_status) && test -s out/conftest2.$ac_objext
    then
      # The compiler can only warn and ignore the option if not recognized
@@ -17646,7 +17652,7 @@
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<EOF
-#line 17649 "configure"
+#line 17655 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -17744,7 +17750,7 @@
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<EOF
-#line 17747 "configure"
+#line 17753 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -18881,12 +18887,6 @@
 
 CFLAGS="$CFLAGS -Wall"
 
-cat >>confdefs.h <<_ACEOF
-#define VERSION "${VERSION}"
-_ACEOF
-
-
-
 PROTHON_DEFAULT_MODDIR="${libdir}/prothon-${VERSION}"
 
 
@@ -19107,7 +19107,155 @@
 
 
 
+if test "${ac_cv_header_sys_utsname_h+set}" = set; then
+  echo "$as_me:$LINENO: checking for sys/utsname.h" >&5
+echo $ECHO_N "checking for sys/utsname.h... $ECHO_C" >&6
+if test "${ac_cv_header_sys_utsname_h+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+fi
+echo "$as_me:$LINENO: result: $ac_cv_header_sys_utsname_h" >&5
+echo "${ECHO_T}$ac_cv_header_sys_utsname_h" >&6
+else
+  # Is the header compilable?
+echo "$as_me:$LINENO: checking sys/utsname.h usability" >&5
+echo $ECHO_N "checking sys/utsname.h usability... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+$ac_includes_default
+#include <sys/utsname.h>
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_header_compiler=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
 
+ac_header_compiler=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+echo "${ECHO_T}$ac_header_compiler" >&6
+
+# Is the header present?
+echo "$as_me:$LINENO: checking sys/utsname.h presence" >&5
+echo $ECHO_N "checking sys/utsname.h presence... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <sys/utsname.h>
+_ACEOF
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
+  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } >/dev/null; then
+  if test -s conftest.err; then
+    ac_cpp_err=$ac_c_preproc_warn_flag
+    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
+  else
+    ac_cpp_err=
+  fi
+else
+  ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+  ac_header_preproc=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+  ac_header_preproc=no
+fi
+rm -f conftest.err conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+echo "${ECHO_T}$ac_header_preproc" >&6
+
+# So?  What about this header?
+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
+  yes:no: )
+    { echo "$as_me:$LINENO: WARNING: sys/utsname.h: accepted by the compiler, rejected by the preprocessor!" >&5
+echo "$as_me: WARNING: sys/utsname.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
+    { echo "$as_me:$LINENO: WARNING: sys/utsname.h: proceeding with the compiler's result" >&5
+echo "$as_me: WARNING: sys/utsname.h: proceeding with the compiler's result" >&2;}
+    ac_header_preproc=yes
+    ;;
+  no:yes:* )
+    { echo "$as_me:$LINENO: WARNING: sys/utsname.h: present but cannot be compiled" >&5
+echo "$as_me: WARNING: sys/utsname.h: present but cannot be compiled" >&2;}
+    { echo "$as_me:$LINENO: WARNING: sys/utsname.h:     check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: sys/utsname.h:     check for missing prerequisite headers?" >&2;}
+    { echo "$as_me:$LINENO: WARNING: sys/utsname.h: see the Autoconf documentation" >&5
+echo "$as_me: WARNING: sys/utsname.h: see the Autoconf documentation" >&2;}
+    { echo "$as_me:$LINENO: WARNING: sys/utsname.h:     section \"Present But Cannot Be Compiled\"" >&5
+echo "$as_me: WARNING: sys/utsname.h:     section \"Present But Cannot Be Compiled\"" >&2;}
+    { echo "$as_me:$LINENO: WARNING: sys/utsname.h: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: sys/utsname.h: proceeding with the preprocessor's result" >&2;}
+    { echo "$as_me:$LINENO: WARNING: sys/utsname.h: in the future, the compiler will take precedence" >&5
+echo "$as_me: WARNING: sys/utsname.h: in the future, the compiler will take precedence" >&2;}
+    (
+      cat <<\_ASBOX
+## ------------------------------------------ ##
+## Report this to the AC_PACKAGE_NAME lists.  ##
+## ------------------------------------------ ##
+_ASBOX
+    ) |
+      sed "s/^/$as_me: WARNING:     /" >&2
+    ;;
+esac
+echo "$as_me:$LINENO: checking for sys/utsname.h" >&5
+echo $ECHO_N "checking for sys/utsname.h... $ECHO_C" >&6
+if test "${ac_cv_header_sys_utsname_h+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_cv_header_sys_utsname_h=$ac_header_preproc
+fi
+echo "$as_me:$LINENO: result: $ac_cv_header_sys_utsname_h" >&5
+echo "${ECHO_T}$ac_cv_header_sys_utsname_h" >&6
+
+fi
+if test $ac_cv_header_sys_utsname_h = yes; then
+
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_SYS_UTSNAME_H
+_ACEOF
+
+
+fi
+
+
+
+
   apr_found="no"
 
   if test "$ac_cv_emxos2" = "yes"; then
@@ -19854,6 +20002,7 @@
 s,@ECHO_N@,$ECHO_N,;t t
 s,@ECHO_T@,$ECHO_T,;t t
 s,@LIBS@,$LIBS,;t t
+s,@VERSION@,$VERSION,;t t
 s,@CC@,$CC,;t t
 s,@CFLAGS@,$CFLAGS,;t t
 s,@LDFLAGS@,$LDFLAGS,;t t
@@ -19891,7 +20040,6 @@
 s,@INSTALL_SCRIPT@,$INSTALL_SCRIPT,;t t
 s,@INSTALL_DATA@,$INSTALL_DATA,;t t
 s,@YACC@,$YACC,;t t
-s,@VERSION@,$VERSION,;t t
 s,@PROTHON_DEFAULT_MODDIR@,$PROTHON_DEFAULT_MODDIR,;t t
 s,@HAVE_BOOST_REGEX@,$HAVE_BOOST_REGEX,;t t
 s,@BOOST_REGEX_LIBS@,$BOOST_REGEX_LIBS,;t t

Modified: trunk/configure.in
===================================================================
--- trunk/configure.in	2004-03-27 18:44:40 UTC (rev 158)
+++ trunk/configure.in	2004-03-27 19:09:10 UTC (rev 159)
@@ -8,6 +8,8 @@
 sinclude(ac-macros/libtool.m4)
 
 VERSION="0.0"
+AC_DEFINE_UNQUOTED([VERSION], ["${VERSION}"], [Prothon Version])
+AC_SUBST(VERSION)
 
 AC_PROG_CC
 AC_PROG_LIBTOOL
@@ -16,9 +18,6 @@
 
 CFLAGS="$CFLAGS -Wall"
 
-AC_DEFINE_UNQUOTED(VERSION, "${VERSION}")
-AC_SUBST(VERSION)
-
 PROTHON_DEFAULT_MODDIR="${libdir}/prothon-${VERSION}"
 AC_SUBST(PROTHON_DEFAULT_MODDIR)
 
@@ -34,6 +33,10 @@
 AC_SUBST(HAVE_BOOST_REGEX)
 AC_SUBST(BOOST_REGEX_LIBS)
 
+AC_CHECK_HEADER(sys/utsname.h, [
+  AC_DEFINE([HAVE_SYS_UTSNAME_H], [], [Define this to 1 if you have sys/utsname.h])
+])
+
 APR_FIND_APR("$srcdir/apr", "./apr", 1)
 
 if test $apr_found = "no"; then

Modified: trunk/include/config.h.in
===================================================================
--- trunk/include/config.h.in	2004-03-27 18:44:40 UTC (rev 158)
+++ trunk/include/config.h.in	2004-03-27 19:09:10 UTC (rev 159)
@@ -1,4 +1,55 @@
-/* include/config.h.in.  Generated automatically from configure.in by autoheader 2.13.  */
+/* include/config.h.in.  Generated from configure.in by autoheader.  */
 
-/* Prothon version */
+/* Define to 1 if you have the <dlfcn.h> header file. */
+#undef HAVE_DLFCN_H
+
+/* Define to 1 if you have the <inttypes.h> header file. */
+#undef HAVE_INTTYPES_H
+
+/* Define to 1 if you have the <memory.h> header file. */
+#undef HAVE_MEMORY_H
+
+/* Define to 1 if you have the <stdint.h> header file. */
+#undef HAVE_STDINT_H
+
+/* Define to 1 if you have the <stdlib.h> header file. */
+#undef HAVE_STDLIB_H
+
+/* Define to 1 if you have the <strings.h> header file. */
+#undef HAVE_STRINGS_H
+
+/* Define to 1 if you have the <string.h> header file. */
+#undef HAVE_STRING_H
+
+/* Define to 1 if you have the <sys/stat.h> header file. */
+#undef HAVE_SYS_STAT_H
+
+/* Define to 1 if you have the <sys/types.h> header file. */
+#undef HAVE_SYS_TYPES_H
+
+/* Define this to 1 if you have sys/utsname.h */
+#undef HAVE_SYS_UTSNAME_H
+
+/* Define to 1 if you have the <unistd.h> header file. */
+#undef HAVE_UNISTD_H
+
+/* Define to the address where bug reports for this package should be sent. */
+#undef PACKAGE_BUGREPORT
+
+/* Define to the full name of this package. */
+#undef PACKAGE_NAME
+
+/* Define to the full name and version of this package. */
+#undef PACKAGE_STRING
+
+/* Define to the one symbol short name of this package. */
+#undef PACKAGE_TARNAME
+
+/* Define to the version of this package. */
+#undef PACKAGE_VERSION
+
+/* Define to 1 if you have the ANSI C header files. */
+#undef STDC_HEADERS
+
+/* Prothon Version */
 #undef VERSION

Modified: trunk/src/sys.c
===================================================================
--- trunk/src/sys.c	2004-03-27 18:44:40 UTC (rev 158)
+++ trunk/src/sys.c	2004-03-27 19:09:10 UTC (rev 159)
@@ -53,11 +53,16 @@
 
 // sys.c
 
+#include <config.h>
+
 #include <stdlib.h>
 #include <stdio.h>
 
+#ifdef HAVE_SYS_UTSNAME_H
+#include <sys/utsname.h>
+#endif
+
 #ifndef WIN32
-#include <sys/utsname.h>
 #include <unistd.h>
 #include <limits.h>
 #include <stdint.h>
@@ -186,12 +191,9 @@
 	set_attr( ist, sys_module, sym(ist, "exit"),
 		      new_func_obj(ist, sys_exit, list2(sym(ist,"num"),new_int_obj(1))) );
 
-	/* Need to use uname() for unix, and we should include an
-	 * architecture attribute aswell, maybe even the version of the
-	 * platform aswell. */
 #if defined(WIN32)
 	set_attr(ist, sys_module, sym(ist, "platform"), new_string_obj("win32"));
-#else
+#elif defined(HAVE_SYS_UTSNAME_H)
 	{
 		struct utsname uts;
 
@@ -204,6 +206,8 @@
 			set_attr(ist, sys_module, sym(ist, "platform"), new_string_obj(plt_buf));
 		}
 	}
+#else
+	set_attr(ist, sys_module, sym(ist, "platform"), new_string_obj("unknown"));
 #endif
 	set_attr(ist, sys_module, sym(ist, "ps1"), new_string_obj(">>> "));
 	set_attr(ist, sys_module, sym(ist, "ps2"), new_string_obj("... "));
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.