threads / discuss / 4781

git on HP-UX

Subject: git on HP-UX

## tl;dr

5 messages between Jul 6, 2006 and Jul 9, 2006.

replies: 4people: 4as markdown or json

Michal Rokos· Jul 6, 2006, 07:50 UTC · lore
Hello,

I needed following changes in order to make git compile on HP-UX: # uname -s -r -m HP-UX B.11.11 9000/800

Packages installed:
OpenSSL	A.00.09.07-d.002
perl		B.5.6.1.C
+ unofficial:
gcc		4.1.1
libiconv	1.10
make	3.80
zlib		1.2.3

Has to be compiled with: PERL_PATH=/opt/perl/bin/perl gmake prefix=/opt/git install

Please keep me on CC (I'm not subscribed).
Signed-off-by: Michal Rokos <michal.rokos@nextsoft.cz>
--- a/Makefile
+++ b/Makefile
@@ -328,6 +328,17 @@ ifeq ($(uname_S),IRIX64)
 	# for now, build 32-bit version
 	ALL_LDFLAGS += -L/usr/lib32
 endif
+ifeq ($(uname_S),HP-UX)
+	NO_IPV6 = YesPlease
+	NO_CURL = YesPlease
+	NO_SETENV = YesPlease
+	NO_STRCASESTR = YesPlease
+	NO_STRLCPY = YesPlease
+	NEEDS_LIBICONV = YesPlease
+	ALL_CFLAGS += -D_REENTRANT -D_XOPEN_SOURCE -D_HPUX_SOURCE -I/opt/openssl/include -Dhstrerror=strerror
+	ALL_LDFLAGS += -L/opt/openssl/lib
+	INSTALL = $(PWD)/compat/compat_install
+endif
 ifneq (,$(findstring arm,$(uname_M)))
 	ARM_SHA1 = YesPlease
 endif
--- a/compat/compat_install	2006-07-06 09:31:27.000000000 +0200
+++ b/compat/compat_install	2006-07-06 09:31:18.000000000 +0200
@@ -0,0 +1,34 @@
+#!/usr/bin/sh
+#
+# Copyright (c) 2006 Michal Rokos
+#
+# Dummy 'install' replacement intended to be used
+# on HP-UX under sh-posix.
+
+while getopts 'dm:' opt; do
+    case $opt in
+    d) DIR_MODE=1;;
+    m) MODE=$OPTARG;;
+    \?) echo "Unknown argument $OPTARG"; exit 1;;
+    esac
+done
+shift $((OPTIND-1))
+
+if [[ -n "$DIR_MODE" ]] && [[ -n "$MODE" ]]; then
+    mkdir -p -m "$MODE" "$@"
+elif [[ -n "$DIR_MODE" ]]; then
+    mkdir -p "$@"
+else
+    set -A args "$@"
+    last=$#
+    dest=${args[last-1]}
+    unset args[last-1]
+    set "${args[@]}"
+
+    cp "$@" "$dest"
+
+    [[ -n "$MODE" ]] && chmod "$MODE" "$@"
+fi
+
+exit 0
+
-- 
Michal Rokos

NextSoft s.r.o.
Vyskočilova 1/1410
140 21 Praha 4
phone:  +420 267 224 311
fax:    +420 267 224 307
mobile: +420 736 646 591
e-mail: michal.rokos@nextsoft.cz
Pavel Roskin· Jul 6, 2006, 14:53 UTC · re: Michal Rokos · lore

Re: git on HP-UX

Hello!
On Thu, 2006-07-06 at 09:50 +0200, Michal Rokos wrote:
Show 6 quoted lines
> Hello,
> 
> I needed following changes in order to make git compile on HP-UX:
> +ifeq ($(uname_S),HP-UX)
> +	NO_IPV6 = YesPlease
> +	NO_CURL = YesPlease

Is there any fundamental problem with curl and IPv6 on HP-UX? I don't think so.

