Browse Source

Ticket #261 - Add Solaris i386

https://fedorahosted.org/389/ticket/261
Resolves: Ticket #261
Bug Description: Add Solaris i386
Reviewed by: rmeggins
Branch: master
Fix Description: Allow building on Solaris i386
Platforms tested: RHEL6 x86_64 (build only)
Flag Day: yes - configure changes
Doc impact: no
Contributed by: cgrzemba (Thanks!)
Rich Megginson 13 years ago
parent
commit
ac6a81f6f8
5 changed files with 98 additions and 43 deletions
  1. 2 2
      Makefile.am
  2. 3 3
      Makefile.in
  3. 3 0
      config.h.in
  4. 75 33
      configure
  5. 15 5
      configure.ac

+ 2 - 2
Makefile.am

@@ -698,7 +698,7 @@ libslapd_la_SOURCES = ldap/servers/slapd/add.c \
 	$(libavl_a_SOURCES)
 
 libslapd_la_CPPFLAGS = $(PLUGIN_CPPFLAGS) @sasl_inc@ @db_inc@ @svrcore_inc@ @kerberos_inc@ @pcre_inc@
-if SOLARIS
+if SPARC
 libslapd_la_SOURCES += ldap/servers/slapd/slapi_counter_sunos_sparcv9.S
 endif
 
@@ -888,7 +888,7 @@ libcollation_plugin_la_SOURCES = ldap/servers/plugins/collation/collate.c \
         ldap/servers/plugins/collation/config.c \
         ldap/servers/plugins/collation/orfilter.c
 
-libcollation_plugin_la_CPPFLAGS = @icu_inc@ $(PLUGIN_CPPFLAGS)
+libcollation_plugin_la_CPPFLAGS = $(PLUGIN_CPPFLAGS) @icu_inc@
 libcollation_plugin_la_LIBADD = libslapd.la $(LDAPSDK_LINK) $(NSPR_LINK) $(ICU_LINK) $(LIBCSTD) $(LIBCRUN)
 libcollation_plugin_la_LDFLAGS = -avoid-version
 libcollation_plugin_la_LINK = $(CXXLINK) -avoid-version

+ 3 - 3
Makefile.in

@@ -45,7 +45,7 @@ bin_PROGRAMS = dbscan-bin$(EXEEXT) dsktune-bin$(EXEEXT) \
 	migratecred-bin$(EXEEXT) mmldif-bin$(EXEEXT) \
 	pwdhash-bin$(EXEEXT) rsearch-bin$(EXEEXT)
 noinst_PROGRAMS = makstrdb$(EXEEXT)
-@SOLARIS_TRUE@am__append_1 = ldap/servers/slapd/slapi_counter_sunos_sparcv9.S
+@SPARC_TRUE@am__append_1 = ldap/servers/slapd/slapi_counter_sunos_sparcv9.S
 @SOLARIS_TRUE@am__append_2 = -lrt
 @SOLARIS_TRUE@am__append_3 = ldap/servers/slapd/tools/ldclt/opCheck.c
 subdir = .
@@ -652,7 +652,7 @@ am__libslapd_la_SOURCES_DIST = ldap/servers/slapd/add.c \
 	ldap/servers/slapd/vattr.c ldap/libraries/libavl/avl.c \
 	ldap/servers/slapd/slapi_counter_sunos_sparcv9.S
 am__objects_2 = ldap/libraries/libavl/libslapd_la-avl.lo
-@SOLARIS_TRUE@am__objects_3 = ldap/servers/slapd/libslapd_la-slapi_counter_sunos_sparcv9.lo
+@SPARC_TRUE@am__objects_3 = ldap/servers/slapd/libslapd_la-slapi_counter_sunos_sparcv9.lo
 am_libslapd_la_OBJECTS = ldap/servers/slapd/libslapd_la-add.lo \
 	ldap/servers/slapd/libslapd_la-agtmmap.lo \
 	ldap/servers/slapd/libslapd_la-apibroker.lo \
