You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by mt...@apache.org on 2009/11/11 13:51:23 UTC

svn commit: r834860 - in /commons/sandbox/runtime/trunk/src/main/native: Makefile.msc.in configure

Author: mturk
Date: Wed Nov 11 12:51:23 2009
New Revision: 834860

URL: http://svn.apache.org/viewvc?rev=834860&view=rev
Log:
Allow to prepare the makefiles for distribution

Modified:
    commons/sandbox/runtime/trunk/src/main/native/Makefile.msc.in
    commons/sandbox/runtime/trunk/src/main/native/configure

Modified: commons/sandbox/runtime/trunk/src/main/native/Makefile.msc.in
URL: http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/main/native/Makefile.msc.in?rev=834860&r1=834859&r2=834860&view=diff
==============================================================================
--- commons/sandbox/runtime/trunk/src/main/native/Makefile.msc.in (original)
+++ commons/sandbox/runtime/trunk/src/main/native/Makefile.msc.in Wed Nov 11 12:51:23 2009
@@ -40,6 +40,7 @@
 CXX=@cxx@
 AFLAGS=@asflags@
 CFLAGS=@ccflags@
+CSFLAGS=@ccshare@
 CPPFLAGS=@cppopts@
 CXXFLAGS=@cxxopts@
 LDFLAGS=@ldflags@
@@ -206,31 +207,31 @@
 all: $(SHAREDLIB) @modules@
 
 {$(SRCDIR)\shared}.c{$(SRCDIR)\shared}.$(OBJ):
-	$(CC) $(CFLAGS) $(CPPFLAGS) -DACR_DECLARE_EXPORT $(INCLUDES) -c -Fo$@ -Fd$(LIBNAME)-src $<
+	$(CC) $(CFLAGS) $(CSFLAGS) $(CPPFLAGS) -DACR_DECLARE_EXPORT $(INCLUDES) -c -Fo$@ -Fd$(LIBNAME)-src $<
 
 {$(SRCDIR)\port}.c{$(SRCDIR)\port}.$(OBJ):
-	$(CC) $(CFLAGS) $(CPPFLAGS) -DACR_DECLARE_EXPORT $(INCLUDES) -c -Fo$@ -Fd$(LIBNAME)-src $<
+	$(CC) $(CFLAGS) $(CSFLAGS) $(CPPFLAGS) -DACR_DECLARE_EXPORT $(INCLUDES) -c -Fo$@ -Fd$(LIBNAME)-src $<
 
 {$(SRCDIR)\os\win32}.c{$(SRCDIR)\os\win32}.$(OBJ):
-	$(CC) $(CFLAGS) $(CPPFLAGS) -DACR_DECLARE_EXPORT $(INCLUDES) -c -Fo$@ -Fd$(LIBNAME)-src $<
+	$(CC) $(CFLAGS) $(CSFLAGS) $(CPPFLAGS) -DACR_DECLARE_EXPORT $(INCLUDES) -c -Fo$@ -Fd$(LIBNAME)-src $<
 
 {$(SRCDIR)\srclib\bzip2}.c{$(SRCDIR)\srclib\bzip2}.$(OBJ):
-	$(CC) $(CFLAGS) $(CPPFLAGS) -DACR_DECLARE_EXPORT $(INCLUDES) -c -Fo$@ -Fd$(LIBNAME)-src $<
+	$(CC) $(CFLAGS) $(CSFLAGS) $(CPPFLAGS) -DACR_DECLARE_EXPORT $(INCLUDES) -c -Fo$@ -Fd$(LIBNAME)-src $<
 
 {$(SRCDIR)\srclib\regex}.c{$(SRCDIR)\srclib\regex}.$(OBJ):
-	$(CC) $(CFLAGS) $(CPPFLAGS) -DACR_DECLARE_EXPORT $(INCLUDES) -c -Fo$@ -Fd$(LIBNAME)-src $<
+	$(CC) $(CFLAGS) $(CSFLAGS) $(CPPFLAGS) -DACR_DECLARE_EXPORT $(INCLUDES) -c -Fo$@ -Fd$(LIBNAME)-src $<
 
 {$(SRCDIR)\srclib\zlib}.c{$(SRCDIR)\srclib\zlib}.$(OBJ):