Sorry for using your path as a bad example, but the appearance of such patches is a perfect argument for a real configure script. If we continue patching Makefile, we'll drown in such conditionals. And the worst thing is, nobody without access to an HP-UX system will know why IPv6 isn't working there. Makefile will become a pile of code that cannot be easily verified for correctness.

Autoconf based tests can actually test if certain code can be compiled and linked. If HP-UX fixed IPv6, the test would enable it. If some genius manages to compile curl on HP-UX, http support will be enabled on that machine with no manual changes in Makefile.

I hope the Autoconf based configure is on its way to git, but I don't see in in the "pu" branch yet. I'm not very keen about reinventing Autoconf and hacking a hand-made configure script.

-- 
Regards,
Pavel Roskin
Junio C Hamano· Jul 7, 2006, 00:20 UTC · re: Pavel Roskin · lore

Re: git on HP-UX

Pavel Roskin <proski@gnu.org> writes:
Show 11 quoted lines
>> I needed following changes in order to make git compile on HP-UX:
>> +ifeq ($(uname_S),HP-UX)
>> +	NO_IPV6 = YesPlease
>> +	NO_CURL = YesPlease
>
> Is there any fundamental problem with curl and IPv6 on HP-UX?  I don't
> think so.
>
> Sorry for using your path as a bad example, but the appearance of such
> patches is a perfect argument for a real configure script.  If we
> continue patching Makefile, we'll drown in such conditionals.

Conditionals like 'ifdef NO_IPV6' in Makefile are good, but conditionals switch on platforms to set/reset them are not. A configure script to set them in config.mak.gen is the way to go, I would agree.

> I hope the Autoconf based configure is on its way to git, but I don't
> see in in the "pu" branch yet.  I'm not very keen about reinventing
> Autoconf and hacking a hand-made configure script.

OK, you half-convinced me. The other half came from a recent series of patches to try using 'which' to detect executables, which is another common mistake handcrafted configure script makes, which autoconf people have solved for us long time ago.

Pavel Roskin· Jul 8, 2006, 07:38 UTC · re: Junio C Hamano · lore

Re: git on HP-UX

On Thu, 2006-07-06 at 17:20 -0700, Junio C Hamano wrote:
Show 9 quoted lines
> Pavel Roskin <proski@gnu.org> writes:
> > I hope the Autoconf based configure is on its way to git, but I don't
> > see in in the "pu" branch yet.  I'm not very keen about reinventing
> > Autoconf and hacking a hand-made configure script.
> 
> OK, you half-convinced me.  The other half came from a recent
> series of patches to try using 'which' to detect executables,
> which is another common mistake handcrafted configure script
> makes, which autoconf people have solved for us long time ago.

I really appreciate it. I hope all the Autoconf patches in the queue will land in "pu" shortly, and then I'm going to have a closer look at it.

-- 
Regards,
Pavel Roskin
Petr Baudis· Jul 9, 2006, 22:23 UTC · re: Junio C Hamano · lore

Re: git on HP-UX

Dear diary, on Fri, Jul 07, 2006 at 02:20:41AM CEST, I got a letter where Junio C Hamano <junkio@cox.net> said that...

Show 8 quoted lines
> > I hope the Autoconf based configure is on its way to git, but I don't
> > see in in the "pu" branch yet.  I'm not very keen about reinventing
> > Autoconf and hacking a hand-made configure script.
> 
> OK, you half-convinced me.  The other half came from a recent
> series of patches to try using 'which' to detect executables,
> which is another common mistake handcrafted configure script
> makes, which autoconf people have solved for us long time ago.

Good! In fact, I have been a moderate autoconf fan and originally I have meant the hand-crafted ./configure script partially just as a tease and a nominal competitor for the autoconf one, so that we would for sure got _some_ autoconfiguration mechanism (which is what I care about).

I have to admit that I have grown somewhat attached to my script over time and I like it a lot more than the autoconf thing personally, but then again I had no idea that we actually want to support such systems like those with broken which...

-- 
				Petr "Pasky" Baudis
Stuff: http://pasky.or.cz/
Snow falling on Perl. White noise covering line noise.
Hides all the bugs too. -- J. Putnam

← back to recent threads