@@ -2032,7 +2032,7 @@ libcollation_plugin_la_SOURCES = ldap/servers/plugins/collation/collate.c \
         ldap/servers/plugins/collation/config.c \
         ldap/servers/plugins/collation/orfilter.c
 
-libcollation_plugin_la_CPPFLAGS = @icu_inc@ $(PLUGIN_CPPFLAGS)
+libcollation_plugin_la_CPPFLAGS = $(PLUGIN_CPPFLAGS) @icu_inc@
 libcollation_plugin_la_LIBADD = libslapd.la $(LDAPSDK_LINK) $(NSPR_LINK) $(ICU_LINK) $(LIBCSTD) $(LIBCRUN)
 libcollation_plugin_la_LDFLAGS = -avoid-version
 libcollation_plugin_la_LINK = $(CXXLINK) -avoid-version

+ 3 - 0
config.h.in

@@ -104,6 +104,9 @@
 /* Define to 1 if you have the `getpagesize' function. */
 #undef HAVE_GETPAGESIZE
 
+/* have getpeerucred */
+#undef HAVE_GETPEERUCRED
+
 /* define if you have HEIMDAL Kerberos */
 #undef HAVE_HEIMDAL_KERBEROS
 

+ 75 - 33
configure

@@ -832,6 +832,8 @@ nss_inc
 nspr_libdir
 nspr_lib
 nspr_inc
+SPARC_FALSE
+SPARC_TRUE
 OPENLDAP_FALSE
 OPENLDAP_TRUE
 SELINUX_FALSE
@@ -5508,13 +5510,13 @@ if test "${lt_cv_nm_interface+set}" = set; then
 else
   lt_cv_nm_interface="BSD nm"
   echo "int some_variable = 0;" > conftest.$ac_ext
-  (eval echo "\"\$as_me:5511: $ac_compile\"" >&5)
+  (eval echo "\"\$as_me:5513: $ac_compile\"" >&5)
   (eval "$ac_compile" 2>conftest.err)
   cat conftest.err >&5
-  (eval echo "\"\$as_me:5514: $NM \\\"conftest.$ac_objext\\\"\"" >&5)
+  (eval echo "\"\$as_me:5516: $NM \\\"conftest.$ac_objext\\\"\"" >&5)
   (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out)
   cat conftest.err >&5
-  (eval echo "\"\$as_me:5517: output\"" >&5)
+  (eval echo "\"\$as_me:5519: output\"" >&5)
   cat conftest.out >&5
   if $GREP 'External.*some_variable' conftest.out > /dev/null; then
     lt_cv_nm_interface="MS dumpbin"
@@ -6720,7 +6722,7 @@ ia64-*-hpux*)
   ;;
 *-*-irix6*)
   # Find out which ABI we are using.
-  echo '#line 6723 "configure"' > conftest.$ac_ext
+  echo '#line 6725 "configure"' > conftest.$ac_ext
   if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
@@ -9285,11 +9287,11 @@ else
    -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:9288: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:9290: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>conftest.err)
    ac_status=$?
    cat conftest.err >&5
-   echo "$as_me:9292: \$? = $ac_status" >&5
+   echo "$as_me:9294: \$? = $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 other than the usual output.
@@ -9624,11 +9626,11 @@ else
    -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:9627: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:9629: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>conftest.err)
    ac_status=$?
    cat conftest.err >&5
-   echo "$as_me:9631: \$? = $ac_status" >&5
+   echo "$as_me:9633: \$? = $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 other than the usual output.
@@ -9729,11 +9731,11 @@ else
    -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:9732: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:9734: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>out/conftest.err)
    ac_status=$?
    cat out/conftest.err >&5
-   echo "$as_me:9736: \$? = $ac_status" >&5
+   echo "$as_me:9738: \$? = $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
@@ -9784,11 +9786,11 @@ else
    -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:9787: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:9789: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>out/conftest.err)
    ac_status=$?
    cat out/conftest.err >&5