-	$(CC) $(CFLAGS) $(CPPFLAGS) -DACR_DECLARE_EXPORT $(INCLUDES) -c -Fo$@ -Fd$(LIBNAME)-src $<
+	$(CC) $(CFLAGS) $(CSFLAGS) $(CPPFLAGS) -DACR_DECLARE_EXPORT $(INCLUDES) -c -Fo$@ -Fd$(LIBNAME)-src $<
 
 {$(SRCDIR)\test}.c{$(SRCDIR)\test}.$(OBJ):
-	$(CC) $(CFLAGS) $(CPPFLAGS) -DACR_DECLARE_EXPORT $(INCLUDES) -c -Fo$@ -Fd$(LIBNAME)-src $<
+	$(CC) $(CFLAGS) $(CSFLAGS) $(CPPFLAGS) -DACR_DECLARE_EXPORT $(INCLUDES) -c -Fo$@ -Fd$(LIBNAME)-src $<
 
 {$(SRCDIR)\os\win32}.cpp{$(SRCDIR)\os\win32}.$(OBJ):
-	$(CXX) $(CFLAGS) $(CPPFLAGS) -DACR_DECLARE_EXPORT $(CXXFLAGS) $(INCLUDES) -c -Fo$@ -Fd$(LIBNAME)-src $<
+	$(CXX) $(CFLAGS) $(CSFLAGS) $(CPPFLAGS) -DACR_DECLARE_EXPORT $(CXXFLAGS) $(INCLUDES) -c -Fo$@ -Fd$(LIBNAME)-src $<
 
 {$(SRCDIR)\modules\network\ssl}.c{$(SRCDIR)\modules\network\ssl}.$(OBJ):
-	$(CC) $(CFLAGS) $(CPPFLAGS) $(INCLUDES) -c -Fo$@ -Fd$(SSLNAME)-src $<
+	$(CC) $(CFLAGS) $(CSFLAGS) $(CPPFLAGS) $(INCLUDES) -c -Fo$@ -Fd$(SSLNAME)-src $<
 
 $(SHAREDLIB): $(PPORT_OBJS) $(COMMON_OBJS) $(@platform@_OBJS) $(REGEX_OBJS) $(BZIP2_OBJS) $(ZLIB_OBJS) @testobjs@
 	$(RC) /l 0x409 /d "NDEBUG" /i "$(SRCDIR)\include" /fo $@.res $(SRCDIR)/os/win32/main.rc

Modified: commons/sandbox/runtime/trunk/src/main/native/configure
URL: http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/main/native/configure?rev=834860&r1=834859&r2=834860&view=diff
==============================================================================
--- commons/sandbox/runtime/trunk/src/main/native/configure (original)
+++ commons/sandbox/runtime/trunk/src/main/native/configure Wed Nov 11 12:51:23 2009
@@ -75,7 +75,7 @@
 shflags="$SHFLAGS"
 rcflags="$RCFLAGS"
 exflags=""
-includes="-I$topdir/include -I$topdir/port -I$topdir/srclib"
+include="-I$topdir/include -I$topdir/port -I$topdir/srclib"
 ssldflags=""
 modules=""
 bige=0
@@ -86,6 +86,7 @@
 bits=""
 java_home="`echo $JAVA_HOME | tr '\\' '/' 2>/dev/null`"
 java_pinc=""
+java_home_set=no
 has_dso_test=no
 has_jni=yes
 has_64_bit=no
@@ -177,6 +178,7 @@
         ;;
         --with-java-home=* )
             java_home="$a"
+            java_home_set=yes
             shift
         ;;
         --with-java-platform=* )
@@ -640,8 +642,8 @@
 else
     test ".$host" != .hpux && varadds cppopts -D_FILE_OFFSET_BITS=64
 fi
-test -d "$topdir/include/arch/$host" && varadds includes "-I$topdir/include/arch/$host"
-test ".$host" != .windows && varadds includes "-I$topdir/include/arch/unix"
+test -d "$topdir/include/arch/$host" && varadds include "-I$topdir/include/arch/$host"
+test ".$host" != .windows && varadds include "-I$topdir/include/arch/unix"
 test ".$has_unicode" = .yes && varadds cppopts -DUNICODE -D_UNICODE
 if [ ".$has_maintainer_mode" = .yes ]; then
     varadds cppopts -DDEBUG -D_DEBUG
@@ -664,13 +666,20 @@
     testobjs=""
 fi
 
-varadds includes "-I$java_home/include"
-if [ ".$java_pinc" != . ]; then
-    if [ -d "$java_home/include/$java_pinc" ]; then
-        varadds includes "-I$java_home/include/$java_pinc"
-    else
-        echo ""
-        echo "Warning: \`$java_home/include/$java_pinc' in not a directory"
+if [ ".$java_home_set" = .yes ]; then
+    varadds include "-I$java_home/include"
+    if [ ".$java_pinc" != . ]; then
+        if [ -d "$java_home/include/$java_pinc" ]; then
+            varadds include "-I$java_home/include/$java_pinc"
+        else
+            echo ""
+            echo "Warning: \`$java_home/include/$java_pinc' in not a directory"
+        fi
+    fi
+else
+    varadds include "-I??(JAVA_HOME)/include"
+    if [ ".$java_pinc" != . ]; then
+        varadds include "-I??(JAVA_HOME)/include/$java_pinc"
     fi
 fi
 
@@ -697,32 +706,37 @@
 
 have_include()
 {
-    printf "Checking for %-32s" "<$1.h>" 1>&2
-    cat > $test.c << EOF
+    printf "Checking for %-32s" "<$2.h>" 1>&2
+    if [ .$host = .windows -a .$1 = .0 ]; then
+        echo "not supported" 1>&2
+        echo 0
+    else
+        cat > $test.c << EOF
 #include <stdlib.h>
 #include <$cccinc.h>
-$2
-#include <$1.h>
+$3
+#include <$2.h>
 int main() {return 0;}
 EOF
-    rc=0
-    if [ ".$host" = .windows ]; then
-        co="`$cc $ccflags $cppopts $test.c /link /out:$test$exe 2>&1`"
-    else
-        co="`$cc $ccflags $cppopts $test.c -o $test$exe 2>&1`"
-    fi
-    if [ ".$co" = "." ]; then
-        rc=1
-    else
-        test -x $test$exe && rc=1
-    fi
-    rm -rf $test.* $test *.pdb >/dev/null 2>&1 || true
-    if [ $rc = 1 ]; then
-        echo ok 1>&2
-    else
-        echo "not found" 1>&2
+        rc=0
+        if [ ".$host" = .windows ]; then
+            co="`$cc $ccflags $cppopts $test.c /link /out:$test$exe 2>&1`"
+        else
+            co="`$cc $ccflags $cppopts $test.c -o $test$exe 2>&1`"
+        fi
+        if [ ".$co" = "." ]; then
+            rc=1
+        else
+            test -x $test$exe && rc=1
+        fi
+        rm -rf $test.* $test *.pdb >/dev/null 2>&1 || true
+        if [ $rc = 1 ]; then
+            echo ok 1>&2
+        else
+            echo "not found" 1>&2
+        fi
+        echo $rc
     fi
-    echo $rc
 }
 
 have_library()