-   echo "$as_me:9791: \$? = $ac_status" >&5
+   echo "$as_me:9793: \$? = $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
@@ -12587,7 +12589,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 12590 "configure"
+#line 12592 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -12683,7 +12685,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 12686 "configure"
+#line 12688 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -14703,11 +14705,11 @@ else
    -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:14706: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:14708: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>conftest.err)
    ac_status=$?
    cat conftest.err >&5
-   echo "$as_me:14710: \$? = $ac_status" >&5
+   echo "$as_me:14712: \$? = $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 other than the usual output.
@@ -14802,11 +14804,11 @@ else
    -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:14805: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:14807: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>out/conftest.err)
    ac_status=$?
    cat out/conftest.err >&5
-   echo "$as_me:14809: \$? = $ac_status" >&5
+   echo "$as_me:14811: \$? = $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
@@ -14854,11 +14856,11 @@ else
    -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:14857: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:14859: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>out/conftest.err)
    ac_status=$?
    cat out/conftest.err >&5
-   echo "$as_me:14861: \$? = $ac_status" >&5
+   echo "$as_me:14863: \$? = $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
@@ -21231,7 +21233,7 @@ _ACEOF
     # HPUX doesn't use /etc for this
     initdir=/init.d
     ;;
-  sparc-sun-solaris*)
+  *-*-solaris*)
 
 cat >>confdefs.h <<\_ACEOF
 #define XP_UNIX 1
@@ -21263,11 +21265,6 @@ cat >>confdefs.h <<\_ACEOF
 _ACEOF
 
 
-cat >>confdefs.h <<\_ACEOF
-#define CPU_sparc /**/
-_ACEOF
-
-
 cat >>confdefs.h <<\_ACEOF
 #define OS_solaris 1
 _ACEOF
@@ -21292,11 +21289,6 @@ cat >>confdefs.h <<\_ACEOF
 #define NO_DOMAINNAME 1
 _ACEOF
 
-
-cat >>confdefs.h <<\_ACEOF
-#define ATOMIC_64BIT_OPERATIONS 1
-_ACEOF
-
     LIBSOCKET=-lsocket
     LIBSOCKET=$LIBSOCKET
 
@@ -21313,9 +21305,29 @@ _ACEOF
     LIBCRUN=$LIBCRUN
 
     platform="solaris"
-    # assume 64 bit
-    perlexec='/usr/lib/sparcv9/dirsec/perl5x/bin/perl'
     initdir='$(sysconfdir)/init.d'
+    case $host in
+      i?86-*-solaris2.1[0-9]*)
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_GETPEERUCRED 1
+_ACEOF
+
+        ;;
+      sparc-*-solaris*)
+
+cat >>confdefs.h <<\_ACEOF
+#define ATOMIC_64BIT_OPERATIONS 1
+_ACEOF
+
+
+cat >>confdefs.h <<\_ACEOF
+#define CPU_sparc /**/
+_ACEOF
+
+        TARGET='SPARC'
+        ;;
+    esac
     ;;
   *)
     platform=""
@@ -24901,6 +24913,22 @@ else
   OPENLDAP_FALSE=
 fi
 
+ if test "$platform" = "solaris"; then
+  SOLARIS_TRUE=
+  SOLARIS_FALSE='#'
+else
+  SOLARIS_TRUE='#'
+  SOLARIS_FALSE=
+fi
+
+ if test "x$TARGET" = xSPARC; then
+  SPARC_TRUE=
+  SPARC_FALSE='#'
+else
+  SPARC_TRUE='#'
+  SPARC_FALSE=
+fi
+
 
 # write out paths for binary components
 
@@ -25236,6 +25264,20 @@ $as_echo "$as_me: error: conditional \"OPENLDAP\" was never defined.
 Usually this means the macro was only invoked conditionally." >&2;}
    { (exit 1); exit 1; }; }
 fi