@@ -793,13 +807,13 @@
 
 have_function()
 {
-    printf "Checking for %-32s" "$1" 1>&2
-    if [ ".$host" = .windows ]; then
+    printf "Checking for %-32s" "$2" 1>&2
+    if [ .$host = .windows -a .$1 = .0 ]; then
         echo "not supported" 1>&2
-        rc="0"
+        rc=0
     else
-        rc=`have_function_body $1 $2`
-        test ".$rc" = .0 && rc=`have_function_body __$1 $2`
+        rc=`have_function_body $2 $3`
+        test ".$rc" = .0 && rc=`have_function_body __$2 $3`
         if [ $rc = 1 ]; then
             echo ok 1>&2
         else
@@ -858,7 +872,7 @@
 
 int main() {printf("%d", (int)sizeof($1));return 0;}
 EOF
-    rc=""
+    rc=0
     if [ ".$host" = .windows ]; then
         $cc $ccflags $cppopts $ldflags $test.c /link /out:$test$exe >/dev/null 2>&1
     else
@@ -866,7 +880,6 @@
     fi
     test -x $test$exe && rc=`./$test$exe 2>/dev/null`
     rm -rf $test.* $test *.pdb >/dev/null 2>&1 || true
-    test ".$rc" = . && rc="0"
     echo $rc 1>&2
     echo $rc
 }
@@ -907,14 +920,14 @@
     have_off64t=1
     sizeof_off64_t=`check_sizeof off64_t`
     test ".$sizeof_off64_t" = .0 && have_off64t=0
-    have_aio=`have_include aio`
-    have_libaio=`have_include libaio`
+    have_aio=`have_include 0 aio`
+    have_libaio=`have_include 0 libaio`
     if [ ".$have_libaio" = .1 ]; then
         have_libaio=`have_library aio`
         test ".$have_libaio" = .1 && varadds ldflags -laio
     fi
     have_windows=0
-    have_uuid_uuid=`have_include uuid/uuid`
+    have_uuid_uuid=`have_include 0 uuid/uuid`
     if [ ".$have_uuid_uuid" = .1 ]; then
         ok=`have_library uuid`
         if [ ".$ok" = .1 ]; then
@@ -928,15 +941,15 @@
     if [ ".$host" = .hpux ]; then
         have_strerror_r=0
     else
-        have_strerror_r=`have_function strerror_r`
+        have_strerror_r=`have_function 0 strerror_r`
     fi
-    have_mmap64=`have_function mmap64`
-    have_fdatasync=`have_function fdatasync`
-    have_posix_memalign=`have_function posix_memalign`
+    have_mmap64=`have_function 0 mmap64`
+    have_fdatasync=`have_function 0 fdatasync`
+    have_posix_memalign=`have_function 0 posix_memalign`
 fi
 
 if [ ".$host" = ".linux" ]; then
-    have_selinux=`have_include selinux/selinux`
+    have_selinux=`have_include 0 selinux/selinux`
     if [ ".$have_selinux" = .1 ]; then
         ok=`have_library selinux`
         if [ ".$ok" = .1 ]; then
@@ -952,7 +965,7 @@
 if [ ".$host" = ".solaris" ]; then
     have_port=`have_include port`
     if [ ".$have_port" = .1 ]; then
-        have_port=`have_function port_create`
+        have_port=`have_function 0 port_create`
     fi
     ok=`have_library kstat`
     test ".$ok" = .1 && varadds ldflags -lkstat
@@ -961,7 +974,7 @@
 fi
 
 if [ ".$has_openssl" = .yes ]; then
-    test ".$openssl_inc" != . && varadds includes "-I$openssl_inc"
+    test ".$openssl_inc" != . && varadds include "-I$openssl_inc"
     if [ ".$host" = .windows ]; then
         test ".$openssl_lib" != . && varadds sslflags "/libpath:\"$openssl_lib\""
         varadds sslflags libeay32.lib ssleay32.lib
@@ -971,7 +984,7 @@
     fi
     have_openssl=1
     varadds modules '??(SSLMODLIB)'
-    have_ocsp=`have_include openssl/ocsp`
+    have_ocsp=`have_include 1 openssl/ocsp`
 else
     have_ocsp=0
     have_openssl=0
@@ -983,6 +996,7 @@
     fi
 fi
 
+
 # Generate configuration header file
 #
 cat > $topdir/include/acr_config.h << EOF
@@ -1022,49 +1036,49 @@
 #define HAVE_SELINUX_H        $have_selinux
 #define HAVE_PORT_H           $have_port
 