+if test -z "${SOLARIS_TRUE}" && test -z "${SOLARIS_FALSE}"; then
+  { { $as_echo "$as_me:$LINENO: error: conditional \"SOLARIS\" was never defined.
+Usually this means the macro was only invoked conditionally." >&5
+$as_echo "$as_me: error: conditional \"SOLARIS\" was never defined.
+Usually this means the macro was only invoked conditionally." >&2;}
+   { (exit 1); exit 1; }; }
+fi
+if test -z "${SPARC_TRUE}" && test -z "${SPARC_FALSE}"; then
+  { { $as_echo "$as_me:$LINENO: error: conditional \"SPARC\" was never defined.
+Usually this means the macro was only invoked conditionally." >&5
+$as_echo "$as_me: error: conditional \"SPARC\" was never defined.
+Usually this means the macro was only invoked conditionally." >&2;}
+   { (exit 1); exit 1; }; }
+fi
 
 : ${CONFIG_STATUS=./config.status}
 ac_write_fail=0

+ 15 - 5
configure.ac

@@ -524,20 +524,18 @@ case $host in
     # HPUX doesn't use /etc for this
     initdir=/init.d
     ;;
-  sparc-sun-solaris*)
+  *-*-solaris*)
     AC_DEFINE([XP_UNIX], [1], [UNIX])
     AC_DEFINE([SVR4], [1], [SVR4])
     AC_DEFINE([__svr4], [1], [SVR4])
     AC_DEFINE([__svr4__], [1], [SVR4])
     AC_DEFINE([_SVID_GETTOD], [1], [SVID_GETTOD])
     AC_DEFINE([SOLARIS], [1], [SOLARIS])
-    AC_DEFINE([CPU_sparc], [], [cpu type sparc])
     AC_DEFINE([OS_solaris], [1], [OS SOLARIS])
     AC_DEFINE([sunos5], [1], [SunOS5])
     AC_DEFINE([OSVERSION], [509], [OS version])
     AC_DEFINE([_REENTRANT], [1], [_REENTRANT])
     AC_DEFINE([NO_DOMAINNAME], [1], [no getdomainname])
-    AC_DEFINE([ATOMIC_64BIT_OPERATIONS], [1], [enabling atomic counter])
 dnl socket nsl and dl are required to link several programs and libdb
     LIBSOCKET=-lsocket
     AC_SUBST([LIBSOCKET], [$LIBSOCKET])
@@ -551,9 +549,19 @@ dnl Cstd and Crun are required to link any C++ related code
     LIBCRUN=-lCrun
     AC_SUBST([LIBCRUN], [$LIBCRUN])
     platform="solaris"
-    # assume 64 bit
-    perlexec='/usr/lib/sparcv9/dirsec/perl5x/bin/perl'
     initdir='$(sysconfdir)/init.d'
+    case $host in
+      i?86-*-solaris2.1[[0-9]]*)
+dnl I dont know why i386 need this explicit
+        AC_DEFINE([HAVE_GETPEERUCRED], [1], [have getpeerucred])
+        ;;
+      sparc-*-solaris*)
+dnl includes some assembler stuff in counter.o
+        AC_DEFINE([ATOMIC_64BIT_OPERATIONS], [1], [enabling atomic counter])
+        AC_DEFINE([CPU_sparc], [], [cpu type sparc])
+        TARGET='SPARC'
+        ;;
+    esac
     ;;
   *)
     platform=""
@@ -612,6 +620,8 @@ fi
 
 AM_CONDITIONAL(SELINUX,test "$with_selinux" = "yes")
 AM_CONDITIONAL(OPENLDAP,test "$with_openldap" = "yes")
+AM_CONDITIONAL(SOLARIS,test "$platform" = "solaris")
+AM_CONDITIONAL(SPARC,test "x$TARGET" = xSPARC)
 
 # write out paths for binary components
 AC_SUBST(nspr_inc)