-#define HAVE_UNISTD_H         `have_include unistd`
-#define HAVE_STRING_H         `have_include string`
-#define HAVE_STRINGS_H        `have_include strings`
-#define HAVE_INTTYPES_H       `have_include inttypes`
-#define HAVE_WTYPES_H         `have_include wtypes`
-#define HAVE_DLFCN_H          `have_include dlfcn`
-#define HAVE_LINK_H           `have_include link`
-#define HAVE_FCNTL_H          `have_include fcntl`
-#define HAVE_SYS_FILE_H       `have_include sys/file`
-#define HAVE_SYS_TYPES_H      `have_include sys/types`
-#define HAVE_SYS_CDEFS_H      `have_include sys/cdefs`
-#define HAVE_SYS_QUEUE_H      `have_include sys/queue`
-#define HAVE_SYS_RESOURCE_H   `have_include sys/resource`
-#define HAVE_SYS_SELECT_H     `have_include sys/select`
-#define HAVE_SYS_SOCKET_H     `have_include sys/socket`
-#define HAVE_SYS_WAIT_H       `have_include sys/wait`
-#define HAVE_SYS_SYSLIMITS_H  `have_include sys/syslimits`
-#define HAVE_SYS_UIO_H        `have_include sys/uio`
-#define HAVE_SYS_MMAN_H       `have_include sys/mman`
-#define HAVE_SYS_EPOLL_H      `have_include sys/epoll`
-#define HAVE_SYS_EVENTFD_H    `have_include sys/eventfd`
-#define HAVE_SYS_EVENT_H      `have_include sys/event`
-#define HAVE_SYS_INOTIFY_H    `have_include sys/inotify`
-#define HAVE_LIMITS_H         `have_include limits`
-#define HAVE_NETDB_H          `have_include netdb`
-#define HAVE_NETINET_IN_H     `have_include netinet/in`
-#define HAVE_ARPA_INET_H      `have_include arpa/inet`
-#define HAVE_RESOLV_H         `have_include resolv`
-#define HAVE_SYS_UN_H         `have_include sys/un`
-#define HAVE_UCONTEXT_H       `have_include ucontext`
+#define HAVE_UNISTD_H         `have_include 0 unistd`
+#define HAVE_STRING_H         `have_include 1 string`
+#define HAVE_STRINGS_H        `have_include 0 strings`
+#define HAVE_INTTYPES_H       `have_include 1 inttypes`
+#define HAVE_WTYPES_H         `have_include 1 wtypes`
+#define HAVE_DLFCN_H          `have_include 0 dlfcn`
+#define HAVE_LINK_H           `have_include 0 link`
+#define HAVE_FCNTL_H          `have_include 0 fcntl`
+#define HAVE_SYS_FILE_H       `have_include 0 sys/file`
+#define HAVE_SYS_TYPES_H      `have_include 1 sys/types`
+#define HAVE_SYS_CDEFS_H      `have_include 1 sys/cdefs`
+#define HAVE_SYS_QUEUE_H      `have_include 0 sys/queue`
+#define HAVE_SYS_RESOURCE_H   `have_include 0 sys/resource`
+#define HAVE_SYS_SELECT_H     `have_include 0 sys/select`
+#define HAVE_SYS_SOCKET_H     `have_include 0 sys/socket`
+#define HAVE_SYS_WAIT_H       `have_include 0 sys/wait`
+#define HAVE_SYS_SYSLIMITS_H  `have_include 0 sys/syslimits`
+#define HAVE_SYS_UIO_H        `have_include 0 sys/uio`
+#define HAVE_SYS_MMAN_H       `have_include 0 sys/mman`
+#define HAVE_SYS_EPOLL_H      `have_include 0 sys/epoll`
+#define HAVE_SYS_EVENTFD_H    `have_include 0 sys/eventfd`
+#define HAVE_SYS_EVENT_H      `have_include 0 sys/event`
+#define HAVE_SYS_INOTIFY_H    `have_include 0 sys/inotify`
+#define HAVE_LIMITS_H         `have_include 1 limits`
+#define HAVE_NETDB_H          `have_include 0 netdb`
+#define HAVE_NETINET_IN_H     `have_include 0 netinet/in`
+#define HAVE_ARPA_INET_H      `have_include 0 arpa/inet`
+#define HAVE_RESOLV_H         `have_include 0 resolv`
+#define HAVE_SYS_UN_H         `have_include 0 sys/un`
+#define HAVE_UCONTEXT_H       `have_include 0 ucontext`
 #define HAVE_STRERROR_R       $have_strerror_r
 #define HAVE_MMAP64           $have_mmap64
 #define HAVE_POSIX_MEMALIGN   $have_posix_memalign
 #define HAVE_FDATASYNC        $have_fdatasync
-#define HAVE_ACCEPT4          `have_function accept4`
-#define HAVE_CLOCK_GETTIME    `have_function clock_gettime`
-#define HAVE_DUP3             `have_function dup3`
-#define HAVE_EPOLL_CREATE1    `have_function epoll_create1`
-#define HAVE_KQUEUE           `have_function kqueue`
-#define HAVE_INOTIFY_INIT     `have_function inotify_init`
-#define HAVE_NANOSLEEP        `have_function nanosleep`
-#define HAVE_SIGSETJMP        `have_function sigsetjmp`
-#define HAVE_SIGACTION        `have_function sigaction`
+#define HAVE_ACCEPT4          `have_function 0 accept4`
+#define HAVE_CLOCK_GETTIME    `have_function 0 clock_gettime`
+#define HAVE_DUP3             `have_function 0 dup3`
+#define HAVE_EPOLL_CREATE1    `have_function 0 epoll_create1`
+#define HAVE_KQUEUE           `have_function 0 kqueue`
+#define HAVE_INOTIFY_INIT     `have_function 0 inotify_init`
+#define HAVE_NANOSLEEP        `have_function 0 nanosleep`
+#define HAVE_SIGSETJMP        `have_function 0 sigsetjmp`
+#define HAVE_SIGACTION        `have_function 0 sigaction`
 #define HAVE_SOCK_CLOEXEC     `have_flag_defined SOCK_CLOEXEC`
 #define HAVE_FILE_CLOEXEC     `have_flag_defined O_CLOEXEC`
 #define HAVE_OFF64_T          $have_off64t
@@ -1102,9 +1116,15 @@
 shflags=`echo $shflags | sed 's/??/\\$/g'`
 exflags=`echo $exflags | sed 's/??/\\$/g'`
 modules=`echo $modules | sed 's/??/\\$/g'`
+include=`echo $include | sed 's/??/\\$/g'`
 
 for m in $makefiles
 do
+    if [ ".$host" = .windows ]; then
+        makefile=$m.$mach
+    else
+        makefile=$m
+    fi
     sed -e 's|@cc@|'"$cc"'|g' \
     -e 's|@cpp@|'"$cpp"'|g' \
     -e 's|@cxx@|'"$cxx"'|g' \
@@ -1133,7 +1153,7 @@
     -e 's|@arflags@|'"$arflags"'|g' \
     -e 's|@sslflags@|'"$sslflags"'|g' \
     -e 's|@rcflags@|'"$rcflags"'|g' \
-    -e 's|@includes@|'"$includes"'|g' \
+    -e 's|@includes@|'"$include"'|g' \
     -e 's|@name@|'"$name"'|g' \
     -e 's|@vmajor@|'"$vmajor"'|g' \
     -e 's|@vminor@|'"$vminor"'|g' \
@@ -1141,11 +1161,11 @@
     -e 's|@platform@|'"$platform"'|g' \
     -e 's|@testobjs@|'"$testobjs"'|g' \
     -e 's|@modules@|'"$modules"'|g' \
-    $topdir/$m.in > $m
+    $topdir/$m.in > $makefile
 done
 
 if [ ".$host" = .windows ]; then
-    run_make="nmake -f Makefile.msc"
+    run_make="nmake -f Makefile.msc.$mach"
 else
     run_make=make
 fi